2 # This isn't a configure generated by autoconf!
10 TMPDIR
=$
(mktemp
-d config.XXXXXX
)
11 trap 'status=$?; rm -rf $TMPDIR; exit $status' EXIT HUP INT QUIT TERM
15 echo -n "[*] Checking pkg-config ... "
17 if [ "x$(which pkg-config)" == "x" ] ; then
27 echo -n "[*] Checking ccache ... "
29 if [ "x$(which ccache)" == "x" ] ; then
31 echo "CONFIG_CCACHE=" >> Config
34 echo "CONFIG_CCACHE=ccache" >> Config
40 echo -n "[*] Checking nacl ... "
42 cat > $TMPDIR/nacltest.c
<< EOF
43 #include "crypto_hash_sha512.h"
44 #include "crypto_verify_32.h"
45 #include "crypto_hash_sha512.h"
46 #include "crypto_box_curve25519xsalsa20poly1305.h"
47 #include "crypto_scalarmult_curve25519.h"
48 #include "crypto_auth_hmacsha512256.h"
53 if [ -z $NACL_INC_DIR ] ; then
54 NACL_INC_DIR
="/usr/include/nacl"
57 if [ -z $NACL_LIB_DIR ] ; then
58 NACL_LIB_DIR
="/usr/lib"
61 LDFLAGS
="-L $NACL_LIB_DIR"
62 CFLAGS
="-I $NACL_INC_DIR"
64 $CC $CFLAGS $LDFLAGS -o $TMPDIR/nacltest
$TMPDIR/nacltest.c
>> $TMPDIR/config.log
2>&1
65 if [ ! -x $TMPDIR/nacltest
] ; then
70 echo "CONFIG_NACL_INC_DIR:=$NACL_INC_DIR" >> Config
71 echo "CONFIG_NACL_LIB_DIR:=$NACL_LIB_DIR" >> Config
78 echo -n "[*] Checking libnl ... "
80 cat > $TMPDIR/libnltest.c
<< EOF
81 #include <libnl3/netlink/genl/genl.h>
82 #include <libnl3/netlink/genl/family.h>
83 #include <libnl3/netlink/genl/ctrl.h>
84 #include <libnl3/netlink/msg.h>
85 #include <libnl3/netlink/attr.h>
86 #include <libnl3/netlink/version.h>
88 #if LIBNL_VER_NUM < LIBNL_VER(3,0)
89 # error incompatible libnl version
94 struct nl_sock *sock = nl_socket_alloc();
95 struct nl_cache *nl_cache;
96 int ret = genl_connect(sock);
98 ret = genl_ctrl_alloc_cache(sock, &nl_cache);
103 $
(pkg-config
--cflags libnl-3.0
2>&1 > /dev
/null
) \
104 $
(pkg-config
--cflags libnl-genl-3.0
2>&1 > /dev
/null
) \
105 -o $TMPDIR/libnltest \
106 $TMPDIR/libnltest.c \
107 $
(pkg-config
--libs libnl-3.0
2>&1 > /dev
/null
) \
108 $
(pkg-config
--libs libnl-genl-3.0
2>&1 > /dev
/null
) \
109 >> $TMPDIR/config.log
2>&1
110 if [ ! -x $TMPDIR/libnltest
] ; then
120 echo -n "[*] Checking tpacket ... "
122 cat > $TMPDIR/tpackettest.c
<< EOF
124 #include <linux/if_packet.h>
126 struct tpacket3_hdr *hdr;
130 printf("%d\n", hdr->tp_status);
134 $CC -o $TMPDIR/tpackettest
$TMPDIR/tpackettest.c
>> $TMPDIR/config.log
2>&1
135 if [ ! -x $TMPDIR/tpackettest
] ; then
145 echo -n "[*] Checking ncurses ... "
147 cat > $TMPDIR/ncursestest.c
<< EOF
152 WINDOW *screen = initscr();
157 $
(pkg-config
--cflags ncurses
2>&1 > /dev
/null
) \
158 -o $TMPDIR/ncursestest
$TMPDIR/ncursestest.c \
159 $
(pkg-config
--libs ncurses
2>&1 > /dev
/null
) \
160 >> $TMPDIR/config.log
2>&1
161 if [ ! -x $TMPDIR/ncursestest
] ; then
171 echo -n "[*] Checking libGeoIP ... "
173 cat > $TMPDIR/geoiptest.c
<< EOF
175 #include <GeoIPCity.h>
183 $CC -o $TMPDIR/geoiptest
$TMPDIR/geoiptest.c
>> $TMPDIR/config.log
2>&1
184 if [ ! -x $TMPDIR/geoiptest
] ; then
195 echo -n "[*] Checking libnetfilter-conntrack ... "
197 cat > $TMPDIR/nfcttest.c
<< EOF
198 #include <libnetfilter_conntrack/libnetfilter_conntrack.h>
199 #include <libnetfilter_conntrack/libnetfilter_conntrack_tcp.h>
200 #include <libnetfilter_conntrack/libnetfilter_conntrack_dccp.h>
201 #include <libnetfilter_conntrack/libnetfilter_conntrack_sctp.h>
205 struct nfconntrack *ct;
209 $CC -o $TMPDIR/nfcttest
$TMPDIR/nfcttest.c
>> $TMPDIR/config.log
2>&1
210 if [ ! -x $TMPDIR/nfcttest
] ; then
218 echo "# This file is autogenerated by the configure script" > Config
221 if [ "$MISSING_PKG_CONFIG" == "1" ] ; then
222 echo "[!] pkg-config is not installed on your system or not in the PATH"
233 if [ "$MISSING_DEFS" == "1" ] ; then
234 echo "[!] Some libraries or header definitions are missing or too old."
235 echo " Please refer to the INSTALL file for the libraries needed to"
236 echo " build netsniff-ng."
240 if [ "$MISSING_NACL" == "1" ] ; then
241 echo "[!] The NaCl crypto library is currently not present on your"
242 echo " system or could not be found. Either install it from your"
243 echo " distro or build it manually using 'make nacl' and make sure"
244 echo " that the NACL_INC_DIR and NACL_LIB_DIR variables are set"
245 echo " appropriately."
249 echo "CONFIG_OK=1" >> Config