]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Autom4te shall not encode Autoconf data, and preselecting traces
authorAkim Demaille <akim@epita.fr>
Sat, 4 Aug 2001 13:14:10 +0000 (13:14 +0000)
committerAkim Demaille <akim@epita.fr>
Sat, 4 Aug 2001 13:14:10 +0000 (13:14 +0000)
must be proposed to the users.
* bin/autom4te.in (@required_trace): Remove.
(@preselect): New.
(&parse_args, &print_usage): -p, --preselect is a new option.
(&up_to_date_p): Adjust.
* bin/autoconf.in: Preselect some Autoconf macros.

ChangeLog
bin/autoconf.in
bin/autom4te.in
man/autom4te.1

index 28090f965cb82df80b44c33716ab6bf9c9bbaedb..84f09ba495c78424e49eaa346f187cfd237cb263 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2001-08-04  Akim Demaille  <akim@epita.fr>
+
+       Autom4te shall not encode Autoconf data, and preselecting traces
+       must be proposed to the users.
+
+       * bin/autom4te.in (@required_trace): Remove.
+       (@preselect): New.
+       (&parse_args, &print_usage): -p, --preselect is a new option.
+       (&up_to_date_p): Adjust.
+       * bin/autoconf.in: Preselect some Autoconf macros.
+
 2001-08-04  Akim Demaille  <akim@epita.fr>
 
        * tests/tools.at (autoconf --trace: user macros): Check traces on
index 604985bcee911a8806de115028a3b14d9818e853..45d9bb65e6ca8a455da5d2a87053ef71881decf0 100644 (file)
@@ -219,12 +219,21 @@ esac
 # Unless specified, the output is stdout.
 test -z "$outfile" && outfile=-
 
+# Preselected macros: for autoheader and automake.
+for i in AC_CONFIG_HEADERS AH_OUTPUT AC_DEFINE_TRACE_LITERAL \
+         AC_SUBST AC_LIBSOURCE
+do
+  preselect="$preselect--preselect $i "
+done
+
+
 # Running autom4te.
 run_autom4te="$autom4te "\
 `$verbose "--verbose "`\
 `$debug && echo "--debug "`\
 "--include $autoconf_dir --include $localdir "\
 "--warning syntax,$warnings "\
+"$preselect"\
 "autoconf/autoconf.m4"`$initialization || echo f`" "\
 `test -f "$autoconf_dir/acsite.m4" && echo "$autoconf_dir/acsite.m4"`" "\
 `test -f "$localdir/aclocal.m4" && echo "$localdir/aclocal.m4"`
index 6322c3fff94ffffae10f8584c33896a88bbd5a38..b5a7a875e1d7dd82eda5c35800234970c7f86f54 100644 (file)
@@ -227,24 +227,15 @@ use File::Basename;
 use IO::File;
 use strict;
 
-# The macros we always trace.
-my @required_trace =
-  (
-   # We need `include' to find the dependencies.
-   'include', 'm4_include',
-   # These are wanted by autoheader.
-   'AC_CONFIG_HEADERS',
-   'AH_OUTPUT',
-   'AC_DEFINE_TRACE_LITERAL',
-   # These will be traced by Automake.
-   'AC_SUBST',
-   'AC_LIBSOURCE',
-  );
-
 # The macros to trace mapped to their format, as specified by the
 # user.
 my %trace;
 
+# The macros the user will want to trace in the future.
+# We need `include'.
+# FIXME: What about `sinclude'?
+my @preselect = ('include');
+
 my $output = '-';
 my @warning;
 
@@ -391,7 +382,8 @@ Library directories:
   -I, --include=DIR  look in DIR.  Several invocations accumulate
 
 Tracing:
-  -t, --trace=MACRO  report the MACRO invocations
+  -t, --trace=MACRO      report the MACRO invocations
+  -p, --preselect=MACRO  prepare to trace MACRO in a future run
 
 Report bugs to <bug-autoconf\@gnu.org>.
 EOF
@@ -444,7 +436,8 @@ sub parse_args ()
      # instead of mapping `FOO' to undef, Getopt maps it to `1', preventing
      # us from distinguishing `-t FOO' from `-t FOO=1'.  So let's do it
      # by hand.
-     "t|trace=s" => \@trace,
+     "t|trace=s"     => \@trace,
+     "p|preselect=s" => \@preselect,
     )
       or exit 1;
 
@@ -452,7 +445,8 @@ sub parse_args ()
 Try `$me --help' for more information.\n"
     unless @ARGV;
 
-  # Convert @trace to %trace.
+  # Convert @trace to %trace, and work around the M4 builtins tracing
+  # problem.
   # The default format is `$f:$l:$n:$%'.
   foreach (@trace)
     {
@@ -462,6 +456,11 @@ Try `$me --help' for more information.\n"
        if exists $m4_builtin_alternate_name{$1};
     }
 
+  # Work around the M4 builtins tracing problem for @PRESELECT.
+  push (@preselect,
+       map { $m4_builtin_alternate_name{$_} }
+       grep { exists $m4_builtin_alternate_name{$_} } @preselect);
+
   # We don't want to depend upon m4's --include to find the top level
   # files.  Try to get a canonical name, as it's part of the key for caching.
   for (my $i = 0; $i < $#ARGV; ++$i)
@@ -873,7 +872,9 @@ sub up_to_date_p ($$)
   # Files may include others.  We can use traces since we just checked
   # if they are available.
   # If $FILE is younger than one of its dependencies, it is outdated.
-  handle_traces ($req, "$tmp/dependencies",('include' => '$1'));
+  handle_traces ($req, "$tmp/dependencies",
+                ('include'    => '$1',
+                 'm4_include' => '$1'));
   my $mtime = (stat ($file))[9];
   my $deps = new IO::File ("$tmp/dependencies");
   push @dep, map { chomp; find_file ($_) } $deps->getlines;
@@ -912,7 +913,7 @@ Request->load ("$me.cache/requests")
 # Add the new trace requests.
 my $req = Request->request ('source' => \@ARGV,
                            'path' => \@include,
-                           'macro' => [keys %trace, @required_trace]);
+                           'macro' => [keys %trace, @preselect]);
 
 if ($verbose)
   {
index 9fd590ff81a36a373d844b379b39bc85dd6a5647..5c399b4eabd1cab0c537b33aeb70466970288afa 100644 (file)
@@ -61,6 +61,9 @@ look in DIR.  Several invocations accumulate
 .TP
 \fB\-t\fR, \fB\-\-trace\fR=\fIMACRO\fR
 report the MACRO invocations
+.TP
+\fB\-p\fR, \fB\-\-preselect\fR=\fIMACRO\fR
+prepare to trace MACRO in a future run
 .SH AUTHOR
 Written by Akim Demaille.
 .PP