]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
aclocal: Support ACLOCAL_AUTOMAKE_DIR environment variable
authorMathieu Lirzin <mthl@gnu.org>
Tue, 29 Aug 2017 19:15:14 +0000 (21:15 +0200)
committerMathieu Lirzin <mthl@gnu.org>
Wed, 30 Aug 2017 22:33:59 +0000 (00:33 +0200)
* bin/aclocal.in: Reset '@automake_includes' and '@system_includes' in
for build environment.  Allow setting '@automake_includes' with
ACLOCAL_AUTOMAKE_DIR environment variable.
(parse_arguments): Ignore 'dirlist' when '@system_includes' is empty.
* doc/automake.texi (aclocal Options): Document ACLOCAL_AUTOMAKE_DIR.
* bin/wrap-aclocal.in: Remove extra command line options.
* pre-inst-env.in: Set ACLOCAL_AUTOMAKE_DIR and ACLOCAL_PATH
environment variables.
* t/ax/test-defs.in: Adapt.
* t/ansi2knr-no-more.sh (warn_rx): Likewise.

bin/aclocal.in
bin/wrap-aclocal.in
doc/automake.texi
pre-inst-env.in
t/ansi2knr-no-more.sh
t/ax/test-defs.in

index abd352376b4095707be469affb485f0e4d918d8e..738996f394a27c4a3975e7aa822f241cb2b79730 100644 (file)
@@ -1111,7 +1111,7 @@ sub parse_arguments ()
     }
 
   # Finally, adds any directory listed in the 'dirlist' file.
-  if (open (DIRLIST, "$system_includes[0]/dirlist"))
+  if (@system_includes && open (DIRLIST, "$system_includes[0]/dirlist"))
     {
       while (<DIRLIST>)
         {
@@ -1146,6 +1146,16 @@ sub parse_ACLOCAL_PATH ()
 
 ################################################################
 
+# Don't refer to installation directories from the build environment
+if (exists $ENV{"AUTOMAKE_UNINSTALLED"})
+  {
+    @automake_includes = ();
+    @system_includes = ();
+  }
+
+@automake_includes = ($ENV{"ACLOCAL_AUTOMAKE_DIR"})
+  if (exists $ENV{"ACLOCAL_AUTOMAKE_DIR"});
+
 parse_WARNINGS;                    # Parse the WARNINGS environment variable.
 parse_arguments;
 parse_ACLOCAL_PATH;
index 2fcccb4a2ac6d4ead39a98d018faa7a55d484330..e6e4782d23612b621ab6050ad25d90397a5c7e42 100644 (file)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-BEGIN
-{
-  use strict;
-  unshift @ARGV,
-    '--automake-acdir=@abs_top_srcdir@/m4',
-    '--system-acdir=@abs_top_srcdir@/m4/acdir';
-}
 require '@abs_top_builddir@/bin/aclocal';
index 1f0b7e581784993b75a212b74b6e6d845e90e658..dbe222d205405f8b5b7fc7afbf84f2e721c999c2 100644 (file)
@@ -3221,6 +3221,11 @@ overridden using the @env{AUTOM4TE} environment variable.
 Look for the automake-provided macro files in @var{dir} instead of
 in the installation directory.  This is typically used for debugging.
 
+@vindex ACLOCAL_AUTOMAKE_DIR
+The environment variable @env{ACLOCAL_AUTOMAKE_DIR} provides another
+way to set the directory containing automake-provided macro files.
+However @option{--automake-acdir} takes precedence over it.
+
 @item --system-acdir=@var{dir}
 @opindex --system-acdir
 Look for the system-wide third-party macro files (and the special
index 880012cce3a625051b1c1b9b8faf90badcee5086..f285ca62cc3637f87bf9e5ceb225f45fa667c52a 100644 (file)
@@ -32,4 +32,10 @@ export AUTOMAKE_UNINSTALLED
 AUTOMAKE_LIBDIR="$abs_top_srcdir/lib"
 export AUTOMAKE_LIBDIR
 
+ACLOCAL_AUTOMAKE_DIR="$abs_top_srcdir/m4"
+export ACLOCAL_AUTOMAKE_DIR
+
+ACLOCAL_PATH="$abs_top_srcdir/m4/acdir"
+export ACLOCAL_PATH
+
 exec "$@"
index f9128022b94467d87ef8d892b603a7e771515466..8c13cd0a3a100a3983129125853dd4426aa1a93f 100644 (file)
@@ -32,7 +32,7 @@ $ACLOCAL -Wnone 2>stderr && { cat stderr >&2; exit 1; }
 cat stderr >&2
 grep "^configure\\.ac:5:.*$warn_rx" stderr
 
-cat aclocal.sav "$am_automake_acdir"/obsolete.m4 > aclocal.m4
+cat aclocal.sav "$am_top_srcdir"/m4/obsolete.m4 > aclocal.m4
 $AUTOCONF -Wnone 2>stderr && { cat stderr >&2; exit 1; }
 cat stderr >&2
 grep "^configure\\.ac:5:.*$warn_rx" stderr
index b4a690fc61dddf6db255192a7a5a4dc91ac353fe..8cace053bbbaeb5b7eaea447832947f6591f6c82 100644 (file)
@@ -55,13 +55,13 @@ case ${am_running_installcheck:=no} in
     ;;
   no)
     am_amdir=$am_top_srcdir/lib/am
-    am_automake_acdir=$am_top_srcdir/m4
+    am_automake_acdir=""
     am_bindir=$am_top_builddir/bin
     am_datadir=$am_top_srcdir
     am_docdir=$am_top_srcdir/doc
     am_pkgvdatadir=$am_top_srcdir/lib
     am_scriptdir=$am_top_srcdir/lib
-    am_system_acdir=$am_top_srcdir/m4/acdir
+    am_system_acdir=""
     ;;
   *)
     echo "$me: variable 'am_running_installcheck' has invalid"