autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

62-fyi-autoconf--include.patch


From: Akim Demaille
Subject: 62-fyi-autoconf--include.patch
Date: Fri, 31 Aug 2001 15:30:22 +0200

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        * 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 address@hidden'.
        * bin/autoupdate.in: Adjust, and perform more control.
        * tests/atspecific.m4 (AT_CHECK_AUTOCONF): Adjust.
        * tests/autoconf: Dittowise.
        
        
Index: bin/autoconf.in
--- bin/autoconf.in Thu, 30 Aug 2001 23:35:32 +0200 akim
+++ bin/autoconf.in Fri, 31 Aug 2001 00:43:20 +0200 akim
@@ -34,6 +34,7 @@ Usage: $0 [OPTION] ... [TEMPLATE-FILE]
   -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 @@ Usage: $0 [OPTION] ... [TEMPLATE-FILE]
 
 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 @@ Tracing:
 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
 
 # Variables.
-: address@hidden@}}
 : address@hidden@}
-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 @@ Tracing:
     --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 @@ Tracing:
        traces="$traces --trace='"`echo "$1" | sed "s/'/'\\\\\\\\''/g"`"'"
        shift ;;
     --initialization | -i )
-       initialization=:
+       AUTOM4TE="$AUTOM4TE --melt"
        shift;;
 
     --output=* | -o?* )
@@ -165,15 +150,6 @@ Tracing:
        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 @@ Tracing:
 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: bin/autoheader.in
--- bin/autoheader.in Thu, 30 Aug 2001 20:46:39 +0200 akim
+++ bin/autoheader.in Fri, 31 Aug 2001 00:09:00 +0200 akim
@@ -78,7 +78,6 @@ Usage: $0 [OPTION] ... [TEMPLATE-FILE]
 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
 
 # Variables.
-: address@hidden@}}
 : address@hidden@}
 dir=`echo "$0" | sed -e 's,[^/]*$,,'`
 debug=false
@@ -253,7 +252,7 @@ Usage: $0 [OPTION] ... [TEMPLATE-FILE]
 esac
 
 # Set up autoconf.
-autoconf="$AUTOCONF -A $autoconf_dir -l $localdir "\
+autoconf="$AUTOCONF --include=$autoconf_dir --include=$localdir "\
 `$verbose "--verbose "`\
 `$debug && echo "--debug "`
 
Index: bin/autom4te.in
--- bin/autom4te.in Thu, 30 Aug 2001 23:35:32 +0200 akim
+++ bin/autom4te.in Fri, 31 Aug 2001 00:17:55 +0200 akim
@@ -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: bin/autoupdate.in
--- bin/autoupdate.in Thu, 30 Aug 2001 20:46:39 +0200 akim
+++ bin/autoupdate.in Fri, 31 Aug 2001 00:52:23 +0200 akim
@@ -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 @@ sub parse_args ()
 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 @@ sub parse_args ()
     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 @@ sub parse_args ()
     # Now ask m4 to perform the update.
     if ("$file" eq "$tmp/stdin")
        {
-        xsystem ("$m4 -I $autoconf_dir $tmp/input.m4");
+        xsystem ("$m4 --include=$autoconf_dir $tmp/input.m4");
        }
     else
        {
-        xsystem ("$m4 -I $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: tests/atspecific.m4
--- tests/atspecific.m4 Thu, 30 Aug 2001 20:46:39 +0200 akim
+++ tests/atspecific.m4 Fri, 31 Aug 2001 00:05:51 +0200 akim
@@ -65,7 +65,7 @@ m4_define([AT_CONFIGURE_AC],
 # -----------------------------------------------------------
 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: tests/autoconf
--- tests/autoconf Thu, 30 Aug 2001 20:46:39 +0200 akim
+++ tests/autoconf Fri, 31 Aug 2001 00:01:31 +0200 akim
@@ -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: tests/autoheader
--- tests/autoheader Thu, 30 Aug 2001 20:46:39 +0200 akim
+++ tests/autoheader Fri, 31 Aug 2001 00:09:15 +0200 akim
@@ -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: tests/autoreconf
--- tests/autoreconf Thu, 30 Aug 2001 20:46:39 +0200 akim
+++ tests/autoreconf Fri, 31 Aug 2001 00:09:29 +0200 akim
@@ -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,.*[\\/],,'`
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]