cvs server: Diffing . Index: ChangeLog =================================================================== RCS file: /cvsroot/autoconf/autoconf/ChangeLog,v retrieving revision 1.1954 diff -u -r1.1954 ChangeLog --- ChangeLog 9 Jul 2002 17:01:38 -0000 1.1954 +++ ChangeLog 17 Jul 2002 01:18:13 -0000 @@ -1,3 +1,20 @@ +2002-07-14 Mark D. Roth + + * configure.ac: Add --enable-site-macro-dir option. + * bin/Makefile.am: Expand @address@hidden + * bin/autom4te.in: Add --prepend-include, --include-envvar, and + --site-macro-subdir options. + * bin/autoconf.in: Add --prepend-include option. + * bin/autoheader.in: Add --prepend-include option. + * bin/autoreconf.in: Add --prepend-include option. + * bin/autoscan.in: Add --prepend-include option. + * bin/autoupdate.in: Add --prepend-include option. + * doc/autoconf.texi: Document use of $AC_MACRO_PATH and site + macro directory, remove note that include path directories are + used in reverse order, and document --prepend-include option. + * lib/autom4te.in: Use --prepend-include instead of --include. + * tests/wrapsh.in: Use --prepend-include instead of --include. + 2002-07-09 Akim Demaille * doc/autoconf.texi: Properly set the ``header'' part. Index: configure.ac =================================================================== RCS file: /cvsroot/autoconf/autoconf/configure.ac,v retrieving revision 1.38 diff -u -r1.38 configure.ac --- configure.ac 22 Apr 2002 14:33:05 -0000 1.38 +++ configure.ac 17 Jul 2002 01:18:16 -0000 @@ -31,6 +31,13 @@ AM_INIT_AUTOMAKE +AC_ARG_ENABLE([site-macro-dir], + AC_HELP_STRING([--enable-site-macro-dir=DIR], + [use site macro directory DIR @<:@DATADIR/autoconf/site_macros@:>@]), + , + [enable_site_macro_dir='${datadir}/autoconf/site_macros']) +AC_SUBST([SITE_MACRO_DIR], "${enable_site_macro_dir}") + # Initialize the test suite and build position independent wrappers. AC_CONFIG_TESTDIR([tests]) AC_CONFIG_FILES([tests/Makefile tests/atlocal]) cvs server: Diffing bin Index: bin/Makefile.am =================================================================== RCS file: /cvsroot/autoconf/autoconf/bin/Makefile.am,v retrieving revision 1.5 diff -u -r1.5 Makefile.am --- bin/Makefile.am 10 Apr 2002 15:58:19 -0000 1.5 +++ bin/Makefile.am 17 Jul 2002 01:18:16 -0000 @@ -45,7 +45,8 @@ -e 's,@M4\@,$(M4),g' \ -e 's,@AWK\@,$(AWK),g' \ -e 's,@VERSION\@,$(VERSION),g' \ - -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' + -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \ + -e 's,@SITE_MACRO_DIR\@,$(SITE_MACRO_DIR),g' # autoconf is written in M4sh. AUTOM4SH = $(top_builddir)/tests/autom4te --language M4sh Index: bin/autoconf.in =================================================================== RCS file: /cvsroot/autoconf/autoconf/bin/autoconf.in,v retrieving revision 1.147 diff -u -r1.147 autoconf.in --- bin/autoconf.in 22 Apr 2002 09:13:43 -0000 1.147 +++ bin/autoconf.in 17 Jul 2002 01:18:16 -0000 @@ -107,7 +107,8 @@ -V, --version print version number, then exit -v, --verbose verbosely report processing -d, --debug don't remove temporary files - -I, --include=DIR look for input files in DIR (cumulative) + -B, --prepend-include=DIR prepend directory DIR to search path + -I, --include=DIR append directory DIR to search path -f, --force consider all files obsolete -o, --output=FILE save output in FILE (stdout is the default) -W, --warnings=CATEGORY report the warnings falling in CATEGORY [syntax] @@ -195,11 +196,13 @@ --debug | -d | \ --force | -f | \ --include=* | -I?* | \ + --prepend-include=* | -B?* | \ --warnings=* | -W?* ) AUTOM4TE="$AUTOM4TE $1"; shift ;; # Options with separated arg passed as is to autom4te. --include | -I | \ + --prepend-include | -B | \ --warnings | -W ) test $# = 1 && eval "$exit_missing_arg" AUTOM4TE="$AUTOM4TE $option $2" Index: bin/autoheader.in =================================================================== RCS file: /cvsroot/autoconf/autoconf/bin/autoheader.in,v retrieving revision 1.119 diff -u -r1.119 autoheader.in --- bin/autoheader.in 2 Jul 2002 20:31:22 -0000 1.119 +++ bin/autoheader.in 17 Jul 2002 01:18:16 -0000 @@ -44,6 +44,7 @@ my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@'; local $config_h; my $config_h_in; +my @prepend_include; my @include; my @warning; @@ -72,7 +73,8 @@ \`error\' warnings are error Library directories: - -I, --include=DIR look for files in DIR (cumulative) + -B, --prepend-include=DIR prepend directory DIR to search path + -I, --include=DIR append directory DIR to search path Report bugs to . END @@ -103,6 +105,7 @@ my $srcdir; getopt ('I|include|A|autoconf-dir|m|macrodir|l|localdir=s' => address@hidden, + 'B|prepend-include=s' => address@hidden, 'W|warning=s' => address@hidden); if (! @ARGV) @@ -123,9 +126,12 @@ parse_args; # Preach. -my $config_h_top = find_file ("config.h.top?", @include); -my $config_h_bot = find_file ("config.h.bot?", @include); -my $acconfig_h = find_file ("acconfig.h?", @include); +my $config_h_top = find_file ("config.h.top?", + reverse(@prepend_include), @include); +my $config_h_bot = find_file ("config.h.bot?", + reverse(@prepend_include), @include); +my $acconfig_h = find_file ("acconfig.h?", + reverse(@prepend_include), @include); if ($config_h_top || $config_h_bot || $acconfig_h) { my $msg = << "END"; @@ -150,6 +156,7 @@ # Set up autoconf. my $autoconf = "$autom4te --language=autoconf "; $autoconf .= join (' ', map { "--include=$_" } @include); +$autoconf .= join (' ', map { "--prepend-include=$_" } @prepend_include); $autoconf .= ' --debug' if $debug; $autoconf .= ' --force' if $force; $autoconf .= ' --verbose' if $verbose; Index: bin/autom4te.in =================================================================== RCS file: /cvsroot/autoconf/autoconf/bin/autom4te.in,v retrieving revision 1.65 diff -u -r1.65 autom4te.in --- bin/autom4te.in 2 Jul 2002 20:31:22 -0000 1.65 +++ bin/autom4te.in 17 Jul 2002 01:18:16 -0000 @@ -389,7 +389,8 @@ The environment variable \`WARNINGS\' is honored. Library directories: - -I, --include=DIR look for FILES in DIR (cumulative) + -B, --prepend-include=DIR prepend directory DIR to search path + -I, --include=DIR append directory DIR to search path Tracing: -t, --trace=MACRO report the MACRO invocations @@ -484,6 +485,9 @@ # Process the arguments for real this time. my @trace; + my @prepend_include; + my $include_envvar; + my @site_macro_subdirs; getopt ( # Operation modes: @@ -493,7 +497,10 @@ "M|melt" => \$melt, # Library directories: + "B|prepend-include=s" => address@hidden, "I|include=s" => address@hidden, + "include-envvar=s" => \$include_envvar, + "site-macro-subdir=s" => address@hidden, # Tracing: # Using a hash for traces is seducing. Unfortunately, upon `-t FOO', @@ -521,11 +528,19 @@ $melt = 1 if $freeze; + # Add directories from the appropriate env var to the include path. + @include = (@include, split(/:/, $ENV{$include_envvar})) + if defined($include_envvar) && exists($ENV{$include_envvar}); + + # Also add the site macro directory, if applicable. + map { @include = (@include, "@SITE_MACRO_DIR@/$_"); } @site_macro_subdirs + if ('@SITE_MACRO_DIR@' ne 'no') && @site_macro_subdirs; + # Normalize the includes: the first occurrence is enough, several is # a pain since it introduces a useless difference in the path which # invalidates the cache. And strip `.' which is implicit and always # first. - @include = grep { !/^\.$/ } uniq (@include); + @include = grep { !/^\.$/ } uniq (reverse(@prepend_include), @include); # Convert @trace to %trace, and work around the M4 builtins tracing # problem. @@ -599,13 +614,10 @@ # # Neutralize its stdin, so that GNU M4 1.5 doesn't neutralize SIGINT. # - # Be extremely cautious to reverse the includes when talking to M4: - # it doesn't speak the same --include as we do. - # # We don't output directly to the cache files, to avoid problems # when we are interrupted (that leaves corrupted files). my $command = ("$m4" - . join (' --include=', '', reverse @include) + . join (' --include=', '', @include) . " --define=m4_warnings=$m4_warnings" . ' --debug=aflq' . " --error-output=$tcache" . $req->id . "t" @@ -1056,7 +1068,7 @@ # output but comments and empty lines. my $command = ("$m4" . ' --fatal-warning' - . join (' --include=', '', reverse @include) + . join (' --include=', '', @include) . ' --define=divert' . " @ARGV" . ' address@hidden, + 'B|prepend-include=s' => address@hidden, 'i|install' => \$install, 's|symlink' => \$symlink); @@ -145,7 +148,9 @@ # Dispatch autoreconf's option to the tools. # --include; $autoconf .= join (' --include=', '', @include); + $autoconf .= join (' --prepend-include=', '', @prepend_include); $autoheader .= join (' --include=', '', @include); + $autoheader .= join (' --prepend-include=', '', @prepend_include); # --install and --symlink; if ($install) Index: bin/autoscan.in =================================================================== RCS file: /cvsroot/autoconf/autoconf/bin/autoscan.in,v retrieving revision 1.78 diff -u -r1.78 autoscan.in --- bin/autoscan.in 12 Jun 2002 17:26:19 -0000 1.78 +++ bin/autoscan.in 17 Jul 2002 01:18:17 -0000 @@ -80,6 +80,7 @@ # Autoconf and lib files. my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@'; my $autoconf = "$autom4te --language=autoconf"; +my @prepend_include; my @include = ('@datadir@'); # $help @@ -96,7 +97,8 @@ -V, --version print version number, then exit -v, --verbose verbosely report processing -d, --debug don't remove temporary files - -I, --include=DIR look for input files in DIR (cumulative) + -B, --prepend-include=DIR prepend directory DIR to search path + -I, --include=DIR append directory DIR to search path Report bugs to .\n"; @@ -121,7 +123,8 @@ # Process any command line arguments. sub parse_args () { - getopt ("I|include|A|autoconf-dir|m|macrodir=s" => address@hidden); + getopt ('I|include|A|autoconf-dir|m|macrodir=s' => address@hidden, + 'B|prepend-include=s' => @prepend_include); die "$me: too many arguments Try `$me --help' for more information.\n" @@ -151,7 +154,8 @@ my $tables_are_consistent = 1; foreach my $kind (@kinds) { - my $file = find_file ("autoscan/$kind", @include); + my $file = find_file ("autoscan/$kind", + reverse(@prepend_include), @include); my $table = new Autom4te::XFile $file; while ($_ = $table->getline) { @@ -586,6 +590,7 @@ $autoconf .= " --debug" if $debug; $autoconf .= " --verbose" if $verbose; $autoconf .= join (' --include=', '', @include); +$autoconf .= join (' --prepend-include=', '', @prepend_include); my $configure_ac = find_configure_ac; init_tables; Index: bin/autoupdate.in =================================================================== RCS file: /cvsroot/autoconf/autoconf/bin/autoupdate.in,v retrieving revision 1.37 diff -u -r1.37 autoupdate.in --- bin/autoupdate.in 2 Jul 2002 20:31:22 -0000 1.37 +++ bin/autoupdate.in 17 Jul 2002 01:18:17 -0000 @@ -39,6 +39,7 @@ my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@'; my $autoconf = "$autom4te --language=autoconf"; # We need to find m4sugar. +my @prepend_include; my @include = ('@datadir@'); my $force = 0; # m4. @@ -58,7 +59,8 @@ -V, --version print version number, then exit -v, --verbose verbosely report processing -d, --debug don't remove temporary files - -I, --include=DIR look for input files in DIR (cumulative) + -B, --prepend-include=DIR prepend directory DIR to search path + -I, --include=DIR append directory DIR to search path -f, --force consider all files obsolete Report bugs to . @@ -87,6 +89,7 @@ my $srcdir; getopt ('I|include|A|autoconf-dir|m|macrodir|l|localdir=s' => address@hidden, + 'B|prepend-include=s' => address@hidden, 'f|force' => \$force); if (! @ARGV) @@ -226,6 +229,7 @@ $autoconf .= " --force" if $force; $autoconf .= " --verbose" if $verbose; $autoconf .= join (' --include=', '', @include); +$autoconf .= join (' --prepend-include=', '', @prepend_include); mktmpdir ('au'); handle_m4_macros; @@ -382,9 +386,9 @@ or die "$me: cannot close $tmp/input.m4: $!\n"; # Now ask m4 to perform the update. - # M4 and I don't agree on the associativity of `--include': reverse! - xsystem ("$m4" - . join (' --include=', '', reverse (@include, $tmp)) + xsystem ("$m4 --include=$tmp" + . join (' --include=', '', reverse (@prepend_include)) + . join (' --include=', '', @include) . " $tmp/input.m4 >$tmp/updated"); update_file ("$tmp/updated", "$file" eq "$tmp/stdin" ? '-' : "$file"); cvs server: Diffing config cvs server: Diffing doc Index: doc/autoconf.texi =================================================================== RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v retrieving revision 1.637 diff -u -r1.637 autoconf.texi --- doc/autoconf.texi 9 Jul 2002 17:01:38 -0000 1.637 +++ doc/autoconf.texi 17 Jul 2002 01:18:21 -0000 @@ -1089,8 +1089,11 @@ @item address@hidden @itemx -I @var{dir} -Also look for input files in @var{dir}. Multiple invocations -accumulate. Directories are browsed from last to first. +Append @var{dir} to the include path. Multiple invocations accumulate. + address@hidden address@hidden address@hidden -B @var{dir} +Prepend @var{dir} to the include path. Multiple invocations accumulate. @end table @node ifnames Invocation @@ -1174,8 +1177,18 @@ @item address@hidden @itemx -I @var{dir} -Also look for input files in @var{dir}. Multiple invocations -accumulate. Directories are browsed from last to first. +Append @var{dir} to the include path. Multiple invocations accumulate. + address@hidden address@hidden address@hidden -B @var{dir} +Prepend @var{dir} to the include path. Multiple invocations accumulate. + +After searching any directories specified using @option{--prepend-include} +or @option{--include}, @command{autoconf} will also search the directories +specified in the @code{AC_MACRO_PATH} environment variable, if set. +And finally, @command{autoconf} will also search the system-wide site +macro directory, which is set to address@hidden@address@hidden/autoconf/site_macros/autoconf} by default. @item address@hidden @itemx -o @var{file} @@ -1447,8 +1460,11 @@ @item address@hidden @itemx -I @var{dir} -Also look for input files in @var{dir}. Multiple invocations -accumulate. Directories are browsed from last to first. +Append @var{dir} to the include path. Multiple invocations accumulate. + address@hidden address@hidden address@hidden -B @var{dir} +Prepend @var{dir} to the include path. Multiple invocations accumulate. @end table @@ -2533,8 +2549,11 @@ @item address@hidden @itemx -I @var{dir} -Also look for input files in @var{dir}. Multiple invocations accumulate. -Directories are browsed from last to first. +Append @var{dir} to include path. Multiple invocations accumulate. + address@hidden address@hidden address@hidden -B @var{dir} +Prepend @var{dir} to include path. Multiple invocations accumulate. @item address@hidden @itemx -W @var{category} @@ -7064,8 +7083,7 @@ @item address@hidden @itemx -I @var{dir} Also look for input files in @var{dir}. Multiple invocations -accumulate. Contrary to M4 but in agreement with common sense, -directories are browsed from last to first. +accumulate. @item address@hidden @itemx -o @var{file} @@ -7325,18 +7343,31 @@ @item Autoconf create Autoconf executable configure scripts. @end table + address@hidden address@hidden address@hidden -B @var{dir} +Prepend directory @var{dir} to the search path. This is used to include +the language-specific files before any third-party macros. + address@hidden address@hidden +Add directories specified in the environment variable @var{envvar} to +the search path. + address@hidden address@hidden +If the site macro directory is set, add the subdirectory @var{subdir} +of the site macro directory to the search path. @end table @cindex @file{autom4te.cfg} As an example, if Autoconf is installed in its default location, address@hidden/usr/local}, running @samp{autom4te -l m4sugar foo.m4} is strictly -equivalent to running @samp{autom4te --include /usr/local/share/autoconf -m4sugar/m4sugar.m4f --warning syntax foo.m4}. Recursive expansion -applies: running @samp{autom4te -l m4sh foo.m4}, is the same as address@hidden --language M4sugar m4sugar/m4sh.m4f foo.m4}, i.e., address@hidden --include /usr/local/share/autoconf m4sugar/m4sugar.m4f -m4sugar/m4sh.m4f --mode 777 foo.m4}. The definition of the languages is -stored in @file{autom4te.cfg}. address@hidden/usr/local}, running @samp{autom4te -l m4sugar foo.m4} is +strictly equivalent to running @samp{autom4te --prepend-include +/usr/local/share/autoconf m4sugar/m4sugar.m4f --warning syntax foo.m4}. +Recursive expansion applies: running @samp{autom4te -l m4sh foo.m4}, +is the same as @samp{autom4te --language M4sugar m4sugar/m4sh.m4f +foo.m4}, i.e., @samp{autom4te --prepend-include /usr/local/share/autoconf +m4sugar/m4sugar.m4f m4sugar/m4sh.m4f --mode 777 foo.m4}. The definition +of the languages is stored in @file{autom4te.cfg}. @node Programming in M4sugar cvs server: Diffing lib Index: lib/autom4te.in =================================================================== RCS file: /cvsroot/autoconf/autoconf/lib/autom4te.in,v retrieving revision 1.11 diff -u -r1.11 autom4te.in --- lib/autom4te.in 3 Apr 2002 13:35:59 -0000 1.11 +++ lib/autom4te.in 17 Jul 2002 01:18:21 -0000 @@ -126,7 +126,9 @@ ## ---------- ## begin-language: "Autoconf" -args: --include @datadir@ +args: --prepend-include @datadir@ +args: --site-macro-subdir autoconf +args: --include-envvar AC_MACRO_PATH args: autoconf/autoconf.m4f args: acsite.m4? args: aclocal.m4? @@ -144,7 +146,9 @@ ## -------- ## begin-language: "Autotest" -args: --include @datadir@ +args: --prepend-include @datadir@ +args: --site-macro-subdir autotest +args: --include-envvar AT_MACRO_PATH args: autotest/autotest.m4f args: package.m4? args: --mode 777 @@ -157,7 +161,9 @@ ## ---- ## begin-language: "M4sh" -args: --include @datadir@ +args: --prepend-include @datadir@ +args: --site-macro-subdir m4sh +args: --include-envvar M4SH_MACRO_PATH args: m4sugar/m4sh.m4f args: --mode 777 args: --language M4sugar @@ -169,7 +175,9 @@ ## ------- ## begin-language: "M4sugar" -args: --include @datadir@ +args: --prepend-include @datadir@ +args: --site-macro-subdir m4sugar +args: --include-envvar M4SUGAR_MACRO_PATH args: m4sugar/m4sugar.m4f args: --warning syntax end-language: "M4sugar" cvs server: Diffing lib/Autom4te cvs server: Diffing lib/autoconf cvs server: Diffing lib/autoscan cvs server: Diffing lib/autotest cvs server: Diffing lib/emacs cvs server: Diffing lib/m4sugar cvs server: Diffing man cvs server: Diffing tests Index: tests/wrapsh.in =================================================================== RCS file: /cvsroot/autoconf/autoconf/tests/wrapsh.in,v retrieving revision 1.4 diff -u -r1.4 wrapsh.in --- tests/wrapsh.in 12 Apr 2002 09:56:11 -0000 1.4 +++ tests/wrapsh.in 17 Jul 2002 01:18:22 -0000 @@ -77,4 +77,4 @@ # @configure_input@ # Running `$0' as if it were installed. -exec @abs_top_builddir@/bin/$as_me --include @abs_top_builddir@/lib ${1+"$@"} +exec @abs_top_builddir@/bin/$as_me --prepend-include @abs_top_builddir@/lib ${1+"$@"}