mausezahn: use getopt_long instead of getopt
[netsniff-ng.git] / configure
blob598ae2433a7af31823351aaf7ef11bc134d61dd8
1 #!/bin/bash
2 # This isn't a configure generated by autoconf!
3 # netsniff-ng build system
4 # Copyright 2013-2016 Tobias Klauser <tklauser@distanz.ch>
5 # Copyright 2013 Daniel Borkmann <borkmann@gnumaniacs.org>
6 # Subject to the GNU GPL, version 2.
8 MISSING_TOOLCHAIN=0
9 MISSING_DEFS=0
10 MISSING_NACL=0
12 TOOLS="netsniff-ng trafgen astraceroute flowtop ifpps bpfc curvetun mausezahn"
13 TOOLS_NOBUILD=""
15 HAVE_LIBNL=0
16 HAVE_LIBPCAP=0
17 HAVE_HWTSTAMP=0
18 HAVE_LIBGEOIP=0
19 HAVE_LIBZ=0
20 HAVE_TPACKET3=0
22 DISABLE_LIBNL=0
23 DISABLE_GEOIP=0
24 DISABLE_ZLIB=0
25 ENABLE_DEBUG=0
27 PREFIX="/usr/local"
28 SYSCONF_DIR="/etc"
30 usage()
32 echo "Usage: ./configure [OPTION]... [VAR=VALUE]..."
33 echo ""
34 echo " -h, --help Display this help and exit"
35 echo ""
36 echo "Installation directories:"
37 echo " --prefix=PREFIX install architecture-independent files in PREFIX"
38 echo " [$PREFIX]"
39 echo " --sysconfdir=DIR read-only single-machine data [$SYSCONF_DIR]"
40 echo ""
41 echo "By default, \`make install' will install all the files in"
42 echo "\`$PREFIX/bin', \`$PREFIX/lib' etc. You can specify"
43 echo "an installation prefix other than \`$PREFIX' using \`--prefix',"
44 echo "for instance \`--prefix=\$HOME'."
45 echo ""
46 echo "Optional Features:"
47 echo " --disable-libnl Disable libnl support"
48 echo " --disable-geoip Disable geoip support"
49 echo " --disable-zlib Disable zlib support"
50 echo " --enable-debug Enable debug mode (default disabled)"
51 echo ""
52 echo "Some influential environment variables:"
53 echo " CC C compiler command"
54 echo " CROSS_COMPILE C cross-compiler prefix"
56 exit 0
59 while [ $# -gt 0 ] ; do
60 case "$1" in
61 -h|--help)
62 usage
64 --prefix=*)
65 PREFIX="${1#*=}"
67 --sysconfdir=*)
68 SYSCONF_DIR="${1#*=}"
70 --disable-libnl)
71 DISABLE_LIBNL=1
73 --disable-geoip)
74 DISABLE_GEOIP=1
76 --disable-zlib)
77 DISABLE_ZLIB=1
79 --enable-debug)
80 ENABLE_DEBUG=1
83 echo "[!] Unrecognized option: '$1'. Try './configure --help' for more information"
84 exit 1
86 esac
87 shift
88 done
90 [ -z "$CC" ] && CC="${CROSS_COMPILE}gcc"
91 [ -z "$LD" ] && LD="${CROSS_COMPILE}gcc"
92 if [ "x$SYSROOT" != "x" ] ; then
93 PKG_CONFIG_PATH="$SYSROOT/usr/lib/pkgconfig:$PKG_CONFIG_PATH"
95 [ -z $PKG_CONFIG ] && PKG_CONFIG="${CROSS_COMPILE}pkg-config"
97 TMPDIR=$(mktemp -d config.XXXXXX)
98 trap 'status=$?; rm -rf $TMPDIR; exit $status' EXIT HUP INT QUIT TERM
100 tools_remove()
102 local _tools=$TOOLS
103 local _todel=$1
104 TOOLS=""
105 for tool in $_tools ; do
106 case "$tool" in
107 $_todel)
108 case $_todel in
109 $TOOLS_NOBUILD) ;;
110 *) TOOLS_NOBUILD="$TOOLS_NOBUILD $tool" ;;
111 esac ;;
112 *) TOOLS="$TOOLS $tool" ;;
113 esac
114 done
116 TOOLS=${TOOLS# }
117 TOOLS_NOBUILD=${TOOLS_NOBUILD# }
120 check_command()
122 local cmd="$1"
124 [ "x$(which "$cmd" 2>> config.log)" == "x" ]
127 check_toolchain()
129 if [ "x$CROSS_COMPILE" != "x" ] ; then
130 echo "[*] Cross-compiling for $($CC -print-multiarch)"
131 echo "CROSS_COMPILE=$CROSS_COMPILE" >> Config
134 echo -n "[*] Checking compiler $CC ... "
135 if check_command $CC ; then
136 echo "[NO]"
137 MISSING_TOOLCHAIN=1
138 else
139 echo "[YES]"
140 echo "CC=$CC" >> Config
143 echo -n "[*] Checking linker $LD ... "
144 if check_command $LD ; then
145 echo "[NO]"
146 MISSING_TOOLCHAIN=1
147 else
148 echo "[YES]"
149 echo "LD=$LD" >> Config
152 echo -n "[*] Checking $PKG_CONFIG ... "
153 if check_command $PKG_CONFIG ; then
154 echo "[NO]"
155 MISSING_TOOLCHAIN=1
156 else
157 echo "[YES]"
158 echo "PKG_CONFIG=$PKG_CONFIG" >> Config
159 echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> Config
163 check_flex()
165 echo -n "[*] Checking flex ... "
167 if check_command flex ; then
168 echo "[NO]"
169 MISSING_DEFS=1
170 tools_remove "trafgen"
171 tools_remove "bpfc"
172 else
173 echo "[YES]"
177 check_bison()
179 echo -n "[*] Checking bison ... "
181 if check_command bison ; then
182 echo "[NO]"
183 MISSING_DEFS=1
184 tools_remove "trafgen"
185 tools_remove "bpfc"
186 else
187 echo "[YES]"
191 check_nacl()
193 echo -n "[*] Checking nacl/sodium ... "
195 cat > $TMPDIR/nacltest.c << EOF
196 #include "crypto_hash_sha512.h"
197 #include "crypto_verify_32.h"
198 #include "crypto_hash_sha512.h"
199 #include "crypto_box_curve25519xsalsa20poly1305.h"
200 #include "crypto_scalarmult_curve25519.h"
201 #include "crypto_auth_hmacsha512256.h"
203 int main(void) { }
206 if [ -z $NACL_INC_DIR ] ; then
207 NACL_INC_DIR=$(pkg-config --variable=includedir libsodium)
208 if [ -z $NACL_INC_DIR ] ; then
209 NACL_INC_DIR="$SYSROOT/usr/include/nacl"
210 else
211 NACL_INC_DIR="$NACL_INC_DIR/sodium"
212 NACL_LIB="sodium"
216 if [ -z $NACL_LIB_DIR ] ; then
217 NACL_LIB_DIR="$SYSROOT/usr/lib"
220 if [ -z $NACL_LIB ] ; then
221 NACL_LIB="nacl"
224 LDFLAGS="-L $NACL_LIB_DIR"
225 CFLAGS="-I $NACL_INC_DIR"
227 $CC $CFLAGS $LDFLAGS -o $TMPDIR/nacltest $TMPDIR/nacltest.c >> config.log 2>&1
228 if [ ! -x $TMPDIR/nacltest ] ; then
229 echo "[NO]"
230 MISSING_NACL=1
231 tools_remove "curvetun"
232 else
233 echo "[YES]"
234 echo "CONFIG_NACL_INC_DIR:=$NACL_INC_DIR" >> Config
235 echo "CONFIG_NACL_LIB_DIR:=$NACL_LIB_DIR" >> Config
236 echo "CONFIG_NACL_LIB:=$NACL_LIB" >> Config
240 check_libnl()
242 echo -n "[*] Checking libnl ... "
244 if [ "$DISABLE_LIBNL" == "1" ] ; then
245 echo "[DISABLED]"
246 return
249 cat > $TMPDIR/libnltest.c << EOF
250 #include <netlink/genl/genl.h>
251 #include <netlink/genl/family.h>
252 #include <netlink/genl/ctrl.h>
253 #include <netlink/msg.h>
254 #include <netlink/attr.h>
255 #include <netlink/version.h>
257 #if LIBNL_VER_NUM < LIBNL_VER(3,0)
258 # error incompatible libnl version
259 #endif
261 int main(void)
263 struct nl_sock *sock = nl_socket_alloc();
264 struct nl_cache *nl_cache;
265 int ret = genl_connect(sock);
267 ret = genl_ctrl_alloc_cache(sock, &nl_cache);
271 $CC \
272 $($PKG_CONFIG --cflags libnl-3.0 2>> config.log) \
273 $($PKG_CONFIG --cflags libnl-genl-3.0 2>> config.log) \
274 -o $TMPDIR/libnltest \
275 $TMPDIR/libnltest.c \
276 $($PKG_CONFIG --libs libnl-3.0 2>> config.log) \
277 $($PKG_CONFIG --libs libnl-genl-3.0 2>> config.log) \
278 >> config.log 2>&1
279 if [ ! -x $TMPDIR/libnltest ] ; then
280 echo "[NO]"
281 MISSING_DEFS=1
282 else
283 echo "[YES]"
284 HAVE_LIBNL=1
288 check_libnl_route()
290 echo -n "[*] Checking libnl-route ... "
292 if [ "$DISABLE_LIBNL" == "1" ] ; then
293 echo "[DISABLED]"
294 return
297 if [ "$HAVE_LIBNL" == "0" ] ; then
298 echo "[SKIPPED]"
299 return
302 cat > $TMPDIR/libnlroutetest.c << EOF
303 #include <netlink/route/link.h>
304 #include <netlink/route/addr.h>
306 int main(void)
308 char str[100];
310 rtnl_addr_flags2str(1, str, sizeof(str));
311 rtnl_link_flags2str(1, str, sizeof(str));
312 rtnl_link_operstate2str(1, str, sizeof(str));
314 return 0;
318 $CC \
319 $($PKG_CONFIG --cflags libnl-route-3.0 2>> config.log) \
320 -o $TMPDIR/libnlroutetest \
321 $TMPDIR/libnlroutetest.c \
322 $($PKG_CONFIG --libs libnl-route-3.0 2>> config.log) \
323 >> config.log 2>&1
324 if [ ! -x $TMPDIR/libnlroutetest ] ; then
325 echo "[NO]"
326 MISSING_DEFS=1
327 HAVE_LIBNL=0
328 else
329 echo "[YES]"
330 # HAVE_LIBNL already set by check_libnl()
334 check_tpacket_v3()
336 echo -n "[*] Checking tpacket_v3 ... "
338 cat > $TMPDIR/tpacketv3test.c << EOF
339 #include <stdio.h>
340 #include <linux/if_packet.h>
342 int main(void)
344 struct tpacket3_hdr *hdr;
345 int foo[] = {
346 TP_STATUS_BLK_TMO,
349 printf("%d\n", hdr->tp_status);
353 $CC -o $TMPDIR/tpacketv3test $TMPDIR/tpacketv3test.c >> config.log 2>&1
354 if [ ! -x $TMPDIR/tpacketv3test ] ; then
355 echo "[NO]"
356 MISSING_DEFS=1
357 else
358 echo "[YES]"
359 HAVE_TPACKET3=1
363 check_tpacket_v2()
365 echo -n "[*] Checking tpacket_v2 ... "
367 cat > $TMPDIR/tpacketv2test.c << EOF
368 #include <stdio.h>
369 #include <linux/if_packet.h>
371 int main(void)
373 struct tpacket2_hdr *hdr;
374 int foo[] = {
375 TP_STATUS_AVAILABLE,
376 TP_STATUS_SEND_REQUEST,
377 TP_STATUS_SENDING,
378 TP_STATUS_KERNEL,
379 TP_STATUS_USER,
382 printf("%d\n", hdr->tp_status);
386 $CC -o $TMPDIR/tpacketv2test $TMPDIR/tpacketv2test.c >> config.log 2>&1
387 if [ ! -x $TMPDIR/tpacketv2test ] ; then
388 echo "[NO]"
389 MISSING_DEFS=1
390 tools_remove "netsniff-ng"
391 tools_remove "trafgen"
392 else
393 echo "[YES]"
397 check_fopencookie()
399 echo -n "[*] Checking fopencookie ... "
401 cat > $TMPDIR/fopencookietest.c << EOF
402 #define _GNU_SOURCE
403 #include <stdio.h>
405 static cookie_io_functions_t cookie_fns;
407 int main(void)
409 FILE *f = fopencookie(NULL, "w", cookie_fns);
413 $CC -o $TMPDIR/fopencookietest $TMPDIR/fopencookietest.c >> config.log 2>&1
414 if [ ! -x $TMPDIR/fopencookietest ] ; then
415 echo "[NO]"
416 MISSING_DEFS=1
417 tools_remove "curvetun"
418 else
419 echo "[YES]"
423 check_ncurses()
425 echo -n "[*] Checking ncurses ... "
427 cat > $TMPDIR/ncursestest.c << EOF
428 #include <curses.h>
430 int main(void)
432 WINDOW *screen = initscr();
436 $CC \
437 $($PKG_CONFIG --cflags ncurses 2>> config.log) \
438 -o $TMPDIR/ncursestest $TMPDIR/ncursestest.c \
439 $($PKG_CONFIG --libs ncurses 2>> config.log \
440 || echo '-lncurses' ) \
441 >> config.log 2>&1
442 if [ ! -x $TMPDIR/ncursestest ] ; then
443 echo "[NO]"
444 MISSING_DEFS=1
445 tools_remove "flowtop"
446 tools_remove "ifpps"
447 else
448 echo "[YES]"
452 check_libgeoip()
454 echo -n "[*] Checking libGeoIP ... "
456 if [ "$DISABLE_GEOIP" == "1" ] ; then
457 echo "[DISABLED]"
458 return
461 cat > $TMPDIR/geoiptest.c << EOF
462 #include <GeoIP.h>
463 #include <GeoIPCity.h>
465 int main(void)
467 int dbs[] = {
468 GEOIP_CITY_EDITION_REV1,
469 GEOIP_CITY_EDITION_REV1_V6,
470 GEOIP_COUNTRY_EDITION,
471 GEOIP_COUNTRY_EDITION_V6,
472 GEOIP_ASNUM_EDITION,
473 GEOIP_ASNUM_EDITION_V6,
475 GeoIP *geoip = GeoIP_new(0);
479 $CC -o $TMPDIR/geoiptest $TMPDIR/geoiptest.c -lGeoIP >> config.log 2>&1
480 if [ ! -x $TMPDIR/geoiptest ] ; then
481 echo "[NO]"
482 MISSING_DEFS=1
483 else
484 echo "[YES]"
485 HAVE_LIBGEOIP=1
489 check_libnf_ct()
491 echo -n "[*] Checking libnetfilter-conntrack ... "
493 cat > $TMPDIR/nfcttest.c << EOF
494 #include <libnetfilter_conntrack/libnetfilter_conntrack.h>
495 #include <libnetfilter_conntrack/libnetfilter_conntrack_tcp.h>
496 #include <libnetfilter_conntrack/libnetfilter_conntrack_dccp.h>
497 #include <libnetfilter_conntrack/libnetfilter_conntrack_sctp.h>
499 int main(void)
501 struct nf_conntrack *ct;
502 const uint32_t id = nfct_get_attr_u32(ct, ATTR_ID);
506 $CC \
507 $($PKG_CONFIG --cflags libnetfilter_conntrack 2>> config.log) \
508 -o $TMPDIR/nfcttest \
509 $TMPDIR/nfcttest.c \
510 $($PKG_CONFIG --libs libnetfilter_conntrack 2>> config.log) \
511 >> config.log 2>&1
512 if [ ! -x $TMPDIR/nfcttest ] ; then
513 echo "[NO]"
514 MISSING_DEFS=1
515 tools_remove "flowtop"
516 else
517 echo "[YES]"
521 check_zlib()
523 echo -n "[*] Checking libz ... "
525 if [ "$DISABLE_ZLIB" == "1" ] ; then
526 echo "[DISABLED]"
527 return
530 cat > $TMPDIR/ztest.c << EOF
531 #include "zlib.h"
533 int main(void)
535 gzFile fp = gzopen("foo.gz", "rb");
539 $CC -o $TMPDIR/ztest $TMPDIR/ztest.c -lz >> config.log 2>&1
540 if [ ! -x $TMPDIR/ztest ] ; then
541 echo "[NO]"
542 echo "CONFIG_LIBZ=0" >> Config
543 MISSING_DEFS=1
544 tools_remove "astraceroute"
545 tools_remove "flowtop"
546 else
547 echo "[YES]"
548 echo "CONFIG_LIBZ=1" >> Config
549 HAVE_LIBZ=1
553 check_urcu()
555 echo -n "[*] Checking liburcu ... "
557 cat > $TMPDIR/urcutest.c << EOF
558 #include <urcu.h>
560 int main(void)
562 rcu_init();
563 synchronize_rcu();
567 $CC -o $TMPDIR/urcutest $TMPDIR/urcutest.c -lurcu >> config.log 2>&1
568 if [ ! -x $TMPDIR/urcutest ] ; then
569 echo "[NO]"
570 MISSING_DEFS=1
571 tools_remove "flowtop"
572 else
573 echo "[YES]"
577 check_libpcap()
579 echo -n "[*] Checking libpcap ... "
581 cat > $TMPDIR/pcaptest.c << EOF
582 #include <pcap.h>
584 int main(void)
586 struct bpf_program bpf;
587 int ret = pcap_compile_nopcap(65535, 1, &bpf, "foo.bpf", 1, 0xffffffff);
591 $CC -o $TMPDIR/pcaptest $TMPDIR/pcaptest.c \
592 $($PKG_CONFIG --libs libpcap 2>> config.log) \
593 >> config.log 2>&1
594 if [ ! -x $TMPDIR/pcaptest ] ; then
595 echo "[NO]"
596 echo "CONFIG_LIBPCAP=0" >> Config
597 MISSING_DEFS=1
598 tools_remove "mausezahn"
599 else
600 echo "[YES]"
601 echo "CONFIG_LIBPCAP=1" >> Config
602 HAVE_LIBPCAP=1
606 check_hwtstamp()
608 echo -n "[*] Checking hw timestamping ... "
610 cat > $TMPDIR/hwtstest.c << EOF
611 #include <string.h>
612 #include <arpa/inet.h>
613 #include <sys/ioctl.h>
614 #include <sys/types.h>
615 #include <sys/socket.h>
616 #include <linux/sockios.h>
617 #include <linux/net_tstamp.h>
618 #include <linux/if_packet.h>
619 #include <linux/if_ether.h>
620 #include <linux/if.h>
622 int main(void)
624 int timesource = SOF_TIMESTAMPING_RAW_HARDWARE, ret;
625 int sock = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
626 struct hwtstamp_config hwconfig;
627 struct ifreq ifr;
629 memset(&hwconfig, 0, sizeof(hwconfig));
630 hwconfig.tx_type = HWTSTAMP_TX_OFF;
631 hwconfig.rx_filter = HWTSTAMP_FILTER_ALL;
633 memset(&ifr, 0, sizeof(ifr));
634 strncpy(ifr.ifr_name, "lo", sizeof(ifr.ifr_name));
635 ifr.ifr_data = &hwconfig;
637 ioctl(sock, SIOCSHWTSTAMP, &ifr);
638 setsockopt(sock, SOL_PACKET, PACKET_TIMESTAMP, &timesource,
639 sizeof(timesource));
643 $CC -o $TMPDIR/hwtstest $TMPDIR/hwtstest.c >> config.log 2>&1
644 if [ ! -x $TMPDIR/hwtstest ] ; then
645 echo "[NO]"
646 echo "CONFIG_HWTSTAMP=0" >> Config
647 else
648 echo "[YES]"
649 echo "CONFIG_HWTSTAMP=1" >> Config
650 HAVE_HWTSTAMP=1
654 check_libcli()
656 echo -n "[*] Checking libcli ... "
658 cat > $TMPDIR/clitest.c << EOF
659 #include <sys/time.h>
660 #include <libcli.h>
662 int main(void)
664 struct cli_def *cli = cli_init();
668 $CC -o $TMPDIR/clitest $TMPDIR/clitest.c -lcli >> config.log 2>&1
669 if [ ! -x $TMPDIR/clitest ] ; then
670 echo "[NO]"
671 MISSING_DEFS=1
672 tools_remove "mausezahn"
673 else
674 echo "[YES]"
678 check_libnet()
680 echo -n "[*] Checking libnet ... "
682 cat > $TMPDIR/nettest.c << EOF
683 #include <libnet.h>
685 int main(void)
687 char err_buf[LIBNET_ERRBUF_SIZE];
688 libnet_t *l = libnet_init(LIBNET_LINK_ADV, "ethX", err_buf);
692 $CC -o $TMPDIR/nettest $TMPDIR/nettest.c -lnet >> config.log 2>&1
693 if [ ! -x $TMPDIR/nettest ] ; then
694 echo "[NO]"
695 MISSING_DEFS=1
696 tools_remove "mausezahn"
697 else
698 echo "[YES]"
702 gen_version_appendix()
704 local _appendix=""
706 git rev-parse > /dev/null 2>&1
707 if [ "$?" == "0" ] ; then
708 if [ ! "`git describe --always`" == \
709 "`git describe --abbrev=0 --tags`" ] ; then
710 _appendix="+"
714 echo "CONFIG_RC=\"$_appendix\"" >> Config
717 gen_config_hdr()
719 local _version=""
720 local _have_libpcap=""
721 local _have_libgeoip=""
722 local _have_libnl=""
723 local _have_libz=""
724 local _have_hwts=""
725 local _have_tp3=""
727 echo "[*] Generating config.h ..."
729 git rev-parse > /dev/null 2>&1
730 if [ "$?" == "0" ] ; then
731 _version="`git describe --always`"
732 else
733 _version="(none)"
736 if [ "$HAVE_LIBNL" == "1" ] ; then
737 _have_libnl="#define HAVE_LIBNL 1"
738 else
739 _have_libnl="/* HAVE_LIBNL is not defined */"
742 if [ "$HAVE_LIBPCAP" == "1" ] ; then
743 _have_libpcap="#define HAVE_TCPDUMP_LIKE_FILTER 1"
744 else
745 _have_libpcap="/* HAVE_TCPDUMP_LIKE_FILTER is not defined */"
748 if [ "$HAVE_HWTSTAMP" == "1" ] ; then
749 _have_hwts="#define HAVE_HARDWARE_TIMESTAMPING 1"
750 else
751 _have_hwts="/* HAVE_HARDWARE_TIMESTAMPING is not defined */"
754 if [ "$HAVE_LIBGEOIP" == "1" ] ; then
755 _have_libgeoip="#define HAVE_GEOIP 1"
756 else
757 _have_libgeoip="/* HAVE_GEOIP is not defined */"
760 if [ "$HAVE_LIBZ" == "1" ] ; then
761 _have_libz="#define HAVE_LIBZ 1"
762 else
763 _have_libz="/* HAVE_LIBZ is not defined */"
766 if [ "$HAVE_TPACKET3" == "1" ] ; then
767 _have_tp3="#define HAVE_TPACKET3 1"
768 else
769 _have_tp3="/* HAVE_TPACKET3 is not defined */"
772 cat > config.h << EOF
773 #ifndef CONFIG_H
774 #define CONFIG_H
775 #define FILE_CLIENTS ".curvetun/clients"
776 #define FILE_SERVERS ".curvetun/servers"
777 #define FILE_PRIVKEY ".curvetun/priv.key"
778 #define FILE_PUBKEY ".curvetun/pub.key"
779 #define FILE_USERNAM ".curvetun/username"
780 #define GITVERSION "$_version"
781 $_have_libnl
782 $_have_libpcap
783 $_have_libgeoip
784 $_have_libz
785 $_have_hwts
786 $_have_tp3
787 #endif /* CONFIG_H */
791 rm -f config.log
793 echo "# This file is autogenerated by the configure script" > Config
794 check_toolchain
796 if [ "$MISSING_TOOLCHAIN" == "1" ] ; then
797 echo "[!] One or more of the toolchain tools couldn't be found in your"
798 echo " \$PATH. Please check the file config.log for details."
799 exit 1
802 # external tools
803 check_flex
804 check_bison
806 # kernel features
807 check_tpacket_v2
808 check_tpacket_v3
809 check_hwtstamp
811 # libc features
812 check_fopencookie
814 # libraries
815 check_libcli
816 check_libgeoip
817 check_libnet
818 check_libnf_ct
819 check_libnl
820 check_libnl_route
821 check_libpcap
822 check_nacl
823 check_ncurses
824 check_urcu
825 check_zlib
827 gen_config_hdr
828 gen_version_appendix
830 if [ "$MISSING_DEFS" == "1" ] ; then
831 echo "[!] Some libraries or header definitions are missing or too old. Thus"
832 echo " certain tools will not be built (see below) or they will be built"
833 echo " with reduced functionality. Please refer to the INSTALL file for"
834 echo " the libraries needed to build the complete netsniff-ng toolkit"
837 if [ "$MISSING_NACL" == "1" ] ; then
838 echo "[!] The NaCl crypto library is currently not present on your system or"
839 echo " could not be found. Either install it from your distro or build it"
840 echo " manually using 'make nacl' and make sure that the NACL_INC_DIR and"
841 echo " NACL_LIB_DIR environment variables are set appropriately."
844 if [ "x$TOOLS_NOBUILD" != "x" ] ; then
845 echo "[!] The following tools will *not* be built: $TOOLS_NOBUILD"
846 echo "[*] The following tools will be built: $TOOLS"
847 else
848 echo "[*] Looks good! All tools will be built!"
851 if [ -s config.log ] ; then
852 echo "[!] There were errors in the configure script. Please check the file"
853 echo " config.log for details."
856 echo "CONFIG_LIBNL=$HAVE_LIBNL" >> Config
858 if [ "$HAVE_LIBGEOIP" == "1" -a "$HAVE_LIBZ" == "1" ] ; then
859 echo "CONFIG_GEOIP=1" >> Config
860 else
861 echo "CONFIG_GEOIP=0" >> Config
864 echo "CONFIG_PREFIX=$PREFIX" >> Config
865 echo "CONFIG_ETCDIR=$SYSCONF_DIR" >> Config
867 echo "CONFIG_DEBUG=$ENABLE_DEBUG" >> Config
868 echo "CONFIG_TOOLS=$TOOLS" >> Config
869 echo "CONFIG_OK=1" >> Config
871 exit 0