From 2e1ac274abed4127a6a30b753297166caf59feb1 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 7 May 2014 03:56:51 -0400 Subject: Script to detect unused autoconf outputs Should help speed up mingw builds by a percent or two. --- scripts/README | 3 +++ scripts/maint/check_config_macros.pl | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100755 scripts/maint/check_config_macros.pl (limited to 'scripts') diff --git a/scripts/README b/scripts/README index f2cb5013c..70c763923 100644 --- a/scripts/README +++ b/scripts/README @@ -6,6 +6,9 @@ Code maintenance scripts maint/checkLogs.pl -- Verify that Tor log statements are unique. +maint/check_config_macros.pl -- Look for autoconf tests whose results are +never used. + maint/checkOptionDocs.pl -- Make sure that Tor options are documented in the manpage, and that the manpage only documents real Tor options. diff --git a/scripts/maint/check_config_macros.pl b/scripts/maint/check_config_macros.pl new file mode 100755 index 000000000..bcde2becc --- /dev/null +++ b/scripts/maint/check_config_macros.pl @@ -0,0 +1,20 @@ +#!/usr/bin/perl -w + +use strict; + +my @macros = (); + +open(F, 'orconfig.h.in'); +while() { + if (/^#undef +([A-Za-z0-9_]*)/) { + push @macros, $1; + } +} +close F; + +for my $m (@macros) { + my $s = `git grep '$m' src`; + if ($s eq '') { + print "Unused: $m\n"; + } +} -- cgit v1.2.3