autoconf-patches
[Top][All Lists]
Advanced

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

FYI: autoscan: output_kind


From: Akim Demaille
Subject: FYI: autoscan: output_kind
Date: 12 Jun 2001 12:07:52 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Copyleft)

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        * autoscan.in (%kind_comment): New.
        (output_kind): New.
        (output_functions, output_identifiers, output_headers): Use it.

Index: autoscan.in
===================================================================
RCS file: /cvs/autoconf/autoscan.in,v
retrieving revision 1.50
diff -u -u -r1.50 autoscan.in
--- autoscan.in 2001/06/12 09:45:01 1.50
+++ autoscan.in 2001/06/12 10:04:28
@@ -53,6 +53,12 @@
    '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 @@
 }
 
 
+# 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_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_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_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');
 }
 
 



reply via email to

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