diff options
author | Anas Nashif <anas.nashif@intel.com> | 2012-11-18 07:40:22 -0800 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2012-11-18 07:40:22 -0800 |
commit | b52ee023673f3153950b4f07b57f7ad5eb81fb7d (patch) | |
tree | ee1310ffc49229a3c82da3f681a0b5e6ef44a08f | |
parent | 3c1b160ba5b63be04cf8ea069d0ac35a6d37aff5 (diff) | |
download | autoconf213-b52ee023673f3153950b4f07b57f7ad5eb81fb7d.tar.gz autoconf213-b52ee023673f3153950b4f07b57f7ad5eb81fb7d.tar.bz2 autoconf213-b52ee023673f3153950b4f07b57f7ad5eb81fb7d.zip |
autoconf-2.13-autoscan
-rw-r--r-- | autoscan.pl | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/autoscan.pl b/autoscan.pl index 3285236..15ebf4e 100644 --- a/autoscan.pl +++ b/autoscan.pl @@ -123,14 +123,33 @@ sub init_tables # Called by &find on each file. sub wanted { - if (/^.*\.[chlymC]$/ || /^.*\.cc$/) { - $name =~ s?^\./??; push(@cfiles, $name); + # Wanted only if there is no corresponding FILE.in. + return + if -f "$_.in"; + + # Strip a useless leading `./'. + $name =~ s,^\./,,; + + if (/^.*\.[chlymC](\.in)?$/) + { + push (@cfiles, $name); + $programs{cc}++; } - elsif (/^[Mm]akefile$/ || /^[Mm]akefile\.in$/ || /^GNUmakefile$/) { - $name =~ s?^\./??; push(@makefiles, $name); + elsif (/^.*\.(cc|cpp|cxx|CC|C|hh|hpp|hxx|HH|H|yy|ypp|ll|lpp)(\.in)?$/) + { + push (@cfiles, $name); + $programs{CC}++; } - elsif (/^.*\.sh$/) { - $name =~ s?^\./??; push(@shfiles, $name); + elsif (/^[Mm]akefile(\.in)?$/ || /^GNUmakefile$/) + { + # Wanted only if there is no corresponding Makefile.in. + # Using Find, $_ contains the current filename with the current + # directory of the walk through. + push (@makefiles, $name); + } + elsif (/^.*\.sh(\.in)?$/) + { + push (@shfiles, $name); } } @@ -244,7 +263,7 @@ sub scan_makefile $libraries{$1}++; } # Tokens in the code. - while (s/\W([a-zA-Z_]\w*)\W/ /) { + while (s/\W([a-zA-Z_][\w\+\.-]*)\W/ /) { $programs{$1}++; } } |