Browse Source

infra/pkg-autotools: cleanup the gettextize step

Align the way we call gettextize to the way we call autoreconf:
  - provide the $(GETTEXTIZE) variable
  - pass $(HOST_CONFIGURE_OPTS) in the environment
  - pass the fully-qualified path to autom4te
  - use of -f even if the package provides its own options

Some eye-candy in the output of gettextize.

Thanks to Gustavo for pointing out the discrepancy between the way we
call gettextize and the way we call autoreconf, and to Thomas for the
live debug session. ;-)

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Yann E. MORIN 11 years ago
parent
commit
bea8f267d5
2 changed files with 11 additions and 7 deletions
  1. 8 0
      package/gettext/gettext.mk
  2. 3 7
      package/pkg-autotools.mk

+ 8 - 0
package/gettext/gettext.mk

@@ -57,6 +57,12 @@ endef
 
 
 GETTEXT_POST_INSTALL_TARGET_HOOKS += GETTEXT_REMOVE_UNNEEDED
 GETTEXT_POST_INSTALL_TARGET_HOOKS += GETTEXT_REMOVE_UNNEEDED
 
 
+define GETTEXT_GETTEXTIZE_EYE_CANDY
+	$(SED) '/Press Return\|read dummy/d' $(HOST_DIR)/usr/bin/gettextize
+endef
+
+HOST_GETTEXT_POST_INSTALL_HOOKS += GETTEXT_GETTEXTIZE_EYE_CANDY
+
 # Force build with NLS support, otherwise libintl is not built
 # Force build with NLS support, otherwise libintl is not built
 # This is needed because some packages (eg. libglib2) requires
 # This is needed because some packages (eg. libglib2) requires
 # locales, but do not properly depend on BR2_ENABLE_LOCALE, and
 # locales, but do not properly depend on BR2_ENABLE_LOCALE, and
@@ -72,5 +78,7 @@ define HOST_GETTEXT_GETTEXTIZE_CONFIRMATION
 endef
 endef
 HOST_GETTEXT_POST_INSTALL_HOOKS += HOST_GETTEXT_GETTEXTIZE_CONFIRMATION
 HOST_GETTEXT_POST_INSTALL_HOOKS += HOST_GETTEXT_GETTEXTIZE_CONFIRMATION
 
 
+GETTEXTIZE = $(HOST_CONFIGURE_OPTS) AUTOM4TE=$(HOST_DIR)/usr/bin/autom4te $(HOST_DIR)/usr/bin/gettextize -f
+
 $(eval $(autotools-package))
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
 $(eval $(host-autotools-package))

+ 3 - 7
package/pkg-autotools.mk

@@ -95,12 +95,8 @@ ifndef $(2)_GETTEXTIZE
  endif
  endif
 endif
 endif
 
 
-ifndef $(2)_GETTEXTIZE_OPT
- ifdef $(3)_GETTEXTIZE_OPT
-  $(2)_GETTEXTIZE_OPT = $$($(3)_GETTEXTIZE_OPT)
- else
-  $(2)_GETTEXTIZE_OPT ?= -f
- endif
+ifeq ($(4),host)
+ $(2)_GETTEXTIZE_OPT ?= $$($(3)_GETTEXTIZE_OPT)
 endif
 endif
 
 
 ifeq ($(4),host)
 ifeq ($(4),host)
@@ -220,7 +216,7 @@ endif
 #
 #
 define GETTEXTIZE_HOOK
 define GETTEXTIZE_HOOK
 	@$$(call MESSAGE,"Gettextizing")
 	@$$(call MESSAGE,"Gettextizing")
-	$(Q)cd $$($$(PKG)_SRCDIR) && $(HOST_DIR)/usr/bin/gettextize $$($$(PKG)_GETTEXTIZE_OPT)
+	$(Q)cd $$($$(PKG)_SRCDIR) && $$(GETTEXTIZE) $$($$(PKG)_GETTEXTIZE_OPT)
 endef
 endef
 
 
 #
 #