From 5cbeddbe19f6001d540b062deb3618200c8ca372 Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Thu, 11 Jul 2013 14:34:16 +0200 Subject: configure, netsniff-ng: if no libgeopip, do not link against libz In netsniff-ng, we only use libz in combination with libgeoip, so if we lack either one of them, do not link against the other either. This would be a waste otherwise. Signed-off-by: Daniel Borkmann --- configure | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'configure') diff --git a/configure b/configure index 53b5d03..d32bdb7 100755 --- a/configure +++ b/configure @@ -15,6 +15,7 @@ TOOLS_NOBUILD="" HAVE_LIBPCAP=0 HAVE_HWTSTAMP=0 HAVE_LIBGEOIP=0 +HAVE_LIBZ=0 [ -z $CC ] && CC=cc @@ -347,12 +348,14 @@ EOF $CC -o $TMPDIR/ztest $TMPDIR/ztest.c -lz >> $TMPDIR/config.log 2>&1 if [ ! -x $TMPDIR/ztest ] ; then echo "[NO]" + echo "CONFIG_LIBZ=0" >> Config MISSING_DEFS=1 - tools_remove "netsniff-ng" tools_remove "astraceroute" tools_remove "flowtop" else echo "[YES]" + echo "CONFIG_LIBZ=1" >> Config + HAVE_LIBZ=1 fi } @@ -507,6 +510,7 @@ gen_config_hdr() local _version="`git describe --always`" local _have_libpcap="" local _have_libgeoip="" + local _have_libz="" local _have_hwts="" echo "[*] Generating config.h ... " @@ -523,6 +527,10 @@ gen_config_hdr() _have_libgeoip="#define HAVE_GEOIP 1" fi + if [ "$HAVE_LIBZ" == "1" ] ; then + _have_libz="#define HAVE_LIBZ 1" + fi + cat > config.h << EOF #ifndef CONFIG_H #define CONFIG_H @@ -534,6 +542,7 @@ gen_config_hdr() #define GITVERSION "$_version" $_have_libpcap $_have_libgeoip +$_have_libz $_have_hwts #endif /* CONFIG_H */ EOF @@ -588,6 +597,12 @@ else echo "[*] Looks good! All tools will be built!" fi +if [ "$HAVE_LIBGEOIP" == "1" -a "$HAVE_LIBZ" == "1" ] ; then + echo "CONFIG_GEOIP=1" >> Config +else + echo "CONFIG_GEOIP=0" >> Config +fi + echo "CONFIG_TOOLS=$TOOLS" >> Config echo "CONFIG_OK=1" >> Config -- cgit v1.2.3-54-g00ecf