]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* bin/autoconf.in (--include, -I): New option.
authorAkim Demaille <akim@epita.fr>
Fri, 31 Aug 2001 13:31:54 +0000 (13:31 +0000)
committerAkim Demaille <akim@epita.fr>
Fri, 31 Aug 2001 13:31:54 +0000 (13:31 +0000)
Map --localdir, --autoconf-dir onto it.
Forward autom4te's options instead of interpreting them.
* bin/autoconf.in, bin/autoheader.in (AC_MACRODIR, autoconf_dir):
There is no such envvar since the inception of autom4te.cfg.
* bin/autom4te.in (&parse_args): Uniquify `@include'.
* bin/autoupdate.in: Adjust, and perform more control.
* tests/atspecific.m4 (AT_CHECK_AUTOCONF): Adjust.
* tests/autoconf: Dittowise.

ChangeLog
bin/autoconf.in
bin/autoheader.in
bin/autom4te.in
bin/autoupdate.in
man/autoconf.1
tests/atspecific.m4
tests/autoconf
tests/autoheader
tests/autoreconf

index 3844527b000732269a7db46379c6fe081567fbb7..6638235b763dc022c8c6a9c99a5c7a8f06a7f4c5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2001-08-31  Akim Demaille  <akim@epita.fr>
+
+       * bin/autoconf.in (--include, -I): New option.
+       Map --localdir, --autoconf-dir onto it.
+       Forward autom4te's options instead of interpreting them.
+       * bin/autoconf.in, bin/autoheader.in (AC_MACRODIR, autoconf_dir):
+       There is no such envvar since the inception of autom4te.cfg.
+       * bin/autom4te.in (&parse_args): Uniquify `@include'.
+       * bin/autoupdate.in: Adjust, and perform more control.
+       * tests/atspecific.m4 (AT_CHECK_AUTOCONF): Adjust.
+       * tests/autoconf: Dittowise.
+
+       
 2001-08-31  Akim Demaille  <akim@epita.fr>
 
        * bin/autoconf.in: Don't bother with `acsite.m4' and `aclocal.m4'.
index 7c86a17597dc7d2d6a53f798dbb0b3a4d8920c7d..ca6bea6b2313834a11ec89be0a7e9cd7cd8fd283 100644 (file)
@@ -34,6 +34,7 @@ Operation modes:
   -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.  Accumulates
   -f, --force              consider all the files are obsolete
   -o, --output=FILE        save output in FILE (stdout is the default)
   -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [syntax]
@@ -49,10 +50,6 @@ Warning categories include:
 
 The environment variable \`WARNINGS' is honored.
 
-Library directories:
-  -A, --autoconf-dir=ACDIR  Autoconf's macro files location (rarely needed)
-  -l, --localdir=DIR        location of the \`aclocal.m4' file
-
 Tracing:
   -t, --trace=MACRO     report the list of calls to MACRO
   -i, --initialization  also trace Autoconf's initialization process
@@ -85,21 +82,15 @@ if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
 
 # Variables.
-: ${autoconf_dir=${AC_MACRODIR=@datadir@}}
 : ${AUTOM4TE=@autom4te-name@}
-debug=false
-force=false
 dir=`echo "$0" | sed -e 's,[^\\/]*$,,'`
-# Trace Autoconf's initialization?
-initialization=false
-localdir=.
 outfile=
-# Exit status.
-status=0
 verbose=:
 
 # Parse command line.
 while test $# -gt 0 ; do
+  option=`expr "x$1" : 'x\(--[^=]*\)' \| \
+               "x$1" : 'x\(-.\)'`
   optarg=`expr "x$1" : 'x--[^=]*=\(.*\)' \| \
                "x$1" : 'x-.\(.*\)'`
   case $1 in
@@ -108,40 +99,34 @@ while test $# -gt 0 ; do
     --help | -h )
        echo "$usage"; exit 0 ;;
 
-    --debug | -d )
-       debug=:; shift ;;
-    --force | -f )
-       force=:; shift ;;
     --verbose | -v )
        verbose=echo
-       shift;;
+       AUTOM4TE="$AUTOM4TE $1"; shift ;;
 
-    --localdir=* | -l?* )
-       localdir=$optarg
-       shift ;;
-    --localdir | -l )
-       test $# = 1 && eval "$exit_missing_arg"
-       shift
-       localdir=$1
-       shift ;;
+    # Arguments passed as is to autom4te.
+    --debug      | -d   | \
+    --force      | -f   | \
+    --include=*  | -I?* | \
+    --warnings=* | -W?* )
+       AUTOM4TE="$AUTOM4TE $1"; shift ;;
 
-    --autoconf-dir=* | -A?* )
-      autoconf_dir=$optarg
-       shift ;;
-    --autoconf-dir | -A )
+    # Options with separated arg passed as is to autom4te.
+    --include | -I | \
+    --warnings | -W )
        test $# = 1 && eval "$exit_missing_arg"
-       shift
-       autoconf_dir=$1
-       shift ;;
-    --macrodir=* | -m?* )
-       echo "$me: warning: --macrodir is obsolete, use --autoconf-dir" >&2
-       autoconf_dir=$optarg
+       AUTOM4TE="$AUTOM4TE $option $2"
+       shift 2 ;;
+
+    # Obsolete options.
+    --localdir=* | -l?* | --autoconf-dir=* | -A?* | --macrodir=* | -m?* )
+       echo "$me: warning: $option is obsolete, use --include" >&2
+       AUTOM4TE="$AUTOM4TE --include=$optarg"
        shift ;;
-    --macrodir | -m )
-       echo "$me: warning: --macrodir is obsolete, use --autoconf-dir" >&2
+    --localdir | -l | --autoconf-dir | -A | --macrodir | -m )
+       echo "$me: warning: $option is obsolete, use --include" >&2
        test $# = 1 && eval "$exit_missing_arg"
        shift
-       autoconf_dir=$1
+       AUTOM4TE="$AUTOM4TE --include=$1"
        shift ;;
 
     --trace=* | -t?* )
@@ -153,7 +138,7 @@ while test $# -gt 0 ; do
        traces="$traces --trace='"`echo "$1" | sed "s/'/'\\\\\\\\''/g"`"'"
        shift ;;
     --initialization | -i )
-       initialization=:
+       AUTOM4TE="$AUTOM4TE --melt"
        shift;;
 
     --output=* | -o?* )
@@ -165,15 +150,6 @@ while test $# -gt 0 ; do
        outfile=$1
        shift ;;
 
-    --warnings=* | -W?* )
-       warnings=$warnings,$optarg
-       shift ;;
-    --warnings | -W )
-       test $# = 1 && eval "$exit_missing_arg"
-       shift
-       warnings=$warnings,$1
-       shift ;;
-
     -- )     # Stop option processing
        shift; break ;;
     - )        # Use stdin as input.
@@ -215,22 +191,9 @@ esac
 test -z "$outfile" && outfile=-
 
 # Running autom4te.
-run_autom4te="$AUTOM4TE "\
-`$verbose "--verbose "`\
-`$debug && echo "--debug "`\
-`$force && echo "--force "`\
-"--language=autoconf "\
-"--include=$autoconf_dir "\
-"--include=$localdir "\
-`test -n "$warnings" && echo "--warning=$warnings "`\
-"--output=$outfile "\
-`$initialization && echo "--melt "`
-
+run_autom4te="$AUTOM4TE --language=autoconf --output=$outfile"
 # Autom4te expansion.
 eval set dummy "$traces"
 shift
 $verbose "$me: running $run_autom4te "${1+"$@"}" $infile" >&2
-$run_autom4te ${1+"$@"} $infile ||
-  { (exit 1); exit 1; }
-
-(exit $status); exit $status
+exec $run_autom4te ${1+"$@"} $infile
index 6b3c2c18782aae13b14d5f7e45783105bdd89a83..da998f3c99900703441d0bf03b2efe3d603ffb58 100644 (file)
@@ -78,7 +78,6 @@ if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
 
 # Variables.
-: ${autoconf_dir=${AC_MACRODIR=@datadir@}}
 : ${AUTOCONF=@autoconf-name@}
 dir=`echo "$0" | sed -e 's,[^/]*$,,'`
 debug=false
@@ -253,7 +252,7 @@ case $# in
 esac
 
 # Set up autoconf.
-autoconf="$AUTOCONF -A $autoconf_dir -l $localdir "\
+autoconf="$AUTOCONF --include=$autoconf_dir --include=$localdir "\
 `$verbose "--verbose "`\
 `$debug && echo "--debug "`
 
index a4dc44497bf347da92f39612e341ae18f228c164..f004ddc636f80ecb2116d19b064229c03cee33b7 100644 (file)
@@ -573,6 +573,11 @@ sub parse_args ()
 Try `$me --help' for more information.\n"
     unless @ARGV;
 
+  # 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.
+  @include = uniq (@include);
+
   # Convert @trace to %trace, and work around the M4 builtins tracing
   # problem.
   # The default format is `$f:$l:$n:$%'.
index 87f4385005f906dc969cfbf80a55abbabe27b8d4..cb24556a52ebd54d266d5b172d75f80f388a4e8b 100644 (file)
@@ -135,7 +135,7 @@ sub parse_args ()
 ## -------------- ##
 parse_args;
 mktmpdir ('au');
-$autoconf .= " --autoconf-dir $autoconf_dir --localdir $localdir ";
+$autoconf .= " --include=$autoconf_dir --include=$localdir ";
 $autoconf .= "--debug " if $debug;
 $autoconf .= "--verbose " if $verbose;
 
@@ -176,17 +176,22 @@ my (%ac_macros, %au_macros);
 while (<MACROS>)
   {
     chomp;
-    /^(AC|AU):(.*):([^:]*)$/ or next;
+    my ($domain, $file, $macro) = /^(AC|AU):(.*):([^:]*)$/ or next;
     # ../lib/m4sugar/m4sugar.m4  -> m4sugar
     # ../lib/autoconf/general.m4 -> autoconf
-    my $set = basename (dirname ($2));
-    if ($1 eq "AC")
+    # aclocal.m4 -> ignore
+    next
+      if $file eq 'aclocal.m4';
+    my $set = basename (dirname ($file));
+    die "$me: unknown set: $set: $_\n"
+      unless $set =~ /^(m4sugar|autoconf)$/;
+    if ($domain eq "AC")
       {
-       $ac_macros{$3} = $set;
+       $ac_macros{$macro} = $set;
       }
     else
       {
-       $au_macros{$3} = $set;
+       $au_macros{$macro} = $set;
       }
   }
 close MACROS
@@ -202,6 +207,11 @@ if ($debug)
     print STDERR "Obsolete Autoconf macros:\n";
     print STDERR join (' ', sort keys %au_macros) . "\n\n";
   }
+die "$me: no current Autoconf macros found\n"
+  unless keys %ac_macros;
+die "$me: no obsolete Autoconf macros found\n"
+  unless keys %au_macros;
+
 
 # $au_changequote -- enable the quote `[', `]' right before any AU macro.
 my $au_changequote =
@@ -364,11 +374,11 @@ EOF
     # Now ask m4 to perform the update.
     if ("$file" eq "$tmp/stdin")
        {
-        xsystem ("$m4 -$autoconf_dir $tmp/input.m4");
+        xsystem ("$m4 --include=$autoconf_dir $tmp/input.m4");
        }
     else
        {
-        xsystem ("$m4 -$autoconf_dir $tmp/input.m4 >$tmp/updated");
+        xsystem ("$m4 --include=$autoconf_dir $tmp/input.m4 >$tmp/updated");
         if (compare ("$tmp/updated", "$file") == 0)
           {
             # File didn't change, so don't update its mod time.
index c2aae4c0d1fe61ea3a99a7354967f26c6b2e1628..4eeee9fda8c7346873f2a5bda9e92d483380e815 100644 (file)
@@ -24,6 +24,9 @@ verbosely report processing
 \fB\-d\fR, \fB\-\-debug\fR
 don't remove temporary files
 .TP
+\fB\-I\fR, \fB\-\-include\fR=\fIDIR\fR
+look for input files in DIR.  Accumulates
+.TP
 \fB\-f\fR, \fB\-\-force\fR
 consider all the files are obsolete
 .TP
@@ -56,13 +59,6 @@ turn off all the warnings
 warnings are error
 .PP
 The environment variable `WARNINGS' is honored.
-.SS "Library directories:"
-.TP
-\fB\-A\fR, \fB\-\-autoconf\-dir\fR=\fIACDIR\fR
-Autoconf's macro files location (rarely needed)
-.TP
-\fB\-l\fR, \fB\-\-localdir\fR=\fIDIR\fR
-location of the `aclocal.m4' file
 .SS "Tracing:"
 .TP
 \fB\-t\fR, \fB\-\-trace\fR=\fIMACRO\fR
index 8a4e3fb58c2cdb91ad0f47207b296a20c6a49db9..47c80b9884cb1056aa34ee41ab4d1c718da1df4b 100644 (file)
@@ -65,7 +65,7 @@ AC_STATE_SAVE(after)
 # -----------------------------------------------------------
 m4_define([AT_CHECK_AUTOCONF],
 [AT_CLEANUP_FILES(configure.in configure autom4te.cache)dnl
-AT_CHECK([autoconf --localdir=$srcdir $1],
+AT_CHECK([autoconf --include=$srcdir $1],
          m4_default([$2], [0]), [$3], [$4])])
 
 
index 13a1f4da15c0997e712c1331da4e04739e00a536..8e72c56791373d03e7b3a81a517e7ff8ac056b46 100755 (executable)
@@ -1,8 +1,8 @@
 #! /bin/sh
-# Running `autoheader' as if it were installed.
+# Running `$0' as if it were installed.
 
 me=`echo "$0" | sed -e 's,.*[\\/],,'`
 
 . ./atconfig
 
-exec ../bin/$me --autoconf-dir ../lib ${1+"$@"}
+exec ../bin/$me --include ../lib ${1+"$@"}
index 13a1f4da15c0997e712c1331da4e04739e00a536..c290a17297d2f977c2419b58f36ac2e4ca8e8044 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Running `autoheader' as if it were installed.
+# Running `$0' as if it were installed.
 
 me=`echo "$0" | sed -e 's,.*[\\/],,'`
 
index 13a1f4da15c0997e712c1331da4e04739e00a536..c290a17297d2f977c2419b58f36ac2e4ca8e8044 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Running `autoheader' as if it were installed.
+# Running `$0' as if it were installed.
 
 me=`echo "$0" | sed -e 's,.*[\\/],,'`