From dd0b8142683d35bdb7e04cc15ece43039ede2a41 Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Tue, 29 Aug 2017 14:16:24 +0200 Subject: config: Support AUTOMAKE_LIBDIR environment variable * lib/Automake/Config.in: Let AUTOMAKE_LIBDIR environment variable override the default location for '$libdir'. * doc/automake.texi (automake Invocation): Document AUTOMAKE_LIBDIR. * pre-inst-env.in (AUTOMAKE_LIBDIR): Set AUTOMAKE_LIBDIR. * bin/wrap-automake.in: Don't use "--libdir" option. --- bin/wrap-automake.in | 5 ----- doc/automake.texi | 5 +++++ lib/Automake/Config.in | 2 +- pre-inst-env.in | 3 +++ 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/bin/wrap-automake.in b/bin/wrap-automake.in index a363dbc7c..09b1b30f8 100644 --- a/bin/wrap-automake.in +++ b/bin/wrap-automake.in @@ -16,9 +16,4 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -BEGIN -{ - use strict; - unshift @ARGV, '--libdir=@abs_top_srcdir@/lib'; -} require '@abs_top_builddir@/bin/automake'; diff --git a/doc/automake.texi b/doc/automake.texi index 544f7c1e4..1f0b7e581 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -2579,6 +2579,11 @@ for more information. Look for Automake data files in directory @var{dir} instead of in the installation directory. This is typically used for debugging. +@vindex AUTOMAKE_LIBDIR +The environment variable @env{AUTOMAKE_LIBDIR} provides another way to +set the directory containing Automake data files. However +@option{--libdir} takes precedence over it. + @item --print-libdir @opindex --print-libdir Print the path of the installation directory containing Automake-provided diff --git a/lib/Automake/Config.in b/lib/Automake/Config.in index 9437eca9d..a22fdc0f7 100644 --- a/lib/Automake/Config.in +++ b/lib/Automake/Config.in @@ -32,7 +32,7 @@ our $PACKAGE = '@PACKAGE@'; our $PACKAGE_BUGREPORT = '@PACKAGE_BUGREPORT@'; our $VERSION = '@VERSION@'; our $RELEASE_YEAR = '@RELEASE_YEAR@'; -our $libdir = '@datadir@/@PACKAGE@-@APIVERSION@'; +our $libdir = $ENV{"AUTOMAKE_LIBDIR"} || '@datadir@/@PACKAGE@-@APIVERSION@'; our $perl_threads = 0; # We need at least this version for CLONE support. diff --git a/pre-inst-env.in b/pre-inst-env.in index 1599c7b5d..880012cce 100644 --- a/pre-inst-env.in +++ b/pre-inst-env.in @@ -29,4 +29,7 @@ export PATH AUTOMAKE_UNINSTALLED=1 export AUTOMAKE_UNINSTALLED +AUTOMAKE_LIBDIR="$abs_top_srcdir/lib" +export AUTOMAKE_LIBDIR + exec "$@" -- cgit v1.2.1