# 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');
foreach my $key (keys %map)
{
# FIXME: should print line number of acinclude.m4.
- msg ('syntax', "warning: macro `$key' defined in "
- . "acinclude.m4 but never used")
+ msg ('syntax', "macro `$key' defined in acinclude.m4 but never used")
if $map{$key} eq 'acinclude.m4' && ! exists $macro_seen{$key};
}
}
# Make this just a warning, because we do not know whether
# the macro is actually used (it could be called conditionally).
msg ('unsupported', "$file:$line",
- "warning: macro `$2' not found in library");
+ "macro `$2' not found in library");
}
}
if ($number !~ /$serial_number_rx/go)
{
msg ('syntax', "$file:$.",
- "warning: ill-formed serial number `$number', "
+ "ill-formed serial number `$number', "
. "expecting a version string with only digits and dots");
}
elsif ($defun_seen)
$defun_seen = 1;
if (! defined $1)
{
- msg ('syntax', "$file:$.", "warning: underquoted definition of $2"
- . "\n run info '(automake)Extending aclocal'\n"
+ msg ('syntax', "$file:$.", "underquoted definition of $2"
+ . "\n run info Automake 'Extending aclocal'\n"
. " or see http://www.gnu.org/software/automake/manual/"
. "automake.html#Extending-aclocal")
unless $underquoted_manual_once;
{
my ($status) = @_;
- print "Usage: aclocal [OPTIONS] ...
+ print "Usage: aclocal [OPTION]...
Generate `aclocal.m4' by scanning `configure.ac' or `configure.in'
--automake-acdir=DIR directory holding automake-provided m4 files
--system-acdir=DIR directory holding third-party system-wide files
--diff[=COMMAND] run COMMAND [diff -u] on M4 files that would be
- changed (implies --install and --dry-run)
+ changed (implies --install and --dry-run)
--dry-run pretend to, but do not actually update any file
--force always update output file
--help print this help, then exit
}
if (exists $argopts{$ARGV[0]})
{
- fatal ("option `$ARGV[0]' requires an argument\n"
- . "Try `$0 --help' for more information.");
+ fatal ("option `$ARGV[0]' requires an argument.\n"
+ . "Try `$0 --help' for more information");
}
else
{
fatal ("unrecognized option `$ARGV[0]'\n"
- . "Try `$0 --help' for more information.");
+ . "Try `$0 --help' for more information");
}
}
if ($install && !@user_includes)
{
fatal ("--install should copy macros in the directory indicated by the"
- . "\nfirst -I option, but no -I was supplied.");
+ . "\nfirst -I option, but no -I was supplied");
}
# Finally, adds any directory listed in the `dirlist' file.
}
}
+# 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
while (1)
{
++$loop;
- prog_error "Too many loops." if $loop > 2;
+ prog_error "too many loops" if $loop > 2;
reset_maps;
scan_m4_files;