From 7c6a261871d2b44fe6eccfda7cb4f3c558dbf5e3 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 13 Jan 2004 22:22:43 +0000 Subject: [PATCH] Add script for finding unused function checks in configure.in --- source/script/find_unused_function_checks.pl | 37 ++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 source/script/find_unused_function_checks.pl diff --git a/source/script/find_unused_function_checks.pl b/source/script/find_unused_function_checks.pl new file mode 100755 index 00000000000..4704e907f83 --- /dev/null +++ b/source/script/find_unused_function_checks.pl @@ -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() { + while(/([A-Za-z0-9_]+)/sgm) { + $symbols{$1} = 1; + } + } + close FI; +} + +open(IN, $in) or die("Can't open $in"); + +while() { + if(/AC_CHECK_FUNCS\(([\[]*)(.*)([\]]*)\)/) { + @hs = split / /, $2; + foreach(@hs) { + if($symbols{$_} != 1) { print "$_\n"; } + } + } +} + +close IN; -- 2.34.1