* lib/Autom4te/General.pm (&unique): New.

* bin/autoscan.in (&output): Use it to issue trace requests once.
This commit is contained in:
Akim Demaille 2001-08-01 15:02:36 +00:00
parent 2892d23307
commit f0cd6d6a75
4 changed files with 33 additions and 8 deletions

View File

@ -1,3 +1,8 @@
2001-08-01 Akim Demaille <akim@epita.fr>
* lib/Autom4te/General.pm (&unique): New.
* bin/autoscan.in (&output): Use it to issue trace requests once.
2001-08-01 Akim Demaille <akim@epita.fr>
* lib/Autom4te/General.pm: New.

View File

@ -379,7 +379,7 @@ Tracing:
Report bugs to <bug-autoconf\@gnu.org>.
EOF
# Help font-lock-mode find an closing back quote: `
# Help font-lock-mode find a closing back quote: `
exit 0;
}

View File

@ -544,15 +544,15 @@ sub output ($)
sub check_configure_ac ($)
{
my ($configure_ac) = @_;
my ($trace_option) = '';
# Find what needed macros are invoked in CONFIGURE_AC.
foreach my $macro (sort keys %needed_macros)
{
$macro =~ s/\(.*//;
$trace_option .= " -t $macro";
}
# I'd be very happy if someone could explain to me why sort (uniq ...)
# doesn't work properly: I need `uniq (sort ...)'. --akim
my $trace_option =
join (' -t ', '',
uniq (sort (map { s/\(.*//; $_ } keys %needed_macros)));
verbose "running: $autoconf -A $datadir $trace_option $configure_ac";
my $traces =
new IO::File "$autoconf -A $datadir $trace_option $configure_ac|"
or die "$me: cannot create read traces: $!\n";

View File

@ -26,7 +26,7 @@ use strict;
use vars qw (@ISA @EXPORT $me);
@ISA = qw (Exporter);
@EXPORT = qw (&find_configure_ac &find_peer &mktmpdir &verbose &xsystem
@EXPORT = qw (&find_configure_ac &find_peer &mktmpdir &uniq &verbose &xsystem
$me $verbose $debug $tmp);
# Variable we share with the main package. Be sure to have a single
@ -131,6 +131,26 @@ sub mktmpdir ($)
}
# @RES
# uniq (@LIST)
# ------------
# Return LIST with no duplicates.
sub uniq (@)
{
my @res = ();
my %seen = ();
foreach my $item (@_)
{
if (! exists $seen{$item})
{
$seen{$item} = 1;
push (@res, $item);
}
}
return wantarray ? @res : "@res";
}
# verbose
# -------
sub verbose (@)