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.
This commit is contained in:
Akim Demaille 2001-08-04 13:14:10 +00:00
parent 37ea55bd5f
commit 4eea9f6530
4 changed files with 43 additions and 19 deletions

View File

@ -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

View 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"`

View 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)
{

View 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