2 # This isn't a configure generated by autoconf!
9 TMPDIR
=$
(mktemp
-d config.XXXXXX
)
10 trap 'status=$?; rm -rf $TMPDIR; exit $status' EXIT HUP INT QUIT TERM
14 echo -n "[*] Checking nacl ... "
16 cat > $TMPDIR/nacltest.c
<< EOF
17 #include "crypto_hash_sha512.h"
18 #include "crypto_verify_32.h"
19 #include "crypto_hash_sha512.h"
20 #include "crypto_box_curve25519xsalsa20poly1305.h"
21 #include "crypto_scalarmult_curve25519.h"
22 #include "crypto_auth_hmacsha512256.h"
27 if [ -z $NACL_INC_DIR ] ; then
28 NACL_INC_DIR
="/usr/include/nacl"
31 if [ -z $NACL_LIB_DIR ] ; then
32 NACL_LIB_DIR
="/usr/lib"
35 LDFLAGS
="-L $NACL_LIB_DIR"
36 CFLAGS
="-I $NACL_INC_DIR"
38 $CC $CFLAGS $LDFLAGS -o $TMPDIR/nacltest
$TMPDIR/nacltest.c
>> $TMPDIR/config.log
2>&1
39 if [ ! -x $TMPDIR/nacltest
] ; then
44 echo "CONFIG_NACL_INC_DIR:=$NACL_INC_DIR" >> Config
45 echo "CONFIG_NACL_LIB_DIR:=$NACL_LIB_DIR" >> Config
52 echo -n "[*] Checking libnl ... "
54 cat > $TMPDIR/libnltest.c
<< EOF
55 #include <libnl3/netlink/genl/genl.h>
56 #include <libnl3/netlink/genl/family.h>
57 #include <libnl3/netlink/genl/ctrl.h>
58 #include <libnl3/netlink/msg.h>
59 #include <libnl3/netlink/attr.h>
60 #include <libnl3/netlink/version.h>
62 #if LIBNL_VER_NUM < LIBNL_VER(3,0)
63 # error incompatible libnl version
69 $CC $
(pkg-config
--cflags libnl-3.0
) -o $TMPDIR/libnltest
$TMPDIR/libnltest.c
>> $TMPDIR/config.log
2>&1
70 if [ ! -x $TMPDIR/libnltest
] ; then
80 echo -n "[*] Checking tpacket ... "
82 cat > $TMPDIR/tpackettest.c
<< EOF
84 #include <linux/if_packet.h>
86 struct tpacket3_hdr *hdr;
90 printf("%d\n", hdr->tp_status);
94 $CC -o $TMPDIR/tpackettest
$TMPDIR/tpackettest.c
>> $TMPDIR/config.log
2>&1
95 if [ ! -x $TMPDIR/tpackettest
] ; then
105 echo -n "[*] Checking ncurses ... "
107 cat > $TMPDIR/ncursestest.c
<< EOF
112 WINDOW *screen = initscr();
116 $CC $
(pkg-config
--cflags ncurses
) -o $TMPDIR/ncursestest
$TMPDIR/ncursestest.c $
(pkg-config
--libs ncurses
) >> $TMPDIR/config.log
2>&1
117 if [ ! -x $TMPDIR/ncursestest
] ; then
127 echo -n "[*] Checking libGeoIP ... "
129 cat > $TMPDIR/geoiptest.c
<< EOF
131 #include <GeoIPCity.h>
139 $CC -o $TMPDIR/geoiptest
$TMPDIR/geoiptest.c
>> $TMPDIR/config.log
2>&1
140 if [ ! -x $TMPDIR/geoiptest
] ; then
151 echo -n "[*] Checking libnetfilter-conntrack ... "
153 cat > $TMPDIR/nfcttest.c
<< EOF
154 #include <libnetfilter_conntrack/libnetfilter_conntrack.h>
155 #include <libnetfilter_conntrack/libnetfilter_conntrack_tcp.h>
156 #include <libnetfilter_conntrack/libnetfilter_conntrack_dccp.h>
157 #include <libnetfilter_conntrack/libnetfilter_conntrack_sctp.h>
161 struct nfconntrack *ct;
165 $CC -o $TMPDIR/nfcttest
$TMPDIR/nfcttest.c
>> $TMPDIR/config.log
2>&1
166 if [ ! -x $TMPDIR/nfcttest
] ; then
174 echo "# This file is autogenerated by the configure script" > Config
181 if [ "$MISSING_DEFS" == "1" ] ; then
182 echo "[!] Some libraries or header definitions are missing or too old."
183 echo " Please refer to the INSTALL file for the libraries needed to"
184 echo " build netsniff-ng."
188 if [ "$MISSING_NACL" == "1" ] ; then
189 echo "[!] The NaCl crypto library is currently not present on your"
190 echo " system or could not be found. Either install it from your"
191 echo " distro or build it manually using 'make nacl' and make sure"
192 echo " that the NACL_INC_DIR and NACL_LIB_DIR variables are set"
193 echo " appropriately."