]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
aclocal: modernize and simplify AC_CONFIG_MACRO_DIR* tracing experimental/ac-config-macro-dir-simplify
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 24 Nov 2012 18:54:52 +0000 (19:54 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 21 Feb 2013 16:04:57 +0000 (17:04 +0100)
Do so by assuming that AC_CONFIG_MACRO_DIRS is defined, and that we can
handle it and AC_CONFIG_MACRO_DIR by tracing AC_CONFIG_MACRO_DIR_TRACE.
We can do so since Automake 1.14 will require Autoconf 2.70 or later.

* Makefile.am (automake_internal_acdir): Remove.
(dist_automake_internal_ac_DATA): Likewise.
* m4/internal/ac-config-macro-dirs.m4: Delete.
* aclocal.in (trace_used_macros): No longer pass the path of
'internal/ac-config-macro-dirs.m4' to the autom4te invocation.
No longer trace nor handle macros 'AC_CONFIG_MACRO_DIR' and
'_AM_CONFIG_MACRO_DIRS'.
No longer uniquify '@ac_config_macro_dirs' explicitly.
($ac_config_macro_dirs_fallback): Remove.
No longer emit its content in the generated aclocal.m4.
* t/aclocal-acdir.sh: Remove a now-unneeded workaround.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Makefile.am
aclocal.in
m4/internal/ac-config-macro-dirs.m4 [deleted file]
t/aclocal-acdir.sh

index e4817265bca178b4b34be745089544ba20bdd5b0..47accba64d90594bb8299492c5d5537aaf64a03a 100644 (file)
@@ -297,9 +297,6 @@ dist_automake_ac_DATA = \
   m4/upc.m4 \
   m4/vala.m4
 
-automake_internal_acdir = $(automake_acdir)/internal
-dist_automake_internal_ac_DATA = m4/internal/ac-config-macro-dirs.m4
-
 dist_system_ac_DATA = m4/acdir/README
 
 # We build amversion.m4 here, instead of from config.status,
index df60d9c8466f1b6fa832252b10132c66599c6b53..4287c4a773f88782cdb99e163094079263367855 100644 (file)
@@ -45,16 +45,6 @@ use File::Path ();
 
 # Some globals.
 
-# Support AC_CONFIG_MACRO_DIRS also with older autoconf.
-# FIXME: To be removed in Automake 2.0, once we can assume autoconf
-#        2.70 or later.
-# FIXME: keep in sync with 'internal/ac-config-macro-dirs.m4'.
-my $ac_config_macro_dirs_fallback =
-  'm4_ifndef([AC_CONFIG_MACRO_DIRS], [' .
-    'm4_defun([_AM_CONFIG_MACRO_DIRS], [])' .
-    'm4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])' .
-  '])';
-
 # We do not operate in threaded mode.
 $perl_threads = 0;
 
@@ -759,15 +749,6 @@ sub trace_used_macros ()
   $traces .= " --language Autoconf-without-aclocal-m4 ";
   $traces = "echo '$early_m4_code' | $traces - ";
 
-  # Support AC_CONFIG_MACRO_DIRS also with older autoconf.
-  # Note that we can't use '$ac_config_macro_dirs_fallback' here, because
-  # a bug in option parsing code of autom4te 2.68 and earlier will cause
-  # it to read standard input last, even if the "-" argument is specified
-  # early.
-  # FIXME: To be removed in Automake 2.0, once we can assume autoconf
-  #        2.70 or later.
-  $traces .= "$automake_includes[0]/internal/ac-config-macro-dirs.m4 ";
-
   # All candidate files.
   $traces .= join (' ',
                   (map { "'$_'" }
@@ -781,12 +762,7 @@ sub trace_used_macros ()
                     'AU_DEFUN',
                     '_AM_AUTOCONF_VERSION',
                     'AC_CONFIG_MACRO_DIR_TRACE',
-                     # FIXME: Tracing the next two macros is a hack for
-                     # compatibility with older autoconf.  Remove this in
-                     # Automake 2.0, when we can assume Autoconf 2.70 or
-                     # later.
-                    'AC_CONFIG_MACRO_DIR',
-                    '_AM_CONFIG_MACRO_DIRS')),
+                   )),
                   # Do not trace $1 for all other macros as we do
                   # not need it and it might contains harmful
                   # characters (like newlines).
@@ -820,30 +796,8 @@ sub trace_used_macros ()
         {
           push @ac_config_macro_dirs, $arg1;
         }
-      # FIXME: We still need to trace AC_CONFIG_MACRO_DIR
-      # for compatibility with older autoconf.  Remove this
-      # once we can assume Autoconf 2.70 or later.
-      elsif ($macro eq 'AC_CONFIG_MACRO_DIR')
-        {
-          @ac_config_macro_dirs = ($arg1);
-        }
-      # FIXME:This is an hack for compatibility with older autoconf.
-      # Remove this once we can assume Autoconf 2.70 or later.
-      elsif ($macro eq '_AM_CONFIG_MACRO_DIRS')
-        {
-           # Empty leading/trailing fields might be produced by split,
-           # hence the grep is really needed.
-           push @ac_config_macro_dirs, grep (/./, (split /\s+/, $arg1));
-        }
     }
 
-  # FIXME: in Autoconf >= 2.70, AC_CONFIG_MACRO_DIR calls
-  # AC_CONFIG_MACRO_DIR_TRACE behind the scenes, which could
-  # leave unwanted duplicates in @ac_config_macro_dirs.
-  # Remove this in Automake 2.0, when we'll stop tracing
-  # AC_CONFIG_MACRO_DIR explicitly.
-  @ac_config_macro_dirs = uniq @ac_config_macro_dirs;
-
   $tracefh->close;
 
   return %traced;
@@ -969,7 +923,6 @@ $output";
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
-$ac_config_macro_dirs_fallback
 $output";
 
   # We try not to update $output_file unless necessary, because
diff --git a/m4/internal/ac-config-macro-dirs.m4 b/m4/internal/ac-config-macro-dirs.m4
deleted file mode 100644 (file)
index 2684883..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-# Support AC_CONFIG_MACRO_DIRS with older autoconf.     -*- Autoconf -*-
-# FIXME: To be removed in Automake 2.0, once we can assume autoconf
-#        2.70 or later.
-# FIXME: keep in sync with the contents of the variable
-#        '$ac_config_macro_dirs_fallback' in aclocal.in.
-
-# Copyright (C) 2012-2013 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-m4_ifndef([AC_CONFIG_MACRO_DIRS],
-[m4_defun([_AM_CONFIG_MACRO_DIRS],[])]dnl
-[m4_defun([AC_CONFIG_MACRO_DIRS],[_AM_CONFIG_MACRO_DIRS($@)])])
index e363e670e32e279719511bbd09e8e0b980e3d170..e93df62e14890a85cb856b35c71244281c68fd3f 100755 (executable)
@@ -21,9 +21,6 @@
 . test-init.sh
 
 mkdir am sys
-# FIXME: remove in Automake 2.0
-mkdir am/internal
-: > am/internal/ac-config-macro-dirs.m4
 
 cat >> configure.ac <<'END'
 MY_MACRO