summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-07-11 14:34:16 +0200
committerDaniel Borkmann <dborkman@redhat.com>2013-07-11 14:34:16 +0200
commit5cbeddbe19f6001d540b062deb3618200c8ca372 (patch)
treee92ebd16150361d1337af69d35c6c3a6fc09f973 /configure
parentaae407f55ffb2ce5211898559b81898af8d9d994 (diff)
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 <dborkman@redhat.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure17
1 files changed, 16 insertions, 1 deletions
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