]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* autoscan.in (&output_kind): Output the comment only if it exists.
authorAkim Demaille <akim@epita.fr>
Tue, 12 Jun 2001 10:16:49 +0000 (10:16 +0000)
committerAkim Demaille <akim@epita.fr>
Tue, 12 Jun 2001 10:16:49 +0000 (10:16 +0000)
(%kind_comment): Add entry for `programs'.
(&output_programs): Use &output_kind.
(&output_functions, &output_identifiers, &output_headers)
(&output_programs): Inline, and remove.

ChangeLog
autoscan.in
bin/autoscan.in

index 778458494e41f5ce7376c11e6cb2c283da42dd3b..aa9b6622216a8ce9c44bf8c954b83f099873cd9e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2001-06-12  Akim Demaille  <akim@epita.fr>
+
+       * autoscan.in (&output_kind): Output the comment only if it exists.
+       (%kind_comment): Add entry for `programs'.
+       (&output_programs): Use &output_kind.
+       (&output_functions, &output_identifiers, &output_headers)
+       (&output_programs): Inline, and remove.
+
 2001-06-12  Akim Demaille  <akim@epita.fr>
 
        * autoscan.in (%kind_comment): New.
index eb3598cd7718f84a6bb688400bee32b45d0535c5..887640a9e7907dfaa5b153ef9833a24fddcf0193 100644 (file)
@@ -58,6 +58,7 @@ my %kind_comment =
    'functions' => 'Checks for library functions.',
    'headers' => 'Checks for header files.',
    'identifiers' => 'Checks for typedefs, structures, and compiler characteristics.',
+   'programs' => 'Checks for programs.',
   );
 
 my $configure_scan = 'configure.scan';
@@ -451,12 +452,14 @@ sub output_kind ($)
   my ($kind) = @_;
   my @have;
 
-  print CONF "\n# $kind_comment{$kind}\n";
+  print CONF "\n# $kind_comment{$kind}\n"
+    if exists $kind_comment{$kind};
   foreach my $word (sort keys %{$used{$kind}})
     {
       if (defined $macro{$kind}{$word})
        {
-         if ($macro{$kind}{$word} eq $generic_macro{$kind})
+         if (exists $generic_macro{$kind}
+             && $macro{$kind}{$word} eq $generic_macro{$kind})
            {
              push (@have, $word);
              push (@{$needed_macros{"$generic_macro{$kind}([$word])"}},
@@ -473,23 +476,6 @@ sub output_kind ($)
 }
 
 
-
-# output_programs ()
-# ------------------
-sub output_programs ()
-{
-  print CONF "\n# Checks for programs.\n";
-  foreach my $word (sort keys %{$used{'programs'}})
-    {
-      print_unique ('programs', $word);
-    }
-  foreach my $word (sort keys %{$used{'makevars'}})
-    {
-      print_unique ('makevars', $word);
-    }
-}
-
-
 # output_libraries ()
 # -------------------
 sub output_libraries ()
@@ -503,30 +489,6 @@ sub output_libraries ()
 }
 
 
-# output_headers ()
-# -----------------
-sub output_headers ()
-{
-  output_kind ('headers');
-}
-
-
-# output_identifiers ()
-# ---------------------
-sub output_identifiers ()
-{
-  output_kind ('identifiers');
-}
-
-
-# output_functions ()
-# -------------------
-sub output_functions ()
-{
-  output_kind ('functions');
-}
-
-
 # output (CONFIGURE_SCAN)
 # -----------------------
 # Print a proto configure.ac.
@@ -549,11 +511,12 @@ sub output ($)
       print CONF "AC_CONFIG_HEADER([config.h])\n";
     }
 
-  output_programs;
+  output_kind ('programs');
+  output_kind ('makevars');
   output_libraries;
-  output_headers;
-  output_identifiers;
-  output_functions;
+  output_kind ('headers');
+  output_kind ('identifiers');
+  output_kind ('functions');
 
   # Change DIR/Makefile.in to DIR/Makefile.
   foreach my $m (@makefiles)
index eb3598cd7718f84a6bb688400bee32b45d0535c5..887640a9e7907dfaa5b153ef9833a24fddcf0193 100644 (file)
@@ -58,6 +58,7 @@ my %kind_comment =
    'functions' => 'Checks for library functions.',
    'headers' => 'Checks for header files.',
    'identifiers' => 'Checks for typedefs, structures, and compiler characteristics.',
+   'programs' => 'Checks for programs.',
   );
 
 my $configure_scan = 'configure.scan';
@@ -451,12 +452,14 @@ sub output_kind ($)
   my ($kind) = @_;
   my @have;
 
-  print CONF "\n# $kind_comment{$kind}\n";
+  print CONF "\n# $kind_comment{$kind}\n"
+    if exists $kind_comment{$kind};
   foreach my $word (sort keys %{$used{$kind}})
     {
       if (defined $macro{$kind}{$word})
        {
-         if ($macro{$kind}{$word} eq $generic_macro{$kind})
+         if (exists $generic_macro{$kind}
+             && $macro{$kind}{$word} eq $generic_macro{$kind})
            {
              push (@have, $word);
              push (@{$needed_macros{"$generic_macro{$kind}([$word])"}},
@@ -473,23 +476,6 @@ sub output_kind ($)
 }
 
 
-
-# output_programs ()
-# ------------------
-sub output_programs ()
-{
-  print CONF "\n# Checks for programs.\n";
-  foreach my $word (sort keys %{$used{'programs'}})
-    {
-      print_unique ('programs', $word);
-    }
-  foreach my $word (sort keys %{$used{'makevars'}})
-    {
-      print_unique ('makevars', $word);
-    }
-}
-
-
 # output_libraries ()
 # -------------------
 sub output_libraries ()
@@ -503,30 +489,6 @@ sub output_libraries ()
 }
 
 
-# output_headers ()
-# -----------------
-sub output_headers ()
-{
-  output_kind ('headers');
-}
-
-
-# output_identifiers ()
-# ---------------------
-sub output_identifiers ()
-{
-  output_kind ('identifiers');
-}
-
-
-# output_functions ()
-# -------------------
-sub output_functions ()
-{
-  output_kind ('functions');
-}
-
-
 # output (CONFIGURE_SCAN)
 # -----------------------
 # Print a proto configure.ac.
@@ -549,11 +511,12 @@ sub output ($)
       print CONF "AC_CONFIG_HEADER([config.h])\n";
     }
 
-  output_programs;
+  output_kind ('programs');
+  output_kind ('makevars');
   output_libraries;
-  output_headers;
-  output_identifiers;
-  output_functions;
+  output_kind ('headers');
+  output_kind ('identifiers');
+  output_kind ('functions');
 
   # Change DIR/Makefile.in to DIR/Makefile.
   foreach my $m (@makefiles)