summaryrefslogtreecommitdiff
path: root/aclocal.in
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2011-09-05 17:37:44 +0200
committerStefano Lattarini <stefano.lattarini@gmail.com>2011-09-08 17:05:49 +0200
commit30f99cbd07736c96603d15346fc8ad9097a0dddd (patch)
treea56240054e1bec55d8f240059bfe836adeca4fd0 /aclocal.in
parent3c99e9dca034ba5cbe3848af024aea5b4fc19b6c (diff)
downloadautomake-30f99cbd07736c96603d15346fc8ad9097a0dddd.tar.gz
aclocal: more granularity in acdir overriding
Before this change, using the `--acdir' option caused aclocal to redefine both the directory of automake-provided m4 macros and the directory of third-party system-wide m4 macros. With this change, we deprecate the `--acdir' aclocal option, and introduce two new options `--automake-acdir' and `--system-acdir', to allow for more granularity. * aclocal.in (@automake_includes, @system_includes, @user_includes): Fix and extend comments. (usage): Update. (handle_acdir_option): New function. (parse_arguments): Recognize new options `--system-acdir' and `automake-acdir', and handle `--acdir' using the new function above. Simplify logic by assuming that the directory of third-party system-wide m4 files always exists. * tests/aclocal.in: Update to use the new options, instead of the deprecated. `--acdir'. * m4/dirlist: Move ... * m4/acdir/dirlist: ... here. * m4/Makefile.am (EXTRA_DIST): Update. (m4datadir): Rename ... (automake_acdir): ... to this. Accordingly, ... (dist_m4data_DATA): ... rename this ... (dist_automake_ac_DATA): ... to this. (system_acdir): New, directory. (dist_system_ac_DATA): New, defined to an empty value; this will ensure that the $(system_acdir) directory will be created by "make install". * tests/aclocal.test: Remove check about the `--print-ac-dir' option of aclocal, it has been moved into ... * tests/aclocal-print-acdir.test: ... this new test, and quite extended. * tests/aclocal-acdir.test: New test. * tests/Makefile.am (TESTS): Add the new tests. * NEWS, bootstrap: Update. * doc/automake.texi (aclocal Options, Macro Search Path): Update.
Diffstat (limited to 'aclocal.in')
-rw-r--r--aclocal.in74
1 files changed, 36 insertions, 38 deletions
diff --git a/aclocal.in b/aclocal.in
index 4b63c1afa..8b31bdca4 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -54,9 +54,11 @@ $perl_threads = 0;
# 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 macro. @user_includes can be augmented with -I.
-# @system_includes can be augmented with the `dirlist' file. Also
-# --acdir will reset both @automake_includes and @system_includes.
+# 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.
my @user_includes = ();
my @automake_includes = ("@datadir@/aclocal-$APIVERSION");
my @system_includes = ('@datadir@/aclocal');
@@ -877,7 +879,8 @@ sub usage ($)
Generate `aclocal.m4' by scanning `configure.ac' or `configure.in'
Options:
- --acdir=DIR directory holding config files (for debugging)
+ --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)
--dry-run pretend to, but do not actually update any file
@@ -886,7 +889,8 @@ Options:
-I DIR add directory to search list for .m4 files
--install copy third-party files to the first -I directory
--output=FILE put output in FILE (default aclocal.m4)
- --print-ac-dir print name of directory holding m4 files, then exit
+ --print-ac-dir print name of directory holding system-wide
+ third-party m4 files, then exit
--verbose don't be silent
--version print version number, then exit
-W, --warnings=CATEGORY report the warnings falling in CATEGORY
@@ -923,6 +927,15 @@ EOF
exit 0;
}
+# Using --acdir overrides both the automake (versioned) directory and
+# the public (unversioned) system directory. This usage is obsolete.
+sub handle_acdir_option ($$)
+{
+ msg 'obsolete', '', "`--acdir' is deprecated\n";
+ @system_includes = ($_[1]);
+ @automake_includes = ();
+}
+
# Parse command line.
sub parse_arguments ()
{
@@ -931,12 +944,9 @@ sub parse_arguments ()
my %cli_options =
(
- 'acdir=s' => sub # Setting --acdir overrides both the
- { # automake (versioned) directory and the
- # public (unversioned) system directory.
- @automake_includes = ();
- @system_includes = ($_[1])
- },
+ 'acdir=s' => \&handle_acdir_option,
+ 'system-acdir=s' => sub { shift; @system_includes = @_; },
+ 'automake-acdir=s' => sub { shift; @automake_includes = @_; },
'diff:s' => \$diff_command,
'dry-run' => \$dry_run,
'force' => \$force_output,
@@ -1017,34 +1027,22 @@ sub parse_arguments ()
. "\nfirst -I option, but no -I was supplied.");
}
- if (! -d $system_includes[0])
+ # Finally, adds any directory listed in the `dirlist' file.
+ if (open (DIRLIST, "$system_includes[0]/dirlist"))
{
- # By default $(datadir)/aclocal doesn't exist. We don't want to
- # get an error in the case where we are searching the default
- # directory and it hasn't been created. (We know
- # @system_includes has its default value if @automake_includes
- # is not empty, because --acdir is the only way to change this.)
- @system_includes = () if @automake_includes;
- }
- else
- {
- # Finally, adds any directory listed in the `dirlist' file.
- if (open (DIRLIST, "$system_includes[0]/dirlist"))
- {
- while (<DIRLIST>)
- {
- # Ignore '#' lines.
- next if /^#/;
- # strip off newlines and end-of-line comments
- s/\s*\#.*$//;
- chomp;
- foreach my $dir (glob)
- {
- push (@system_includes, $dir) if -d $dir;
- }
- }
- close (DIRLIST);
- }
+ while (<DIRLIST>)
+ {
+ # Ignore '#' lines.
+ next if /^#/;
+ # strip off newlines and end-of-line comments
+ s/\s*\#.*$//;
+ chomp;
+ foreach my $dir (glob)
+ {
+ push (@system_includes, $dir) if -d $dir;
+ }
+ }
+ close (DIRLIST);
}
}