From 0b8aa3c5f07f27ce8e78733b81c1a142b99666aa Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Thu, 11 Jul 2013 12:46:53 +0200 Subject: configure, netsniff-ng: make netsniff-ng's geoip dependency optional Geoip dependency should not be mandatory as it's not a core part of netsniff-ng. This also facilitates compilation on platforms where geoip is not available. Signed-off-by: Daniel Borkmann --- configure | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'configure') diff --git a/configure b/configure index ec31bf2..53b5d03 100755 --- a/configure +++ b/configure @@ -14,6 +14,7 @@ TOOLS_NOBUILD="" HAVE_LIBPCAP=0 HAVE_HWTSTAMP=0 +HAVE_LIBGEOIP=0 [ -z $CC ] && CC=cc @@ -292,12 +293,14 @@ EOF $CC -o $TMPDIR/geoiptest $TMPDIR/geoiptest.c -lGeoIP >> $TMPDIR/config.log 2>&1 if [ ! -x $TMPDIR/geoiptest ] ; then echo "[NO]" + echo "CONFIG_LIBGEOIP=0" >> Config MISSING_DEFS=1 - tools_remove "netsniff-ng" tools_remove "astraceroute" tools_remove "flowtop" else echo "[YES]" + echo "CONFIG_LIBGEOIP=1" >> Config + HAVE_LIBGEOIP=1 fi } @@ -503,6 +506,7 @@ gen_config_hdr() { local _version="`git describe --always`" local _have_libpcap="" + local _have_libgeoip="" local _have_hwts="" echo "[*] Generating config.h ... " @@ -515,6 +519,10 @@ gen_config_hdr() _have_hwts="#define HAVE_HARDWARE_TIMESTAMPING 1" fi + if [ "$HAVE_LIBGEOIP" == "1" ] ; then + _have_libgeoip="#define HAVE_GEOIP 1" + fi + cat > config.h << EOF #ifndef CONFIG_H #define CONFIG_H @@ -525,6 +533,7 @@ gen_config_hdr() #define FILE_USERNAM ".curvetun/username" #define GITVERSION "$_version" $_have_libpcap +$_have_libgeoip $_have_hwts #endif /* CONFIG_H */ EOF -- cgit v1.2.3-54-g00ecf