summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann E. MORIN <yann.morin.1998@free.fr>2014-07-17 00:00:35 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-07-17 09:49:25 +0200
commit899258344f8df564cfb74f78741192aa26d1f102 (patch)
tree0e8666e0da49ac8a5efcb17008a14d7b7796c27d
parentcff18c2f347a46fb996808b6ac439e2a222aa189 (diff)
downloadbuildroot-899258344f8df564cfb74f78741192aa26d1f102.tar.gz
buildroot-899258344f8df564cfb74f78741192aa26d1f102.zip
pkg-autotools: add support to gettextize a package
In case a package comes with a gettext infra which is different from the one Buildroot provides, we'd get autoreconf errors, like: http://autobuild.buildroot.net/results/c0f/c0f7c801f61fdc310cde64342060b00a70155431/ To avoid that, we need to gettextize the package prior to running autoreconf. Provide the necessary infrastructure in the autotools infrastructure, so we can do it consistently across packages. 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: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-rw-r--r--package/pkg-autotools.mk33
1 files changed, 31 insertions, 2 deletions
diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk
index ddff9bfbce..50876cbdda 100644
--- a/package/pkg-autotools.mk
+++ b/package/pkg-autotools.mk
@@ -87,6 +87,22 @@ ifndef $(2)_AUTORECONF
endif
endif
+ifndef $(2)_GETTEXTIZE
+ ifdef $(3)_GETTEXTIZE
+ $(2)_GETTEXTIZE = $$($(3)_GETTEXTIZE)
+ else
+ $(2)_GETTEXTIZE ?= NO
+ endif
+endif
+
+ifndef $(2)_GETTEXTIZE_OPT
+ ifdef $(3)_GETTEXTIZE_OPT
+ $(2)_GETTEXTIZE_OPT = $$($(3)_GETTEXTIZE)
+ else
+ $(2)_GETTEXTIZE_OPT ?= -f
+ endif
+endif
+
ifeq ($(4),host)
$(2)_AUTORECONF_OPT ?= $$($(3)_AUTORECONF_OPT)
endif
@@ -200,6 +216,14 @@ $(2)_POST_PATCH_HOOKS += LIBTOOL_PATCH_HOOK
endif
#
+# Hook to gettextize the package if needed
+#
+define GETTEXTIZE_HOOK
+ @$$(call MESSAGE,"Gettextizing")
+ $(Q)cd $$($$(PKG)_SRCDIR) && $(HOST_DIR)/usr/bin/gettextize $$($$(PKG)_GETTEXTIZE_OPT)
+endef
+
+#
# Hook to autoreconf the package if needed
#
define AUTORECONF_HOOK
@@ -222,14 +246,19 @@ endef
# This must be repeated from inner-generic-package, otherwise we get an empty
# _DEPENDENCIES if _AUTORECONF is YES. Also filter the result of _AUTORECONF
-# away from the non-host rule
+# and _GETTEXTIZE away from the non-host rule
ifeq ($(4),host)
$(2)_DEPENDENCIES ?= $$(filter-out host-automake host-autoconf host-libtool \
- host-toolchain $(1),\
+ host-gettext host-toolchain $(1),\
$$(patsubst host-host-%,host-%,$$(addprefix host-,$$($(3)_DEPENDENCIES))))
endif
ifeq ($$($(2)_AUTORECONF),YES)
+# This has to come before autoreconf
+ifeq ($$($(2)_GETTEXTIZE),YES)
+$(2)_PRE_CONFIGURE_HOOKS += GETTEXTIZE_HOOK
+$(2)_DEPENDENCIES += host-gettext
+endif
$(2)_PRE_CONFIGURE_HOOKS += AUTORECONF_HOOK
$(2)_DEPENDENCIES += host-automake host-autoconf host-libtool
endif
OpenPOWER on IntegriCloud