aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-05-07 03:56:51 -0400
committerNick Mathewson <nickm@torproject.org>2014-05-07 03:56:51 -0400
commit2e1ac274abed4127a6a30b753297166caf59feb1 (patch)
treee503d26276f63e3960dfe73e937be50aabf4c3c7
parent8a2e66b623f470f8adb9c342d8b18d207be7f361 (diff)
downloadtor-2e1ac274abed4127a6a30b753297166caf59feb1.tar
tor-2e1ac274abed4127a6a30b753297166caf59feb1.tar.gz
Script to detect unused autoconf outputs
Should help speed up mingw builds by a percent or two.
-rw-r--r--configure.ac4
-rw-r--r--scripts/README3
-rwxr-xr-xscripts/maint/check_config_macros.pl20
3 files changed, 24 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index a96a333c1..d3210921e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -437,7 +437,6 @@ AC_CHECK_FUNCS([event_get_version \
event_get_version_number \
event_get_method \
event_set_log_callback \
- evdns_set_outgoing_bind_address \
evutil_secure_rng_set_urandom_device_file \
evutil_secure_rng_init \
event_base_loopexit])
@@ -445,7 +444,7 @@ AC_CHECK_MEMBERS([struct event.min_heap_idx], , ,
[#include <event.h>
])
-AC_CHECK_HEADERS(event2/event.h event2/dns.h event2/bufferevent_ssl.h)
+AC_CHECK_HEADERS(event2/event.h event2/dns.h)
LIBS="$save_LIBS"
LDFLAGS="$save_LDFLAGS"
@@ -1235,7 +1234,6 @@ if [[ $dmalloc -eq 1 ]]; then
AC_CHECK_HEADERS(dmalloc.h, , AC_MSG_ERROR(dmalloc header file not found. Do you have the development files for dmalloc installed?))
AC_SEARCH_LIBS(dmalloc_malloc, [dmallocth dmalloc], , AC_MSG_ERROR(Libdmalloc library not found. If you enable it you better have it installed.))
AC_DEFINE(USE_DMALLOC, 1, [Debug memory allocation library])
- AC_DEFINE(DMALLOC_FUNC_CHECK, 1, [Enable dmalloc's malloc function check])
AC_CHECK_FUNCS(dmalloc_strdup dmalloc_strndup)
fi
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(<F>) {
+ 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";
+ }
+}