]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* autoscan.in (&print_unique): Take `$kind' and `$word' as
authorAkim Demaille <akim@epita.fr>
Tue, 12 Jun 2001 09:45:01 +0000 (09:45 +0000)
committerAkim Demaille <akim@epita.fr>
Tue, 12 Jun 2001 09:45:01 +0000 (09:45 +0000)
arguments, to factor indirections into `%macro' and `%used'.
(%generic_macro): Fix a typo.

ChangeLog
autoscan.in
bin/autoscan.in

index 57a66dcb7d1fe49ddd8319c9cfe6bbdeb3450201..bd8eb6250d87f94653e64484aec60f2107bb7fc6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-06-12  Akim Demaille  <akim@epita.fr>
+
+       * autoscan.in (&print_unique): Take `$kind' and `$word' as
+       arguments, to factor indirections into `%macro' and `%used'.
+       (%generic_macro): Fix a typo.
+
 2001-06-12  Akim Demaille  <akim@epita.fr>
 
        * aclibraries: New.
index 324b55a1d032ae6ca6e6e03e0fec94ea1fad7454..10443e2c2fa23f0d3993a634c3b1970a832b3151 100644 (file)
@@ -49,7 +49,7 @@ my %generic_macro =
    'functions'   => 'AC_CHECK_FUNCS',
    'headers'     => 'AC_CHECK_HEADERS',
    'identifiers' => 'AC_CHECK_TYPES',
-   'programs'    => 'AC_CHECK_PROGS'
+   'programs'    => 'AC_CHECK_PROGS',
    'libraries'   => 'AC_CHECK_LIB'
   );
 
@@ -416,13 +416,17 @@ sub scan_sh_file ($)
 }
 
 
-# print_unique ($MACRO, @WHERE)
-# -----------------------------
-# $MACRO is wanted from $WHERE, hence (i) print $MACRO in $configure_scan
-# if it exists and hasn't been printed already, (ii), remember it's needed.
+# print_unique ($KIND, $WORD)
+# ---------------------------
+# $WORD, of some $KIND, is used, and needs to be checked.  (i) output
+# the needed macro invocation in $configure_scan if it exists and
+# hasn't been printed already, (ii), remember this macro needed.
 sub print_unique ($@)
 {
-  my ($macro, @where) = @_;
+  my ($kind, $word) = @_;
+
+  my $macro = $macro{$kind}{$word};
+  my @where = @{$used{$kind}{$word}};
 
   if (defined $macro && !defined $printed{$macro})
     {
@@ -441,11 +445,11 @@ sub output_programs ()
   print CONF "\n# Checks for programs.\n";
   foreach my $word (sort keys %{$used{'programs'}})
     {
-      print_unique ($macro{'programs'}{$word}, @{$used{'programs'}{$word}});
+      print_unique ('programs', $word);
     }
   foreach my $word (sort keys %{$used{'makevars'}})
     {
-      print_unique ($macro{'makevars'}{$word}, @{$used{'makevars'}{$word}});
+      print_unique ('makevars', $word);
     }
 }
 
@@ -482,8 +486,7 @@ sub output_headers ()
            }
          else
            {
-             print_unique ($macro{'headers'}{$word},
-                           @{$used{'headers'}{$word}});
+             print_unique ('headers', $word);
            }
        }
     }
@@ -511,8 +514,7 @@ sub output_identifiers ()
            }
          else
            {
-             print_unique ($macro{'identifiers'}{$word},
-                           @{$used{'identifiers'}{$word}});
+             print_unique ('identifiers', $word);
            }
        }
     }
@@ -540,8 +542,7 @@ sub output_functions ()
            }
          else
            {
-             print_unique ($macro{'functions'}{$word},
-                           @{$used{'functions'}{$word}});
+             print_unique ('functions', $word);
            }
        }
     }
index 324b55a1d032ae6ca6e6e03e0fec94ea1fad7454..10443e2c2fa23f0d3993a634c3b1970a832b3151 100644 (file)
@@ -49,7 +49,7 @@ my %generic_macro =
    'functions'   => 'AC_CHECK_FUNCS',
    'headers'     => 'AC_CHECK_HEADERS',
    'identifiers' => 'AC_CHECK_TYPES',
-   'programs'    => 'AC_CHECK_PROGS'
+   'programs'    => 'AC_CHECK_PROGS',
    'libraries'   => 'AC_CHECK_LIB'
   );
 
@@ -416,13 +416,17 @@ sub scan_sh_file ($)
 }
 
 
-# print_unique ($MACRO, @WHERE)
-# -----------------------------
-# $MACRO is wanted from $WHERE, hence (i) print $MACRO in $configure_scan
-# if it exists and hasn't been printed already, (ii), remember it's needed.
+# print_unique ($KIND, $WORD)
+# ---------------------------
+# $WORD, of some $KIND, is used, and needs to be checked.  (i) output
+# the needed macro invocation in $configure_scan if it exists and
+# hasn't been printed already, (ii), remember this macro needed.
 sub print_unique ($@)
 {
-  my ($macro, @where) = @_;
+  my ($kind, $word) = @_;
+
+  my $macro = $macro{$kind}{$word};
+  my @where = @{$used{$kind}{$word}};
 
   if (defined $macro && !defined $printed{$macro})
     {
@@ -441,11 +445,11 @@ sub output_programs ()
   print CONF "\n# Checks for programs.\n";
   foreach my $word (sort keys %{$used{'programs'}})
     {
-      print_unique ($macro{'programs'}{$word}, @{$used{'programs'}{$word}});
+      print_unique ('programs', $word);
     }
   foreach my $word (sort keys %{$used{'makevars'}})
     {
-      print_unique ($macro{'makevars'}{$word}, @{$used{'makevars'}{$word}});
+      print_unique ('makevars', $word);
     }
 }
 
@@ -482,8 +486,7 @@ sub output_headers ()
            }
          else
            {
-             print_unique ($macro{'headers'}{$word},
-                           @{$used{'headers'}{$word}});
+             print_unique ('headers', $word);
            }
        }
     }
@@ -511,8 +514,7 @@ sub output_identifiers ()
            }
          else
            {
-             print_unique ($macro{'identifiers'}{$word},
-                           @{$used{'identifiers'}{$word}});
+             print_unique ('identifiers', $word);
            }
        }
     }
@@ -540,8 +542,7 @@ sub output_functions ()
            }
          else
            {
-             print_unique ($macro{'functions'}{$word},
-                           @{$used{'functions'}{$word}});
+             print_unique ('functions', $word);
            }
        }
     }