autoconf-patches
[Top][All Lists]
Advanced

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

05-fyi-autom4te-preselect.patch


From: Akim Demaille
Subject: 05-fyi-autom4te-preselect.patch
Date: Sat, 04 Aug 2001 15:12:26 +0200

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        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.

Index: bin/autoconf.in
--- bin/autoconf.in Sun, 29 Jul 2001 09:54:24 +0200 akim (ace/17_autoconf.s 
1.31.8.53 644)
+++ bin/autoconf.in Thu, 02 Aug 2001 17:27:48 +0200 akim (ace/17_autoconf.s 
1.31.8.53 644)
@@ -219,12 +219,21 @@
 # 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: bin/autom4te.in
--- bin/autom4te.in Thu, 02 Aug 2001 17:19:46 +0200 akim (ace/c/10_autom4te.i 
1.15 644)
+++ bin/autom4te.in Thu, 02 Aug 2001 17:34:48 +0200 akim (ace/c/10_autom4te.i 
1.15 644)
@@ -227,24 +227,15 @@ sub load
 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', aka, `m4_include'.
+# FIXME: What about `sinclude'?
+my @preselect = ('include', 'm4_include');
+
 my $output = '-';
 my @warning;

@@ -391,7 +382,8 @@ sub print_usage ()
   -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 <address@hidden>.
 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" => address@hidden,
+     "t|trace=s"     => address@hidden,
+     "p|preselect=s" => address@hidden,
     )
       or exit 1;

@@ -871,7 +864,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;
@@ -910,7 +905,7 @@ sub up_to_date_p ($$)
 # Add the new trace requests.
 my $req = Request->request ('source' => address@hidden,
                            'path' => address@hidden,
-                           'macro' => [keys %trace, @required_trace]);
+                           'macro' => [keys %trace, @preselect]);

 if ($verbose)
   {
Index: bin/autom4te.in
--- bin/autom4te.in Thu, 02 Aug 2001 19:50:48 +0200 akim
+++ bin/autom4te.in Fri, 03 Aug 2001 16:58:21 +0200 akim
@@ -232,9 +232,9 @@ sub load
 my %trace;
 
 # The macros the user will want to trace in the future.
-# We need `include', aka, `m4_include'.
+# We need `include'.
 # FIXME: What about `sinclude'?
-my @preselect = ('include', 'm4_include');
+my @preselect = ('include');
 
 my $output = '-';
 my @warning;
@@ -445,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)
     {
@@ -454,6 +455,11 @@ sub parse_args ()
       $trace{$m4_builtin_alternate_name{$1}} = $trace{$1}
        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.



reply via email to

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