]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/Autom4te/General.pm (&unique): New.
authorAkim Demaille <akim@epita.fr>
Wed, 1 Aug 2001 15:02:36 +0000 (15:02 +0000)
committerAkim Demaille <akim@epita.fr>
Wed, 1 Aug 2001 15:02:36 +0000 (15:02 +0000)
* bin/autoscan.in (&output): Use it to issue trace requests once.

ChangeLog
bin/autom4te.in
bin/autoscan.in
lib/Autom4te/General.pm

index 743a1b75392c436ea07fc786b4d5c3926c3162e1..5f468c68c8be405d1f29cb3ed06574cb3558fc63 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index 660465e5e1cbe8cfbab3eb00c0c24af3920c252f..64329e75ab036bef335f1d4660c545545aaf0793 100644 (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;
 }
 
index 21290889975a9af7523ed6155502478cca821093..50d01553341d948a5bb4af8e648eeec4d73cb160 100644 (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";
index 23c1ef85e3c55b8a5973c9c968dd8212ca3154c6..4194aab4913335821ac1c51a17e4911c3712a2ea 100644 (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 (@)