summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-07-11 12:46:53 +0200
committerDaniel Borkmann <dborkman@redhat.com>2013-07-11 12:46:53 +0200
commit0b8aa3c5f07f27ce8e78733b81c1a142b99666aa (patch)
tree9da8a371fedb22dc07ee69ae7e7547214c541edc /configure
parente0e8ae1e85f3a835f6bc0e6ff686b2d662b22d77 (diff)
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 <dborkman@redhat.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure11
1 files changed, 10 insertions, 1 deletions
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