diff --git a/ChangeLog b/ChangeLog index 2ae0df9c..741d5313 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-07-10 Jens Petersen + + * 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 * aclang.m4 (AC_F77_DUMMY_MAIN): Use AC_TRY_LINK, not diff --git a/acprograms b/acprograms index 0a5a70a0..d6c0163a 100644 --- a/acprograms +++ b/acprograms @@ -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 diff --git a/autoscan.in b/autoscan.in index c65e0a86..e70528df 100644 --- a/autoscan.in +++ b/autoscan.in @@ -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)?$/) diff --git a/bin/autoscan.in b/bin/autoscan.in index c65e0a86..e70528df 100644 --- a/bin/autoscan.in +++ b/bin/autoscan.in @@ -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)?$/) diff --git a/lib/autoscan/programs b/lib/autoscan/programs index 0a5a70a0..d6c0163a 100644 --- a/lib/autoscan/programs +++ b/lib/autoscan/programs @@ -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