]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* autoscan.in (%kind_comment): New.
authorAkim Demaille <akim@epita.fr>
Tue, 12 Jun 2001 10:05:27 +0000 (10:05 +0000)
committerAkim Demaille <akim@epita.fr>
Tue, 12 Jun 2001 10:05:27 +0000 (10:05 +0000)
(output_kind): New.
(output_functions, output_identifiers, output_headers): Use it.

ChangeLog
autoscan.in
bin/autoscan.in

index bd8eb6250d87f94653e64484aec60f2107bb7fc6..778458494e41f5ce7376c11e6cb2c283da42dd3b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-06-12  Akim Demaille  <akim@epita.fr>
+
+       * autoscan.in (%kind_comment): New.
+       (output_kind): New.
+       (output_functions, output_identifiers, output_headers): Use it.
+
 2001-06-12  Akim Demaille  <akim@epita.fr>
 
        * autoscan.in (&print_unique): Take `$kind' and `$word' as
index 10443e2c2fa23f0d3993a634c3b1970a832b3151..eb3598cd7718f84a6bb688400bee32b45d0535c5 100644 (file)
@@ -53,6 +53,12 @@ my %generic_macro =
    'libraries'   => 'AC_CHECK_LIB'
   );
 
+my %kind_comment =
+  (
+   'functions' => 'Checks for library functions.',
+   'headers' => 'Checks for header files.',
+   'identifiers' => 'Checks for typedefs, structures, and compiler characteristics.',
+  );
 
 my $configure_scan = 'configure.scan';
 
@@ -438,6 +444,36 @@ sub print_unique ($@)
 }
 
 
+# output_kind ($KIND)
+# -------------------
+sub output_kind ($)
+{
+  my ($kind) = @_;
+  my @have;
+
+  print CONF "\n# $kind_comment{$kind}\n";
+  foreach my $word (sort keys %{$used{$kind}})
+    {
+      if (defined $macro{$kind}{$word})
+       {
+         if ($macro{$kind}{$word} eq $generic_macro{$kind})
+           {
+             push (@have, $word);
+             push (@{$needed_macros{"$generic_macro{$kind}([$word])"}},
+                   @{$used{$kind}{$word}});
+           }
+         else
+           {
+             print_unique ($kind, $word);
+           }
+       }
+    }
+  print CONF "$generic_macro{$kind}([" . join(' ', sort(@have)) . "])\n"
+    if @have;
+}
+
+
+
 # output_programs ()
 # ------------------
 sub output_programs ()
@@ -471,27 +507,7 @@ sub output_libraries ()
 # -----------------
 sub output_headers ()
 {
-  my @have_headers;
-
-  print CONF "\n# Checks for header files.\n";
-  foreach my $word (sort keys %{$used{'headers'}})
-    {
-      if (defined $macro{'headers'}{$word})
-       {
-         if ($macro{'headers'}{$word} eq 'AC_CHECK_HEADERS')
-           {
-             push (@have_headers, $word);
-             push (@{$needed_macros{"AC_CHECK_HEADERS([$word])"}},
-                   @{$used{'headers'}{$word}});
-           }
-         else
-           {
-             print_unique ('headers', $word);
-           }
-       }
-    }
-  print CONF "AC_CHECK_HEADERS([" . join(' ', sort(@have_headers)) . "])\n"
-    if @have_headers;
+  output_kind ('headers');
 }
 
 
@@ -499,27 +515,7 @@ sub output_headers ()
 # ---------------------
 sub output_identifiers ()
 {
-  my @have_types;
-
-  print CONF "\n# Checks for typedefs, structures, and compiler characteristics.\n";
-  foreach my $word (sort keys %{$used{'identifiers'}})
-    {
-      if (defined $macro{'identifiers'}{$word})
-       {
-         if ($macro{'identifiers'}{$word} eq 'AC_CHECK_TYPES')
-           {
-             push (@have_types, $word);
-             push (@{$needed_macros{"AC_CHECK_TYPES([$word])"}},
-                   @{$used{'identifiers'}{$word}});
-           }
-         else
-           {
-             print_unique ('identifiers', $word);
-           }
-       }
-    }
-  print CONF "AC_CHECK_TYPES([" . join(', ', sort(@have_types)) . "])\n"
-    if @have_types;
+  output_kind ('identifiers');
 }
 
 
@@ -527,27 +523,7 @@ sub output_identifiers ()
 # -------------------
 sub output_functions ()
 {
-  my @have_funcs;
-
-  print CONF "\n# Checks for library functions.\n";
-  foreach my $word (sort keys %{$used{'functions'}})
-    {
-      if (defined $macro{'functions'}{$word})
-       {
-         if ($macro{'functions'}{$word} eq 'AC_CHECK_FUNCS')
-           {
-             push (@have_funcs, $word);
-             push (@{$needed_macros{"AC_CHECK_FUNCS([$word])"}},
-                   @{$used{'functions'}{$word}});
-           }
-         else
-           {
-             print_unique ('functions', $word);
-           }
-       }
-    }
-  print CONF "AC_CHECK_FUNCS([" . join(' ', sort(@have_funcs)) . "])\n"
-    if @have_funcs;
+  output_kind ('functions');
 }
 
 
index 10443e2c2fa23f0d3993a634c3b1970a832b3151..eb3598cd7718f84a6bb688400bee32b45d0535c5 100644 (file)
@@ -53,6 +53,12 @@ my %generic_macro =
    'libraries'   => 'AC_CHECK_LIB'
   );
 
+my %kind_comment =
+  (
+   'functions' => 'Checks for library functions.',
+   'headers' => 'Checks for header files.',
+   'identifiers' => 'Checks for typedefs, structures, and compiler characteristics.',
+  );
 
 my $configure_scan = 'configure.scan';
 
@@ -438,6 +444,36 @@ sub print_unique ($@)
 }
 
 
+# output_kind ($KIND)
+# -------------------
+sub output_kind ($)
+{
+  my ($kind) = @_;
+  my @have;
+
+  print CONF "\n# $kind_comment{$kind}\n";
+  foreach my $word (sort keys %{$used{$kind}})
+    {
+      if (defined $macro{$kind}{$word})
+       {
+         if ($macro{$kind}{$word} eq $generic_macro{$kind})
+           {
+             push (@have, $word);
+             push (@{$needed_macros{"$generic_macro{$kind}([$word])"}},
+                   @{$used{$kind}{$word}});
+           }
+         else
+           {
+             print_unique ($kind, $word);
+           }
+       }
+    }
+  print CONF "$generic_macro{$kind}([" . join(' ', sort(@have)) . "])\n"
+    if @have;
+}
+
+
+
 # output_programs ()
 # ------------------
 sub output_programs ()
@@ -471,27 +507,7 @@ sub output_libraries ()
 # -----------------
 sub output_headers ()
 {
-  my @have_headers;
-
-  print CONF "\n# Checks for header files.\n";
-  foreach my $word (sort keys %{$used{'headers'}})
-    {
-      if (defined $macro{'headers'}{$word})
-       {
-         if ($macro{'headers'}{$word} eq 'AC_CHECK_HEADERS')
-           {
-             push (@have_headers, $word);
-             push (@{$needed_macros{"AC_CHECK_HEADERS([$word])"}},
-                   @{$used{'headers'}{$word}});
-           }
-         else
-           {
-             print_unique ('headers', $word);
-           }
-       }
-    }
-  print CONF "AC_CHECK_HEADERS([" . join(' ', sort(@have_headers)) . "])\n"
-    if @have_headers;
+  output_kind ('headers');
 }
 
 
@@ -499,27 +515,7 @@ sub output_headers ()
 # ---------------------
 sub output_identifiers ()
 {
-  my @have_types;
-
-  print CONF "\n# Checks for typedefs, structures, and compiler characteristics.\n";
-  foreach my $word (sort keys %{$used{'identifiers'}})
-    {
-      if (defined $macro{'identifiers'}{$word})
-       {
-         if ($macro{'identifiers'}{$word} eq 'AC_CHECK_TYPES')
-           {
-             push (@have_types, $word);
-             push (@{$needed_macros{"AC_CHECK_TYPES([$word])"}},
-                   @{$used{'identifiers'}{$word}});
-           }
-         else
-           {
-             print_unique ('identifiers', $word);
-           }
-       }
-    }
-  print CONF "AC_CHECK_TYPES([" . join(', ', sort(@have_types)) . "])\n"
-    if @have_types;
+  output_kind ('identifiers');
 }
 
 
@@ -527,27 +523,7 @@ sub output_identifiers ()
 # -------------------
 sub output_functions ()
 {
-  my @have_funcs;
-
-  print CONF "\n# Checks for library functions.\n";
-  foreach my $word (sort keys %{$used{'functions'}})
-    {
-      if (defined $macro{'functions'}{$word})
-       {
-         if ($macro{'functions'}{$word} eq 'AC_CHECK_FUNCS')
-           {
-             push (@have_funcs, $word);
-             push (@{$needed_macros{"AC_CHECK_FUNCS([$word])"}},
-                   @{$used{'functions'}{$word}});
-           }
-         else
-           {
-             print_unique ('functions', $word);
-           }
-       }
-    }
-  print CONF "AC_CHECK_FUNCS([" . join(' ', sort(@have_funcs)) . "])\n"
-    if @have_funcs;
+  output_kind ('functions');
 }