mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2024-12-29 17:23:36 +00:00
cpupower: add checks for xgettext and msgfmt
Check whether xgettext and msgfmt are available on the system before attempting to generate GNU gettext Language Translations. In case of missing dependency, generate error message directing user to install the necessary package. Tested-by: John B. Wyatt IV <jwyatt@redhat.com> Tested-by: John B. Wyatt IV <sageofredondo@gmail.com> Suggested-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Siddharth Menon <simeddon@gmail.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
This commit is contained in:
parent
b78abc21b2
commit
47d7650b9c
@ -218,17 +218,28 @@ else
|
|||||||
endif
|
endif
|
||||||
$(QUIET) $(STRIPCMD) $@
|
$(QUIET) $(STRIPCMD) $@
|
||||||
|
|
||||||
|
ifeq (, $(shell which xgettext))
|
||||||
|
$(warning "Install xgettext to extract translatable strings.")
|
||||||
|
else
|
||||||
$(OUTPUT)po/$(PACKAGE).pot: $(UTIL_SRC)
|
$(OUTPUT)po/$(PACKAGE).pot: $(UTIL_SRC)
|
||||||
$(ECHO) " GETTEXT " $@
|
$(ECHO) " GETTEXT " $@
|
||||||
$(QUIET) xgettext --default-domain=$(PACKAGE) --add-comments \
|
$(QUIET) xgettext --default-domain=$(PACKAGE) --add-comments \
|
||||||
--keyword=_ --keyword=N_ $(UTIL_SRC) -p $(@D) -o $(@F)
|
--keyword=_ --keyword=N_ $(UTIL_SRC) -p $(@D) -o $(@F)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq (, $(shell which msgfmt))
|
||||||
|
$(warning "Install msgfmt to generate binary message catalogs.")
|
||||||
|
else
|
||||||
$(OUTPUT)po/%.gmo: po/%.po
|
$(OUTPUT)po/%.gmo: po/%.po
|
||||||
$(ECHO) " MSGFMT " $@
|
$(ECHO) " MSGFMT " $@
|
||||||
$(QUIET) msgfmt -o $@ po/$*.po
|
$(QUIET) msgfmt -o $@ po/$*.po
|
||||||
|
endif
|
||||||
|
|
||||||
create-gmo: ${GMO_FILES}
|
create-gmo: ${GMO_FILES}
|
||||||
|
|
||||||
|
ifeq (, $(shell which msgmerge))
|
||||||
|
$(warning "Install msgmerge to merge translations.")
|
||||||
|
else
|
||||||
update-po: $(OUTPUT)po/$(PACKAGE).pot
|
update-po: $(OUTPUT)po/$(PACKAGE).pot
|
||||||
$(ECHO) " MSGMRG " $@
|
$(ECHO) " MSGMRG " $@
|
||||||
$(QUIET) @for HLANG in $(LANGUAGES); do \
|
$(QUIET) @for HLANG in $(LANGUAGES); do \
|
||||||
@ -241,6 +252,7 @@ update-po: $(OUTPUT)po/$(PACKAGE).pot
|
|||||||
rm -f $(OUTPUT)po/$$HLANG.new.po; \
|
rm -f $(OUTPUT)po/$$HLANG.new.po; \
|
||||||
fi; \
|
fi; \
|
||||||
done;
|
done;
|
||||||
|
endif
|
||||||
|
|
||||||
compile-bench: $(OUTPUT)libcpupower.so.$(LIB_MAJ)
|
compile-bench: $(OUTPUT)libcpupower.so.$(LIB_MAJ)
|
||||||
@V=$(V) confdir=$(confdir) $(MAKE) -C bench O=$(OUTPUT)
|
@V=$(V) confdir=$(confdir) $(MAKE) -C bench O=$(OUTPUT)
|
||||||
|
Loading…
Reference in New Issue
Block a user