summaryrefslogtreecommitdiff
path: root/aclocal.in
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2011-09-20 20:16:43 +0200
committerStefano Lattarini <stefano.lattarini@gmail.com>2011-09-20 20:16:43 +0200
commit8f80364582061d4bb13b74de9cd1ad35556a7afe (patch)
treef29e3be4d81b7edd1d03bd80d79015f98c845070 /aclocal.in
parentb52f63c824a044e8adcde2ffe3640e0074c615a1 (diff)
parent122cb639106d5b3a8dad966e43af03426670642a (diff)
downloadautomake-8f80364582061d4bb13b74de9cd1ad35556a7afe.tar.gz
Merge branch 'maint'
* maint: docs: document planned precedence changes in aclocal search path aclocal: handle ACLOCAL_PATH environment variable tests: fix spurious failure in 'primary-prefix-valid-couples.test' docs: deprecate JAVA primary docs: clearer distinction between `.java' with javac and with gcj java: complain if java_JAVA is used but $(javadir) is undefined
Diffstat (limited to 'aclocal.in')
-rw-r--r--aclocal.in21
1 files changed, 19 insertions, 2 deletions
diff --git a/aclocal.in b/aclocal.in
index bc0804a78..93ed5eb71 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -57,8 +57,9 @@ $perl_threads = 0;
# third-party macros.
# @user_includes can be augmented with -I.
# @automake_includes can be reset with the `--automake-acdir' option.
-# @system_includes can be augmented with the `dirlist' file, and reset
-# with the `--system-acdir' option.
+# @system_includes can be augmented with the `dirlist' file or the
+# ACLOCAL_PATH environment variable, and reset with the `--system-acdir'
+# option.
my @user_includes = ();
my @automake_includes = ("@datadir@/aclocal-$APIVERSION");
my @system_includes = ('@datadir@/aclocal');
@@ -1045,10 +1046,26 @@ sub parse_arguments ()
}
}
+# Add any directory listed in the `ACLOCAL_PATH' environment variable
+# to the list of system include directories.
+sub parse_ACLOCAL_PATH ()
+{
+ return if not defined $ENV{"ACLOCAL_PATH"};
+ # Directories in ACLOCAL_PATH should take precedence over system
+ # directories, so we use unshift. However, directories that
+ # come first in ACLOCAL_PATH take precedence over directories
+ # coming later, which is why the result of split is reversed.
+ foreach my $dir (reverse split /:/, $ENV{"ACLOCAL_PATH"})
+ {
+ unshift (@system_includes, $dir) if $dir ne '' && -d $dir;
+ }
+}
+
################################################################
parse_WARNINGS; # Parse the WARNINGS environment variable.
parse_arguments;
+parse_ACLOCAL_PATH;
$configure_ac = require_configure_ac;
# We may have to rerun aclocal if some file have been installed, but