]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* autoscan.in (&scan_makefile): Improve programs regexp to parse
authorAkim Demaille <akim@epita.fr>
Tue, 10 Jul 2001 09:16:33 +0000 (09:16 +0000)
committerAkim Demaille <akim@epita.fr>
Tue, 10 Jul 2001 09:16:33 +0000 (09:16 +0000)
things like "g++", "file.c" and "some-conf" as tokens.
(&scan_file): Match C++ files extensions.
If the filename extension is C++ then ask for c++.

ChangeLog
acprograms
autoscan.in
bin/autoscan.in
lib/autoscan/programs

index 2ae0df9c232f81c3374ff1d2adbe923798029a24..741d5313407d7562bed17c56fb5ae5ec47171d49 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2001-07-10  Jens Petersen  <petersen@redhat.com>
+
+       * autoscan.in (&scan_makefile): Improve programs regexp to parse
+       things like "g++", "file.c" and "some-conf" as tokens.
+       (&scan_file): Match C++ files extensions.
+       If the filename extension is C++ then ask for c++.
+
 2001-07-05  Steven G. Johnson  <stevenj@alum.mit.edu>
 
        * aclang.m4 (AC_F77_DUMMY_MAIN): Use AC_TRY_LINK, not
index 0a5a70a0ea0580e5cc22ff69162d64a35e67518b..d6c0163a0a9ba881ae9c6afcd60ced36bd331a7b 100644 (file)
@@ -26,6 +26,7 @@ cc            AC_PROG_CC
 gcc            AC_PROG_CC
 cpp            AC_PROG_CPP
 CC             AC_PROG_CXX
+c++            AC_PROG_CXX
 g++            AC_PROG_CXX
 install                AC_PROG_INSTALL
 lex            AC_PROG_LEX
index c65e0a866c48d85252eee3c3f822a64a53264fb8..e70528df84ac002ee28fedc5faf117cf2b248f65 100644 (file)
@@ -265,7 +265,6 @@ sub scan_c_file ($)
   my ($file) = @_;
 
   push (@cfiles, $File::Find::name);
-  push (@{$used{'programs'}{"cc"}}, $File::Find::name);
 
   # Nonzero if in a multiline comment.
   my $in_comment = 0;
@@ -346,7 +345,7 @@ sub scan_makefile ($)
          push (@{$used{'libraries'}{$1}}, "$File::Find::name:$.");
        }
       # Tokens in the code.
-      while (s/\b([a-zA-Z_]\w*)\b/ /)
+      while (s/\b([a-zA-Z_][\w\+\.-]+)/ /)
        {
          push (@{$used{'programs'}{$1}}, "$File::Find::name:$.");
        }
@@ -396,8 +395,14 @@ sub scan_file ()
   # Strip a useless leading `./'.
   $File::Find::name =~ s,^\./,,;
 
-  if (/\.[chlymC](\.in)?$/ || /\.cc(\.in)?$/)
+  if (/\.[chlym](\.in)?$/)
+    {
+      push (@{$used{'programs'}{"cc"}}, $File::Find::name);
+      scan_c_file ($_);
+    }
+  elsif (/\.(cc|cpp|cxx|CC|C|hh|hpp|hxx|HH|H|yy|ypp|ll|lpp)(\.in)?$/)
     {
+      push (@{$used{'programs'}{"c++"}}, $File::Find::name);
       scan_c_file ($_);
     }
   elsif (/^[Mm]akefile(\.in)?$/ || /^GNUmakefile(\.in)?$/)
index c65e0a866c48d85252eee3c3f822a64a53264fb8..e70528df84ac002ee28fedc5faf117cf2b248f65 100644 (file)
@@ -265,7 +265,6 @@ sub scan_c_file ($)
   my ($file) = @_;
 
   push (@cfiles, $File::Find::name);
-  push (@{$used{'programs'}{"cc"}}, $File::Find::name);
 
   # Nonzero if in a multiline comment.
   my $in_comment = 0;
@@ -346,7 +345,7 @@ sub scan_makefile ($)
          push (@{$used{'libraries'}{$1}}, "$File::Find::name:$.");
        }
       # Tokens in the code.
-      while (s/\b([a-zA-Z_]\w*)\b/ /)
+      while (s/\b([a-zA-Z_][\w\+\.-]+)/ /)
        {
          push (@{$used{'programs'}{$1}}, "$File::Find::name:$.");
        }
@@ -396,8 +395,14 @@ sub scan_file ()
   # Strip a useless leading `./'.
   $File::Find::name =~ s,^\./,,;
 
-  if (/\.[chlymC](\.in)?$/ || /\.cc(\.in)?$/)
+  if (/\.[chlym](\.in)?$/)
+    {
+      push (@{$used{'programs'}{"cc"}}, $File::Find::name);
+      scan_c_file ($_);
+    }
+  elsif (/\.(cc|cpp|cxx|CC|C|hh|hpp|hxx|HH|H|yy|ypp|ll|lpp)(\.in)?$/)
     {
+      push (@{$used{'programs'}{"c++"}}, $File::Find::name);
       scan_c_file ($_);
     }
   elsif (/^[Mm]akefile(\.in)?$/ || /^GNUmakefile(\.in)?$/)
index 0a5a70a0ea0580e5cc22ff69162d64a35e67518b..d6c0163a0a9ba881ae9c6afcd60ced36bd331a7b 100644 (file)
@@ -26,6 +26,7 @@ cc            AC_PROG_CC
 gcc            AC_PROG_CC
 cpp            AC_PROG_CPP
 CC             AC_PROG_CXX
+c++            AC_PROG_CXX
 g++            AC_PROG_CXX
 install                AC_PROG_INSTALL
 lex            AC_PROG_LEX