mirror of
https://github.com/samba-team/samba.git
synced 2025-02-28 01:58:17 +03:00
Add script for finding unused function checks in configure.in
This commit is contained in:
parent
5c8abbcbe5
commit
7c6a261871
37
source/script/find_unused_function_checks.pl
Executable file
37
source/script/find_unused_function_checks.pl
Executable file
@ -0,0 +1,37 @@
|
||||
#!/usr/bin/perl
|
||||
# Arguments:
|
||||
# 1: configure.in
|
||||
# 2: C files
|
||||
#
|
||||
# You might want to specify configure.in again in the list of header files
|
||||
# as well, because it also uses some includes.
|
||||
# Note that this script does not process any includes, so you might
|
||||
# have to run "cat configure.in */config.m4 > foo.in" first.
|
||||
|
||||
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_CHECK_FUNCS\(([\[]*)(.*)([\]]*)\)/) {
|
||||
@hs = split / /, $2;
|
||||
foreach(@hs) {
|
||||
if($symbols{$_} != 1) { print "$_\n"; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
close IN;
|
Loading…
x
Reference in New Issue
Block a user