autoconf-patches
[Top][All Lists]
Advanced

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

FYI: 11-general-unique.patch


From: Akim Demaille
Subject: FYI: 11-general-unique.patch
Date: 30 Jul 2001 11:05:56 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Academic Rigor)

Index: autom4te.in
--- autom4te.in Sun, 29 Jul 2001 12:04:17 +0200 akim (ace/c/10_autom4te.i 1.10 
644)
+++ autom4te.in Sun, 29 Jul 2001 19:21:31 +0200 akim (ace/c/10_autom4te.i 1.10 
644)
@@ -374,7 +374,7 @@ sub print_usage ()
 
 Report bugs to <address@hidden>.
 EOF
-  # Help font-lock-mode find an closing back quote: `
+  # Help font-lock-mode find a closing back quote: `
   exit 0;
 }
 
Index: autoscan.in
--- autoscan.in Sun, 29 Jul 2001 12:04:17 +0200 akim (ace/13_autoscan.p 1.45 
644)
+++ autoscan.in Sun, 29 Jul 2001 14:02:56 +0200 akim (ace/13_autoscan.p 1.45 
644)
@@ -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: lib/Autoconf/General.pm
--- lib/Autoconf/General.pm Sun, 29 Jul 2001 12:04:17 +0200 akim 
(ace/c/32_General.pm 1.1 664)
+++ lib/Autoconf/General.pm Sun, 29 Jul 2001 14:02:43 +0200 akim 
(ace/c/32_General.pm 1.1 664)
@@ -26,7 +26,7 @@
 use vars qw (@ISA @EXPORT $me);
 
 @ISA = qw (Exporter);
address@hidden = qw (&find_configure_ac &find_peer &mktmpdir &verbose &xsystem
address@hidden = 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
@@ -128,6 +128,26 @@ sub mktmpdir ($)
 
   print STDERR "$me:$$: working in $tmp\n"
     if $debug;
+}
+
+
+# @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";
 }
 
 



reply via email to

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