From bb7822abad0d09cbd4a7bf794ae1ec95d2daca73 Mon Sep 17 00:00:00 2001 From: Vincent Fazio Date: Tue, 21 Feb 2023 11:21:54 -0600 Subject: [PATCH] package/pkg-autotools: add FOO_AUTOPOINT flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a new variable to run autopoint during autoreconf. This variable depends on FOO_AUTORECONF = YES. It is mutually exclusive to FOO_GETTEXTIZE. If both are set, FOO_AUTOPOINT is ignored to preserve previous behavior. This support is being added per a previous discussion [1]. The usage of gettextize needs to be removed cuz mama says so [2]. ... is not part of the GNU build system, in the sense that it should not be invoked automatically, and not be invoked by someone who doesn’t assume the responsibilities of a package maintainer. For the latter purpose, a separate tool is provided, see Invoking the autopoint Program [3] Using gettextize has the unintended consequence of updating the package based on the version of host-gettext vs what was chosen by the upstream maintainer. As mama said above, we should use autopoint. Do as she says to avoid further scolding (gettextize shoehorning and package patching). [1] https://patchwork.ozlabs.org/project/buildroot/patch/20170827110920.15579-1-aleksander@aleksander.es/ [2] https://www.gnu.org/software/gettext/manual/html_node/gettextize-Invocation.html [3] https://www.gnu.org/software/gettext/manual/html_node/autopoint-Invocation.html Signed-off-by: Vincent Fazio Signed-off-by: Arnout Vandecappelle --- package/pkg-autotools.mk | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk index 418cd10945..48485567d7 100644 --- a/package/pkg-autotools.mk +++ b/package/pkg-autotools.mk @@ -152,6 +152,15 @@ ifndef $(2)_GETTEXTIZE endif endif +ifndef $(2)_AUTOPOINT + ifdef $(3)_AUTOPOINT + $(2)_AUTOPOINT = $$($(3)_AUTOPOINT) + else + $(2)_AUTOPOINT ?= NO + endif +endif + + ifeq ($(4),host) $(2)_AUTORECONF_OPTS ?= $$($(3)_AUTORECONF_OPTS) endif @@ -240,8 +249,14 @@ ifeq ($$($(2)_AUTORECONF),YES) ifeq ($$($(2)_GETTEXTIZE),YES) $(2)_PRE_CONFIGURE_HOOKS += GETTEXTIZE_HOOK $(2)_DEPENDENCIES += host-gettext -endif $(2)_AUTORECONF_ENV += AUTOPOINT=/bin/true +# autopoint is provided by gettext +else ifeq ($$($(2)_AUTOPOINT),YES) +$(2)_DEPENDENCIES += host-gettext +$(2)_AUTORECONF_ENV += AUTOPOINT=$$(HOST_DIR)/bin/autopoint +else +$(2)_AUTORECONF_ENV += AUTOPOINT=/bin/true +endif $(2)_PRE_CONFIGURE_HOOKS += AUTORECONF_HOOK # default values are not evaluated yet, so don't rely on this defaulting to YES ifneq ($$($(2)_LIBTOOL_PATCH),NO)