1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

Add script that detects useless AC_DEFINE()'s in configure.in

(This used to be commit 37f55d8619b110d217ec826bcf2773849ed0f7f7)
This commit is contained in:
Jelmer Vernooij 2003-08-16 02:24:33 +00:00
parent 4809559c64
commit d9aa5b15d3

View File

@ -0,0 +1,30 @@
#!/usr/bin/perl
# Script that reads in configure and outputs the names of all the defines
# it defines that are used nowhere in the code
# Arguments:
# 1: configure.in
# 2: C files pattern
my %symbols;
# First, make a list of defines in configure
$in = shift;
while($tmp = shift) {
open(FI, $tmp);
while(<FI>) {
while(/([A-Za-z0-9_]+)/sgm) {
$symbols{$1} = 1;
}
}
close FI;
}
open(IN, $in) or die("Can't open $in");
while(<IN>) {
if(/AC_DEFINE\(([^,]+),/ and $symbols{$1} != 1) { print "$1\n"; }
}
close IN;