diff options
-rwxr-xr-x | configure | 101 |
1 files changed, 100 insertions, 1 deletions
@@ -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." |