1 dnl Copyright (c) 1995, 1996, 1997, 1999
2 dnl The Regents of the University of California. All rights reserved.
4 dnl Process this file with autoconf to produce a configure script.
10 # https://ftp.gnu.org/gnu/config/README
12 # for the URLs to use to fetch new versions of config.guess and
17 AC_INIT([tcpslice],[m4_esyscmd_s(cat VERSION)])
18 AC_CONFIG_SRCDIR(tcpslice.c)
22 AC_LBL_C_INIT_BEFORE_CC(V_INCLS)
24 # Try to enable as many C99 features as we can.
25 # At minimum, we want C++/C99-style // comments.
28 if test "$ac_cv_prog_cc_c99" = "no"; then
29 AC_MSG_WARN([The C compiler does not support C99; there may be compiler errors])
31 AC_LBL_C_INIT(V_CCOPT, V_INCLS)
33 AC_CHECK_HEADERS(fcntl.h)
36 # Try to arrange for large file support.
41 AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
43 AC_MSG_CHECKING([whether to enable the instrument functions code])
44 AC_ARG_ENABLE([instrument-functions],
45 [AS_HELP_STRING([--enable-instrument-functions],
46 [enable instrument functions code [default=no]])],
50 yes) AC_MSG_RESULT(yes)
51 AC_CHECK_LIB([bfd], [bfd_init],
54 [--enable-instrument-functions was given, but test for library libbfd failed. Please install the 'binutils-dev' package.])],
56 AC_DEFINE(ENABLE_INSTRUMENT_FUNCTIONS, 1,
57 [define if you want to build the instrument functions code])
58 LOCALSRC="$LOCALSRC instrument-functions.c"
59 # Add '-finstrument-functions' instrumentation option to generate
60 # instrumentation calls for entry and exit to functions.
61 # Try to avoid Address Space Layout Randomization (ALSR).
62 CFLAGS="$CFLAGS -O0 -ggdb -finstrument-functions -fno-stack-protector -fno-pic"
63 LDFLAGS="$LDFLAGS -O0 -ggdb -fno-stack-protector -no-pie"
70 AC_ARG_WITH([libnids],
71 AS_HELP_STRING([--without-libnids], [Do not use libnids even if present]))
73 AS_IF([test "x$with_libnids" != "xno"],
74 [AC_CHECK_LIB(nids, nids_pcap_handler,,
75 AC_MSG_WARN(Libnids not present or too old; tcpslice won't be able to track sessions!)
76 AC_MSG_WARN(Get the latest version of Libnids at http://libnids.sourceforge.net/)
79 AC_ARG_WITH([libosipparser2],
80 AS_HELP_STRING([--without-libosipparser2], [Do not use libosipparser2 even if present]))
82 AS_IF([test "x$with_libosipparser2" != "xno"],
83 [AC_CHECK_LIB(osipparser2, osip_message_parse,,
84 AC_MSG_WARN(Libosip2 not present or too old; tcpslice won't be able to track SIP calls!)
85 AC_MSG_WARN(Get the latest version of Libosip at https://www.gnu.org/software/osip/)
88 AC_ARG_WITH([libooh323c],
89 AS_HELP_STRING([--without-libooh323c], [Do not use libooh323c even if present]))
91 AS_IF([test "x$with_libooh323c" != "xno"],
92 [AC_CHECK_LIB(ooh323c, asn1PD_H225RasMessage,,
93 AC_MSG_WARN(Libooh323c not present or too old; tcpslice won't be able to track H.323 calls!)
94 AC_MSG_WARN(Get the latest version of Libooh323c at https://sourceforge.net/projects/ooh323c/)
98 # Check whether we have pcap/pcap-inttypes.h.
99 # If we do, we use that to get the C99 types defined.
101 savedcppflags="$CPPFLAGS"
102 CPPFLAGS="$CPPFLAGS $V_INCLS"
103 AC_CHECK_HEADERS(pcap/pcap-inttypes.h)
104 AC_CHECK_FUNCS(pcap_lib_version)
105 CPPFLAGS="$savedcppflags"
108 # Define the old BSD specified-width types in terms of the C99 types;
109 # we may need them with libpcap include files.
111 AC_CHECK_TYPE([u_int8_t], ,
112 [AC_DEFINE([u_int8_t], [uint8_t],
113 [Define to `uint8_t' if u_int8_t not defined.])],
115 #include <sys/types.h>
117 AC_CHECK_TYPE([u_int16_t], ,
118 [AC_DEFINE([u_int16_t], [uint16_t],
119 [Define to `uint16_t' if u_int16_t not defined.])],
121 #include <sys/types.h>
123 AC_CHECK_TYPE([u_int32_t], ,
124 [AC_DEFINE([u_int32_t], [uint32_t],
125 [Define to `uint32_t' if u_int32_t not defined.])],
127 #include <sys/types.h>
129 AC_CHECK_TYPE([u_int64_t], ,
130 [AC_DEFINE([u_int64_t], [uint64_t],
131 [Define to `uint64_t' if u_int64_t not defined.])],
133 #include <sys/types.h>
136 AC_LBL_DEVEL(V_CCOPT)
138 if test "${srcdir}" = "." ; then
152 AC_CONFIG_HEADERS([config.h])
154 AC_CONFIG_COMMANDS([.devel],[[if test -f .devel; then
155 echo timestamp > stamp-h
156 cat $srcdir/Makefile-devel-adds >> Makefile
157 make depend || exit 1
159 AC_CONFIG_FILES([Makefile])