autoconf-patches
[Top][All Lists]
Advanced

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

70-fyi-autoupdate--include.patch


From: Akim Demaille
Subject: 70-fyi-autoupdate--include.patch
Date: Fri, 31 Aug 2001 15:31:07 +0200

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * bin/autom4te.in (&parse_args): Strip `.' from address@hidden'.
        * bin/autoupdate.in: Use --include, -I, and --force, -f, too.
        Use directly autom4te, not autoconf.
        * tests/autoupdate: $top_srcdir/lib is needed too for melt files.

Index: NEWS
--- NEWS Fri, 31 Aug 2001 11:53:59 +0200 akim
+++ NEWS Fri, 31 Aug 2001 13:04:32 +0200 akim
@@ -13,11 +13,12 @@
 ** autom4te
   New executable, used by the Autoconf suite to cache and speed up
   some processing.
-** Standardization of the executables options
+** Standardization of the executables interface
 - --force, -f
   Supported by autom4te, autoconf and autoheader.
 - --include, -I
-  Replaces --autoconf-dir and --localdir in autoconf and autoheader.
+  Replaces --autoconf-dir and --localdir in autoconf, autoheader and
+  autoupdate.
 ** Bug fixes
 - The top level $prefix is propagated to the AC_CONFIG_SUBDIRS configures.
 ** C Macros
Index: bin/autom4te.in
--- bin/autom4te.in Fri, 31 Aug 2001 11:47:23 +0200 akim
+++ bin/autom4te.in Fri, 31 Aug 2001 12:05:43 +0200 akim
@@ -512,8 +512,9 @@ sub parse_args ()

   # 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);
+  # invalidates the cache.  And strip `.' which is implicit and always
+  # first.
+  @include = grep { !/^\.$/ } uniq (@include);

   # Convert @trace to %trace, and work around the M4 builtins tracing
   # problem.
Index: bin/autoupdate.in
--- bin/autoupdate.in Fri, 31 Aug 2001 11:22:31 +0200 akim
+++ bin/autoupdate.in Fri, 31 Aug 2001 12:51:36 +0200 akim
@@ -32,9 +32,9 @@
 use strict;

 # Lib files.
-my $autoconf_dir = $ENV{"AC_MACRODIR"} || "@datadir@";
-my $autoconf = $ENV{'AUTOCONF'} || '@autoconf-name@';
-my $localdir = '.';
+my $autom4te = $ENV{'AUTOM4TE'} || '@autom4te-name@';
+my @include;
+my $force = 0;
 # m4.
 my $m4 = $ENV{"M4"} || "@M4@";

@@ -53,14 +53,8 @@ Usage: $0 [OPTION] ...  [TEMPLATE-FILE..
   -V, --version        print version number, then exit
   -v, --verbose        verbosely report processing
   -d, --debug          don\'t remove temporary files
-
-Library directories:
-  -A, --autoconf-dir=ACDIR  Autoconf\'s macro files location (rarely needed)
-  -l, --localdir=DIR        location of \`aclocal.m4\'
-
-Environment variables:
-  M4         GNU M4 1.4 or above
-  AUTOCONF   autoconf @VERSION@
+  -I, --include=DIR    look for input files in DIR.  Accumulates
+  -f, --force          consider all the files are obsolete

 Report bugs to <address@hidden>.
 END
@@ -92,8 +86,8 @@ sub parse_args ()
   # If fixed some day, use this: '' => sub { push @ARGV, "-" }
   my $update_stdin = grep /^-$/, @ARGV;
   @ARGV = grep !/^-$/, @ARGV;
-  getopt ('A|autoconf-dir|m|macrodir=s' => \$autoconf_dir,
-         'l|localdir=s' => \$localdir);
+  getopt ('I|include|A|autoconf-dir|m|macrodir|l|localdir=s' => address@hidden,
+         'f|force' => \$force);

   push @ARGV, '-'
     if $update_stdin;
@@ -111,11 +105,15 @@ sub parse_args ()
 ## -------------- ##
 ## Main program.  ##
 ## -------------- ##
+
 parse_args;
+my $autoconf = "$autom4te --language=autoconf ";
+$autoconf .= join (' --include=', '', @include);
+$autoconf .= " --debug" if $debug;
+$autoconf .= " --force" if $force;
+$autoconf .= " --verbose" if $verbose;
+
 mktmpdir ('au');
-$autoconf .= " --include=$autoconf_dir --include=$localdir ";
-$autoconf .= "--debug " if $debug;
-$autoconf .= "--verbose " if $verbose;

 # @M4_BUILTINS -- M4 builtins and a useful comment.
 my @m4_builtins = `echo dumpdef | $m4 2>&1 >/dev/null`;
@@ -148,7 +146,7 @@ sub parse_args ()
 # @AU_MACROS & AC_MACROS -- AU and AC macros and yet another useful comment.
 open MACROS, ("$autoconf "
              . "--trace AU_DEFUN:'AU:\$f:\$1' --trace define:'AC:\$f:\$1' "
-             . "-i /dev/null |")
+             . "--melt /dev/null |")
   or die "$me: cannot open definitions reading pipe: $!\n";
 my (%ac_macros, %au_macros);
 while (<MACROS>)
@@ -197,7 +195,7 @@ sub parse_args ()

 # au.m4 -- definitions the AU macros.
 xsystem ("$autoconf --trace AU_DEFUN:'_au_defun(\@<:address@hidden@:>\@,
-\@<:address@hidden@:>\@)' -i /dev/null "
+\@<:address@hidden@:>\@)' --melt /dev/null "
        . ">$tmp/au.m4");

 # ac.m4 -- autoquoting definitions of the AC macros (M4sugar excluded).
@@ -350,7 +348,9 @@ sub parse_args ()
        or die "$me: cannot close $tmp/input.m4: $!\n";

     # Now ask m4 to perform the update.
-    xsystem ("$m4 --include=$autoconf_dir $tmp/input.m4 >$tmp/updated");
+    xsystem ("$m4"
+            . join (' --include=', '', @include)
+            . " $tmp/input.m4 >$tmp/updated");
     update_file ("$tmp/updated",
                 "$file" eq "$tmp/stdin" ? '-' : "$file");
   }
Index: doc/autoconf.texi
--- doc/autoconf.texi Fri, 31 Aug 2001 11:53:59 +0200 akim
+++ doc/autoconf.texi Fri, 31 Aug 2001 12:07:49 +0200 akim
@@ -10066,6 +10066,10 @@ @node autoupdate Invocation
 @itemx -d
 Don't remove the temporary files.

address@hidden --force
address@hidden -f
+Force the update even if the file has not changed.  Disregard the cache.
+
 @item address@hidden
 @itemx -I @var{dir}
 Also look for input files in @var{dir}.  Multiple invocations accumulate.
Index: tests/autoheader
--- tests/autoheader Fri, 31 Aug 2001 08:52:55 +0200 akim
+++ tests/autoheader Fri, 31 Aug 2001 12:01:32 +0200 akim
@@ -11,4 +11,4 @@
 autom4te_perllibdir=$top_srcdir/lib
 export autom4te_perllibdir

-exec ../bin/autoheader --autoconf-dir ../lib ${1+"$@"}
+exec ../bin/autoheader --include ../lib ${1+"$@"}
Index: tests/autoupdate
--- tests/autoupdate Thu, 30 Aug 2001 20:46:39 +0200 akim
+++ tests/autoupdate Fri, 31 Aug 2001 12:22:47 +0200 akim
@@ -11,4 +11,4 @@
 autom4te_perllibdir=$top_srcdir/lib
 export autom4te_perllibdir

-exec ../bin/autoupdate --autoconf-dir ../lib ${1+"$@"}
+exec ../bin/autoupdate --include ../lib --include $top_srcdir/lib ${1+"$@"}



reply via email to

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