pkg-autotools: add support for <pkg>_AUTORECONF_ENV
authorRick Taylor <tropicalstormuk@gmail.com>
Fri, 18 Jul 2014 09:12:19 +0000 (10:12 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Wed, 23 Jul 2014 21:49:10 +0000 (23:49 +0200)
This commit improves the autotools-package infrastructure to support a
<pkg>_AUTORECONF_ENV variable, which allows a package maintainer to
pass additional variables in the environment of the autoreconf
execution. This is useful in the situation where configure.ac contains
shell commands using environment variables that are only executed when
autoreconf is run.

Signed-off-by: Rick Taylor <rick.taylor@cassidian.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
docs/manual/adding-packages-autotools.txt
package/pkg-autotools.mk

index 3f405034cafde2cbac595d8812e5c219eead1cb5..4329ca7cea07df8ae7c53814a1cc992d0c22e69b 100644 (file)
@@ -121,6 +121,11 @@ cases, typical packages will therefore only use a few of them.
   automake, libtool, etc.). Valid values are +YES+ and
   +NO+. By default, the value is +NO+
 
+* +LIBFOO_AUTORECONF_ENV+, to specify additional environment
+  variables to pass to the 'autoreconf' program if
+  +LIBFOO_AUTORECONF=YES+. These are passed in the environment of
+  the 'autoreconf' command. By default, empty.
+  
 * +LIBFOO_AUTORECONF_OPT+ to specify additional options
   passed to the 'autoreconf' program if
   +LIBFOO_AUTORECONF=YES+. By default, empty.
index 53bca306457c8cd9cc7b313f8fa049b2d16e06e9..4443c72b05d8df6f23b8a9fadb9737dc6f5bb766 100644 (file)
@@ -224,7 +224,7 @@ endef
 #
 define AUTORECONF_HOOK
        @$$(call MESSAGE,"Autoreconfiguring")
-       $$(Q)cd $$($$(PKG)_SRCDIR) && $$(AUTORECONF) $$($$(PKG)_AUTORECONF_OPT)
+       $$(Q)cd $$($$(PKG)_SRCDIR) && $$($$(PKG)_AUTORECONF_ENV) $$(AUTORECONF) $$($$(PKG)_AUTORECONF_OPT)
        $$(Q)if test "$$($$(PKG)_LIBTOOL_PATCH)" = "YES"; then \
                for i in `find $$($$(PKG)_SRCDIR) -name ltmain.sh`; do \
                        ltmain_version=`sed -n '/^[     ]*VERSION=/{s/^[        ]*VERSION=//;p;q;}' $$$$i | \