+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
# 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"`
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;
-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
# 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;
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)
{
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)
# 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;
# Add the new trace requests.
my $req = Request->request ('source' => \@ARGV,
'path' => \@include,
- 'macro' => [keys %trace, @required_trace]);
+ 'macro' => [keys %trace, @preselect]);
if ($verbose)
{