Skip to contentSkip to conversation

infra/pkg-autotools: cleanup the gettextize step

PATCH Superseded Yann E. MORIN 1 participant 2 messages Jul 18, 2014

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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. ;-)

Cc Gustavo Zacarias <[email protected]>
Cc Thomas Petazzoni <[email protected]>
---
 package/gettext/gettext.mk |  8 ++++++++
 package/pkg-autotools.mk   | 10 +++-------
 2 files changed, 11 insertions(+), 7 deletions(-)
package/gettext/gettext.mk +8 -0
index c8ef765..924f541 100644
@@ -57,6 +57,12 @@ endef
 
 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
 # This is needed because some packages (eg. libglib2) requires
 # locales, but do not properly depend on BR2_ENABLE_LOCALE, and
@@ -72,5 +78,7 @@ define HOST_GETTEXT_GETTEXTIZE_CONFIRMATION
 endef
 HOST_GETTEXT_POST_INSTALL_HOOKS += HOST_GETTEXT_GETTEXTIZE_CONFIRMATION
 
+GETTEXTIZE = $(HOST_CONFIGURE_OPTS) AUTOM4TE=$(HOST_DIR)/usr/bin/autm4te $(HOST_DIR)/usr/bin/gettextize -f
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
package/pkg-autotools.mk +3 -7
index 557413d..53bca30 100644
@@ -95,12 +95,8 @@ ifndef $(2)_GETTEXTIZE
  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
 
 ifeq ($(4),host)
@@ -220,7 +216,7 @@ endif
 #
 define GETTEXTIZE_HOOK
 	@$$(call MESSAGE,"Gettextizing")
-	$(Q)cd $$($$(PKG)_SRCDIR) && $(HOST_DIR)/usr/bin/gettextize $$($$(PKG)_GETTEXTIZE_OPT)
+	$(Q)cd $$($$(PKG)_SRCDIR) && $$(GETTEXTIZE) $$($$(PKG)_GETTEXTIZE_OPT)
 endef
 
 #
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 1/1 infra/pkg-autotools: cleanup the gettextize step

All,

On 2014-07-18 19:52 +0200, Yann E. MORIN spake thusly:

Quoted 38 lines

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. ;-)

Cc Gustavo Zacarias <[email protected]>
Cc Thomas Petazzoni <[email protected]>
---
 package/gettext/gettext.mk |  8 ++++++++
 package/pkg-autotools.mk   | 10 +++-------
 2 files changed, 11 insertions(+), 7 deletions(-)
package/gettext/gettext.mk +6 -0
index c8ef765..924f541 100644
@@ -57,6 +57,12 @@ endef
 
 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
 # This is needed because some packages (eg. libglib2) requires
 # locales, but do not properly depend on BR2_ENABLE_LOCALE, and

package/gettext/gettext.mk define HOST_GETTEXT_GETTEXTIZE_CONFIRMATION · line 81

Quoted 4 lines
package/gettext/gettext.mk +1 -0
@@ -72,5 +78,7 @@ define HOST_GETTEXT_GETTEXTIZE_CONFIRMATION
 endef
 HOST_GETTEXT_POST_INSTALL_HOOKS += HOST_GETTEXT_GETTEXTIZE_CONFIRMATION
 
+GETTEXTIZE = $(HOST_CONFIGURE_OPTS) AUTOM4TE=$(HOST_DIR)/usr/bin/autm4te $(HOST_DIR)/usr/bin/gettextize -f

Sigh, I forgot to commit the typo s/autm4te/autom4te/ :-(

Will repsin shortly...

Regards,
Yann E. MORIN.

Quoted 33 lines
package/gettext/gettext.mk +0 -0
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
package/pkg-autotools.mk +3 -7
index 557413d..53bca30 100644
@@ -95,12 +95,8 @@ ifndef $(2)_GETTEXTIZE
  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
 
 ifeq ($(4),host)
@@ -220,7 +216,7 @@ endif
 #
 define GETTEXTIZE_HOOK
 	@$$(call MESSAGE,"Gettextizing")
-	$(Q)cd $$($$(PKG)_SRCDIR) && $(HOST_DIR)/usr/bin/gettextize $$($$(PKG)_GETTEXTIZE_OPT)
+	$(Q)cd $$($$(PKG)_SRCDIR) && $$(GETTEXTIZE) $$($$(PKG)_GETTEXTIZE_OPT)
 endef
 
 #
Signature · 1 line
1.9.1
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'