summaryrefslogtreecommitdiff
path: root/source4/script/find_unused_makefilevars.pl
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-10-21 14:51:13 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-10-21 14:51:13 +0200
commit5209a846a9157e649fcdcb561f7eaf19c8c0e465 (patch)
treeb0a7e52b5646c8eec182dbc391e7934b6804488c /source4/script/find_unused_makefilevars.pl
parent625359b2e266105022309df8985720108ecd6f67 (diff)
parent2ee8d29d22bcb1c350ab59d71b0aee548489bc9c (diff)
downloadsamba-5209a846a9157e649fcdcb561f7eaf19c8c0e465.tar.gz
samba-5209a846a9157e649fcdcb561f7eaf19c8c0e465.tar.bz2
samba-5209a846a9157e649fcdcb561f7eaf19c8c0e465.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba into regsrv
Conflicts: source4/lib/registry/ldb.c source4/rpc_server/winreg/rpc_winreg.c
Diffstat (limited to 'source4/script/find_unused_makefilevars.pl')
-rwxr-xr-xsource4/script/find_unused_makefilevars.pl27
1 files changed, 18 insertions, 9 deletions
diff --git a/source4/script/find_unused_makefilevars.pl b/source4/script/find_unused_makefilevars.pl
index 1bed1228ec..23fc36ef6a 100755
--- a/source4/script/find_unused_makefilevars.pl
+++ b/source4/script/find_unused_makefilevars.pl
@@ -13,17 +13,26 @@ my %defines;
# First, make a list of defines in configure
$in = shift;
-open(IN, $in);
-while(<IN>) {
- my $line = $_;
- while($line =~ /^\b([a-zA-Z0-9_][a-zA-Z0-9_]*)\b[ \t]*=.*/sgm) {
- $defines{$1} = 1;
- }
- while($line =~ /\$\(([a-zA-Z0-9_][a-zA-Z0-9_]*)\)/sgm) {
- $references{$1} = 1;
+sub process_file($)
+{
+ my ($fn) = @_;
+ open(IN, $fn);
+ while(<IN>) {
+ my $line = $_;
+ while($line =~ /^\b([a-zA-Z0-9_][a-zA-Z0-9_]*)\b[ \t]*=.*/sgm) {
+ $defines{$1} = 1;
+ }
+ while($line =~ /\$\(([a-zA-Z0-9_][a-zA-Z0-9_]*)\)/sgm) {
+ $references{$1} = 1;
+ }
+ while ($line =~ /^include (.*)/sgm) {
+ process_file($1);
+ }
}
+ close IN;
}
-close IN;
+
+process_file($in);
print "##### DEFINED BUT UNUSED: #####\n";
foreach(%defines) {