summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2013-06-24 23:01:41 +0200
committerTobias Klauser <tklauser@distanz.ch>2013-06-24 23:01:41 +0200
commit53d360c9f608103f95b9a2a74f64c9c494ff2333 (patch)
tree44b9ca0eca6a6f67924ef1e547676fdb167c3f77 /configure
parent2e59bad182649c3ac3e66b970bc8b0f2fef8c906 (diff)
configure: Check for tpacket, ncurses, libgeoip
Check for some more libraries we make use of in the configure step. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure101
1 files changed, 100 insertions, 1 deletions
diff --git a/configure b/configure
index fd690ed..d977b37 100755
--- a/configure
+++ b/configure
@@ -63,7 +63,7 @@ check_libnl()
# error incompatible libnl version
#endif
-int main(void) { }
+void main(void) { }
EOF
$CC $(pkg-config --cflags libnl-3.0) -o $TMPDIR/libnltest $TMPDIR/libnltest.c >> $TMPDIR/config.log 2>&1
@@ -75,9 +75,108 @@ EOF
fi
}
+check_tpacket()
+{
+ echo -n "[*] Checking tpacket ... "
+
+ cat > $TMPDIR/tpackettest.c << EOF
+#include <stdio.h>
+#include <linux/if_packet.h>
+
+struct tpacket3_hdr *hdr;
+
+void main(void)
+{
+ printf("%d\n", hdr->tp_status);
+}
+EOF
+
+ $CC -o $TMPDIR/tpackettest $TMPDIR/tpackettest.c >> $TMPDIR/config.log 2>&1
+ if [ ! -x $TMPDIR/tpackettest ] ; then
+ echo "[NO]"
+ MISSING_DEFS=1
+ else
+ echo "[YES]"
+ fi
+}
+
+check_ncurses()
+{
+ echo -n "[*] Checking ncurses ... "
+
+ cat > $TMPDIR/ncursestest.c << EOF
+#include <curses.h>
+
+void main(void)
+{
+ WINDOW *screen = initscr();
+}
+EOF
+
+ $CC $(pkg-config --cflags --libs ncurses) -o $TMPDIR/ncursestest $TMPDIR/ncursestest.c >> $TMPDIR/config.log 2>&1
+ if [ ! -x $TMPDIR/ncursestest ] ; then
+ echo "[NO]"
+ MISSING_DEFS=1
+ else
+ echo "[YES]"
+ fi
+}
+
+check_libgeoip()
+{
+ echo -n "[*] Checking libGeoIP ... "
+
+ cat > $TMPDIR/geoiptest.c << EOF
+#include <GeoIP.h>
+#include <GeoIPCity.h>
+
+void main(void)
+{
+ GeoIP *geoip;
+}
+EOF
+
+ $CC -o $TMPDIR/geoiptest $TMPDIR/geoiptest.c >> $TMPDIR/config.log 2>&1
+ if [ ! -x $TMPDIR/geoiptest ] ; then
+ echo "[NO]"
+ MISSING_DEFS=1
+ else
+ echo "[YES]"
+ fi
+
+}
+
+check_libnf_ct()
+{
+ echo -n "[*] Checking libnetfilter-conntrack ... "
+
+ cat > $TMPDIR/nfcttest.c << EOF
+#include <libnetfilter_conntrack/libnetfilter_conntrack.h>
+#include <libnetfilter_conntrack/libnetfilter_conntrack_tcp.h>
+#include <libnetfilter_conntrack/libnetfilter_conntrack_dccp.h>
+#include <libnetfilter_conntrack/libnetfilter_conntrack_sctp.h>
+
+void main(void)
+{
+ struct nfconntrack *ct;
+}
+EOF
+
+ $CC -o $TMPDIR/nfcttest $TMPDIR/nfcttest.c >> $TMPDIR/config.log 2>&1
+ if [ ! -x $TMPDIR/nfcttest ] ; then
+ echo "[NO]"
+ MISSING_DEFS=1
+ else
+ echo "[YES]"
+ fi
+
+}
echo "# This file is autogenerated by the configure script" > Config
check_nacl
check_libnl
+check_tpacket
+check_ncurses
+check_libgeoip
if [ "$MISSING_DEFS" == "1" ] ; then
echo "[!] Some libraries or header definitions are missing or too old."