This patch simplifies the overly complicated rules for ACLOCAL_PATH
vs. @automake_includes and @system_includes, by stating that
ACLOCAL_PATH will override even @automake_includes. The simplest
way to achieve this is to remove @automake_includes altogether.
There are two small visible differences here with respect to 1.11:
- "--acdir ${datadir}/prefix/aclocal-VERSION" will treat files
in acdir as FT_AUTOMAKE, and special case them with respect to the
serial number. This option makes no sense, but I like the new
semantics better.
- if "${datadir}/prefix/aclocal-VERSION" does not exist, aclocal
will not warn about it. This shouldn't happen anyway, so I think we
can live with this.
The third difference is of course in the semantics of ACLOCAL_PATH.
* NEWS: Adapt to change in ACLOCAL_PATH semantics.
* aclocal.in (default_automake_dir): New.
(scan_file): Use it to distinguish FT_AUTOMAKE from FT_SYSTEM.
(automake_includes): Remove.
(scan_m4_files): Do not scan it.
(have_ac_dir): New.
(parse_arguments): Set it for --acdir instead of automake_includes, use it
to determine whether to filter absent directories out of @system_includes.
Allow >1 directory in @system_includes for --print-ac-dir.
* doc/automake.texi: Adapt to changes in ACLOCAL_PATH semantics.
* tests/acloca25.test: Likewise.
---
ChangeLog | 15 +++
NEWS|4 ++--
aclocal.in | 36 +---
doc/automake.texi |6 ++
tests/acloca25.test |7 +--
5 files changed, 41 insertions(+), 27 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index fa43c14..ede73dc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
2010-11-09 Paolo Bonzini
+ aclocal: remove @automake_includes.
+ * NEWS: Adapt to changes in ACLOCAL_PATH semantics.
+ * aclocal.in (default_automake_dir): New.
+ (scan_file): Use it to distinguish FT_AUTOMAKE from FT_SYSTEM.
+ (automake_includes): Remove.
+ (scan_m4_files): Do not scan it.
+ (have_ac_dir): New.
+ (parse_arguments): Set it for --acdir instead of automake_includes, use
it
+ to determine whether to filter absent directories out of
@system_includes.
+ Allow >1 directory in @system_includes for --print-ac-dir.
+ * doc/automake.texi: Adapt to changes in ACLOCAL_PATH semantics.
+ * tests/acloca25.test: Likewise.
+
+2010-11-09 Paolo Bonzini
+
aclocal: handle ACLOCAL_PATH environment variable.
* NEWS: Document new behavior.
* aclocal.in (parse_arguments): Parse ACLOCAL_PATH as a colon-separated
diff --git a/NEWS b/NEWS
index 9dd7860..eb732d9 100644
--- a/NEWS
+++ b/NEWS
@@ -3,8 +3,8 @@ New in 1.11a:
* Changes to aclocal:
- aclocal now interprets the `ACLOCAL_PATH' environment variable as a
-colon-separated list of additional directories to search after
-${prefix}/share/aclocal-VERSION and before ${prefix}/share/aclocal.
+colon-separated list of additional directories to search before
+${prefix}/share/aclocal-VERSION and ${prefix}/share/aclocal.
* Changes to automake:
diff --git a/aclocal.in b/aclocal.in
index 942d8e3..1d73f49 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -50,16 +50,20 @@ use Cwd;
# We do not operate in threaded mode.
$perl_threads = 0;
+# This directory is treated specially with respect to serial numbers.
+my $default_automake_dir = "@datadir@/aclocal-$APIVERSION";
+
# Include paths for searching macros. We search macros in this order:
# user-supplied directories first, then the directory containing the
# automake macros, and finally the system-wide directories for
# third-party macros. @user_includes can be augmented with -I.
# @system_includes can be augmented with the `dirlist' file or
-# ACLOCAL_PATH. Also --acdir will reset both @automake_includes
-# and @system_includes.
+# ACLOCAL_PATH.
my @user_includes = ();
-my @automake_includes = ("@datadir@/aclocal-$APIVERSION");
-my @system_includes = ('@datadir@/aclocal');
+my @system_includes = ($default_automake_dir, '@datadir@/aclocal');
+
+# Whether --acdir was passed.
+my $have_acdir = 0;
# Whether we should copy M4 file in $user_includes[0].
my $install = 0;
@@ -346,7 +350,6 @@ sub scan_m4_files ()
# Finally, scan all files in our search paths.
scan_m4_dirs (FT_USER, @user_includes);
- scan_m4_dirs (FT_AUTOMAKE, @automake_includes);
scan_m4_dirs (FT_SYSTEM, @system_includes);
# Construct a new function that does the searching. We use a
@@ -464,8 +467,8 @@ my $underquoted_manual_once = 0;
#
# Scan a single M4 file ($FILE), and all files it includes.
# Return the list of included files.
-# $TYPE is one of FT_USER, FT_AUTOMAKE, or FT_SYSTEM, depending
-# on where the file comes from.
+# $TYPE is one of FT_USER or FT_SYSTEM, depending on where
+# the file comes from.
# $WHERE is the location to use in the diagnostic if the file
# does not exist.
sub scan_file ($$$)
@@