configure.ac (tcpflow-1.5.0) | : | configure.ac (tcpflow-1.6.1) | ||
---|---|---|---|---|
# -*- Autoconf -*- | # -*- Autoconf -*- | |||
# tcpflow configure.ac | # tcpflow configure.ac | |||
# | # | |||
# Process this file with autoconf to produce a configure script. | # Process this file with autoconf to produce a configure script. | |||
# Order is largely irrevellant, although it must start with AC_INIT and end with AC_OUTPUT | # Order is largely irrevellant, although it must start with AC_INIT and end with AC_OUTPUT | |||
# See http://autotoolset.sourceforge.net/tutorial.html | # See http://autotoolset.sourceforge.net/tutorial.html | |||
# and http://www.openismus.com/documents/linux/automake/automake.shtml | # and http://www.openismus.com/documents/linux/automake/automake.shtml | |||
AC_PREREQ(2.57) | AC_PREREQ(2.57) | |||
AC_INIT(TCPFLOW, 1.5.0, simsong@acm.org) | AC_INIT(TCPFLOW, 1.6.1, simsong@acm.org) | |||
AC_CONFIG_MACRO_DIR([m4]) | AC_CONFIG_MACRO_DIR([m4]) | |||
AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile doc/Makefile]) | AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile doc/Makefile]) | |||
AC_CONFIG_FILES([doc/tcpflow.1]) | AC_CONFIG_FILES([doc/tcpflow.1]) | |||
AC_CONFIG_FILES([tcpflow.spec]) | AC_CONFIG_FILES([tcpflow.spec]) | |||
AC_CONFIG_HEADER([config.h]) | AC_CONFIG_HEADER([config.h]) | |||
# https://stackoverflow.com/questions/15013672/use-autotools-with-readme-md | # https://stackoverflow.com/questions/15013672/use-autotools-with-readme-md | |||
AM_INIT_AUTOMAKE([foreign]) | AM_INIT_AUTOMAKE([foreign]) | |||
AM_MAINTAINER_MODE | AM_MAINTAINER_MODE | |||
skipping to change at line 35 | skipping to change at line 35 | |||
# Programs we will be using | # Programs we will be using | |||
AC_PROG_CC | AC_PROG_CC | |||
AC_PROG_CXX | AC_PROG_CXX | |||
AM_PROG_CC_C_O dnl allow per-product flags | AM_PROG_CC_C_O dnl allow per-product flags | |||
AC_PROG_INSTALL | AC_PROG_INSTALL | |||
m4_include([m4/slg_searchdirs.m4]) | m4_include([m4/slg_searchdirs.m4]) | |||
m4_include([m4/slg_gcc_all_warnings.m4]) | m4_include([m4/slg_gcc_all_warnings.m4]) | |||
# use C++11 mode if available; HAVE_CXX11 is defined in config.h if so. Don't | # Must use C++17 mode. (mandatory) | |||
# use the GNU C++11 extensions for portability's sake (noext). | ||||
AC_LANG_PUSH(C++) | AC_LANG_PUSH(C++) | |||
AX_CXX_COMPILE_STDCXX_11(noext, optional) | AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory]) | |||
AC_LANG_POP() | AC_LANG_POP() | |||
################################################################ | ################################################################ | |||
## See if we are running on mingw | ## See if we are running on mingw | |||
# http://osdir.com/ml/gnu.mingw.devel/2003-09/msg00040.html | # http://osdir.com/ml/gnu.mingw.devel/2003-09/msg00040.html | |||
# Note: Windows 95 WINVER=0x400 | # Note: Windows 95 WINVER=0x400 | |||
# Windows 98 WINVER=0x400 _WIN32_WINDOWS=0x0410 | # Windows 98 WINVER=0x400 _WIN32_WINDOWS=0x0410 | |||
# Windows Me WINVER=0x400 _WIN32_WINDOWS=0x0490 | # Windows Me WINVER=0x400 _WIN32_WINDOWS=0x0490 | |||
# Windows NT 4.0 WINVER=0x0400 _WIN32_WINNT=0x0400 | # Windows NT 4.0 WINVER=0x0400 _WIN32_WINNT=0x0400 | |||
# Windows NT 4.0 SP3 WINVER=0x0400 _WIN32_WINNT=0x0403 | # Windows NT 4.0 SP3 WINVER=0x0400 _WIN32_WINNT=0x0403 | |||
skipping to change at line 71 | skipping to change at line 70 | |||
*-*-mingw32*) | *-*-mingw32*) | |||
LIBS="-lpsapi -lws2_32 -lgdi32 $LIBS" | LIBS="-lpsapi -lws2_32 -lgdi32 $LIBS" | |||
CPPFLAGS="-DUNICODE -D_UNICODE -D__MSVCRT_VERSION__=0x0601 -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -g $CPPFLAGS" | CPPFLAGS="-DUNICODE -D_UNICODE -D__MSVCRT_VERSION__=0x0601 -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -g $CPPFLAGS" | |||
CPPFLAGS="$CPPFLAGS --static" | CPPFLAGS="$CPPFLAGS --static" | |||
CFLAGS="$CFLAGS --static -static-libgcc -static-libstdc++" | CFLAGS="$CFLAGS --static -static-libgcc -static-libstdc++" | |||
CXXFLAGS="$CXXFLAGS -Wno-format " # compiler mingw-4.3.0 is broken on I64u formats | CXXFLAGS="$CXXFLAGS -Wno-format " # compiler mingw-4.3.0 is broken on I64u formats | |||
CXXFLAGS="$CXXFLAGS --static -static-libgcc -static-libstdc++" | CXXFLAGS="$CXXFLAGS --static -static-libgcc -static-libstdc++" | |||
LDFLAGS="$LDFLAGS --static" | LDFLAGS="$LDFLAGS --static" | |||
mingw="yes" | mingw="yes" | |||
;; | ;; | |||
*) | ||||
CXXFLAGS="$CXXFLAGS -Wno-address-of-packed-member" | ||||
;; | ||||
esac | esac | |||
if test x"${mingw}" == "xno" ; then | if test x"${mingw}" == "xno" ; then | |||
# Bring additional directories where things might be found into our | # Bring additional directories where things might be found into our | |||
# search path. I don't know why autoconf doesn't do this by default | # search path. I don't know why autoconf doesn't do this by default | |||
for spfx in /usr/local /opt/local /sw /usr/local/ssl /usr/boost/include ; do | for spfx in /usr/local /opt/local /sw /usr/local/ssl /usr/boost/include ; do | |||
AC_MSG_NOTICE([checking ${spfx}/include]) | AC_MSG_NOTICE([checking ${spfx}/include]) | |||
if test -d ${spfx}/include; then | if test -d ${spfx}/include; then | |||
CPPFLAGS="-I${spfx}/include $CPPFLAGS" | CPPFLAGS="-I${spfx}/include $CPPFLAGS" | |||
LDFLAGS="-L${spfx}/lib $LDFLAGS" | LDFLAGS="-L${spfx}/lib $LDFLAGS" | |||
skipping to change at line 141 | skipping to change at line 144 | |||
AC_MSG_RESULT($has_option) | AC_MSG_RESULT($has_option) | |||
unset has_option | unset has_option | |||
unset SAVE_CFLAGS | unset SAVE_CFLAGS | |||
if test $option = "-Wmissing-format-attribute" ; then | if test $option = "-Wmissing-format-attribute" ; then | |||
AC_DEFINE(HAVE_MISSING_FORMAT_ATTRIBUTE_WARNING,1, | AC_DEFINE(HAVE_MISSING_FORMAT_ATTRIBUTE_WARNING,1, | |||
[Indicates that we have the -Wmissing-format-attribute G++ warnin g]) | [Indicates that we have the -Wmissing-format-attribute G++ warnin g]) | |||
fi | fi | |||
done | done | |||
unset option | unset option | |||
# C++ | # CUT1 | |||
# We don't use these warnings: | ||||
# -Waggregate-return -- aggregate returns are GOOD; they simplify code design | ||||
# We can use these warnings after ZLIB gets upgraded: | ||||
# -Wundef --- causes problems with zlib | ||||
# -Wcast-qual | ||||
# -Wmissing-format-attribute --- Just too annoying | ||||
AC_LANG_PUSH(C++) | ||||
WARNINGS_TO_TEST="-Wall -MD -D_FORTIFY_SOURCE=2 -Wpointer-arith \ | ||||
-Wshadow -Wwrite-strings -Wcast-align \ | ||||
-Wredundant-decls -Wdisabled-optimization \ | ||||
-Wfloat-equal -Wmultichar -Wmissing-noreturn \ | ||||
-Woverloaded-virtual -Wsign-promo \ | ||||
-funit-at-a-time" | ||||
if $CXX -dM -E - < /dev/null | grep -q __clang__ ; then | ||||
AC_MSG_RESULT([Using clang]) | ||||
clang='yes' | ||||
else | ||||
AC_MSG_RESULT([not using clang]) | ||||
clang='no' | ||||
# -Wstrict-null-sentinel is not supported under clang or under Darwin's gcc | ||||
WARNINGS_TO_TEST="$WARNINGS_TO_TEST -Wstrict-null-sentinel" | ||||
fi | ||||
if test $mingw = "no" ; then | ||||
# add the warnings we don't want to do on mingw | ||||
WARNINGS_TO_TEST="$WARNINGS_TO_TEST -Weffc++" | ||||
fi | ||||
for option in $WARNINGS_TO_TEST | ||||
do | ||||
SAVE_CXXFLAGS="$CXXFLAGS" | ||||
CXXFLAGS="$CXXFLAGS $option" | ||||
AC_MSG_CHECKING([whether g++ understands $option]) | ||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], | ||||
[has_option=yes], | ||||
[has_option=no; CXXFLAGS="$SAVE_CXXFLAGS"]) | ||||
AC_MSG_RESULT($has_option) | ||||
unset has_option | ||||
unset SAVE_CXXFLAGS | ||||
done | ||||
unset option | ||||
AC_LANG_POP() | ||||
################################################################ | ################################################################ | |||
## | ## | |||
# | # | |||
# ZLIB is required for decompressing | # ZLIB is required for decompressing | |||
# Note you cannot put comments in the AC_MSG_ERROR for some reason | # Note you cannot put comments in the AC_MSG_ERROR for some reason | |||
AC_CHECK_LIB([z],[uncompress],, | AC_CHECK_LIB([z],[uncompress],, | |||
AC_MSG_ERROR([zlib libraries not installed; try installing zlib-dev zlib-devel zlib1g-dev or libz-dev])) | AC_MSG_ERROR([zlib libraries not installed; try installing zlib-dev zlib-devel zlib1g-dev or libz-dev])) | |||
AC_CHECK_HEADERS([zlib.h]) | AC_CHECK_HEADERS([zlib.h]) | |||
skipping to change at line 208 | skipping to change at line 167 | |||
## there are several options | ## there are several options | |||
## tre is better than regex | ## tre is better than regex | |||
AC_CHECK_HEADER([lightgrep/api.h]) | AC_CHECK_HEADER([lightgrep/api.h]) | |||
AC_CHECK_LIB([lightgrep], [lg_create_pattern]) | AC_CHECK_LIB([lightgrep], [lg_create_pattern]) | |||
AC_CHECK_HEADERS([regex.h tre/tre.h]) | AC_CHECK_HEADERS([regex.h tre/tre.h]) | |||
AC_CHECK_LIB([regex],[regcomp]) | AC_CHECK_LIB([regex],[regcomp]) | |||
AC_CHECK_LIB([tre],[tre_regcomp]) | AC_CHECK_LIB([tre],[tre_regcomp]) | |||
AC_CHECK_FUNCS([regcomp tre_regcomp tre_version]) | AC_CHECK_FUNCS([regcomp tre_regcomp tre_version]) | |||
################################################################ | ################################################################ | |||
## OpenSSL Support (required for AFFLIB and hash_t ) | ## OpenSSL Support (required for hash_t ) | |||
AC_CHECK_HEADERS([openssl/aes.h openssl/bio.h openssl/evp.h openssl/hmac.h opens sl/md5.h openssl/pem.h openssl/rand.h openssl/rsa.h openssl/sha.h openssl/pem.h openssl/x509.h]) | AC_CHECK_HEADERS([openssl/aes.h openssl/bio.h openssl/evp.h openssl/hmac.h opens sl/md5.h openssl/pem.h openssl/rand.h openssl/rsa.h openssl/sha.h openssl/pem.h openssl/x509.h]) | |||
AC_CHECK_LIB([dl],[dlopen]) dnl apparently OpenSSL now needs - ldl on some Linux | AC_CHECK_LIB([dl],[dlopen]) dnl apparently OpenSSL now needs - ldl on some Linux | |||
AC_CHECK_LIB([crypto],[EVP_get_digestbyname]) # if crypto is available, get it | AC_CHECK_LIB([crypto],[EVP_get_digestbyname]) # if crypto is available, get it | |||
AC_CHECK_LIB([md],[MD5]) # if libmd is available, get it | AC_CHECK_LIB([md],[MD5]) # if libmd is available, get it | |||
# Need either SSL_library_init or OPENSSL_init_ssl, depending on openssl version | # Need either SSL_library_init or OPENSSL_init_ssl, depending on openssl version | |||
AC_CHECK_LIB([ssl],[SSL_library_init],, | AC_CHECK_LIB([ssl],[SSL_library_init],, | |||
AC_CHECK_LIB([ssl],[OPENSSL_init_ssl],, | AC_CHECK_LIB([ssl],[OPENSSL_init_ssl],, | |||
AC_MSG_ERROR([OpenSSL developer library 'libssl-dev' or 'openssl-devel ' not installed]))) | AC_MSG_ERROR([OpenSSL developer library 'libssl-dev' or 'openssl-devel ' not installed]))) | |||
AC_CHECK_FUNCS([MD5_Init EVP_get_digestbyname]) | AC_CHECK_FUNCS([MD5_Init EVP_get_digestbyname]) | |||
################################################################ | ################################################################ | |||
## Includes | ## Includes | |||
m4_include([src/dfxml/src/dfxml_configure.m4]) | ||||
m4_include([src/be13_api/be13_configure.m4]) | m4_include([src/be13_api/be13_configure.m4]) | |||
m4_include([src/be13_api/dfxml/src/dfxml_configure.m4]) | ||||
################################################################ | ||||
# PTHREAD support | ||||
# With special nods to compiling under mingw | ||||
if test x"$mingw" = x"yes"; then | ||||
#AC_DEFINE([HAVE_STRUCT_TIMESPEC],1,[Required for mingw]) | ||||
CFLAGS="$CFLAGS -mthreads " | ||||
CPPFLAGS="-DPTW32_STATIC_LIB $CPPFLAGS" | ||||
CXXFLAGS="$CXXFLAGS -mthreads " | ||||
AC_DEFINE(HAVE_PTHREAD,1,[Defined to POSIX threads for mingw]) | ||||
#AC_MSG_NOTICE([pthreads now disabled under mingw]) | ||||
AC_CHECK_LIB([pthread],[pthread_create]) | ||||
else | ||||
m4_include([m4/ax_pthread.m4]) | ||||
AX_PTHREAD([ | ||||
echo Using settings from [AX_PTHREAD] | ||||
LIBS="$PTHREAD_LIBS $LIBS" | ||||
CFLAGS=" $PTHREAD_CFLAGS $CFLAGS" | ||||
CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS " | ||||
CPPFLAGS="$PTHREAD_CFLAGS $CPPFLAGS " | ||||
CC="$PTHREAD_CC" | ||||
]) | ||||
fi | ||||
AC_CHECK_HEADERS([pthread.h]) | ||||
AC_CHECK_LIB([pthreadGC2],[pthread_create]) | ||||
################################################################ | ################################################################ | |||
# Boost | # Boost | |||
AC_CHECK_HEADERS([boost/version.hpp],, | AC_CHECK_HEADERS([boost/version.hpp],, | |||
AC_MSG_WARN([tcpflow now requires boost interval_map and interval_set.]) | AC_MSG_WARN([tcpflow now requires boost interval_map and interval_set.]) | |||
if test x"$mingw" = x"yes" ; then | if test x"$mingw" = x"yes" ; then | |||
AC_MSG_ERROR([Please install mingw32-boost and mingw64-boost]) | AC_MSG_ERROR([Please install mingw32-boost and mingw64-boost]) | |||
else | else | |||
AC_MSG_ERROR([Please install boost-devel or libboost-dev.]) | AC_MSG_ERROR([Please install boost-devel or libboost-dev.]) | |||
fi | fi | |||
skipping to change at line 346 | skipping to change at line 278 | |||
available when cross-compiling. | available when cross-compiling. | |||
If your libpcap is installed in a non-standard location, you will need | If your libpcap is installed in a non-standard location, you will need | |||
to use the --with-pcap=directory to specify where your pcap is | to use the --with-pcap=directory to specify where your pcap is | |||
located.]) | located.]) | |||
Fmissing_library="$Fmissing_library libpcap-dev " | Fmissing_library="$Fmissing_library libpcap-dev " | |||
Umissing_library="$Umissing_library libpcap-dev " | Umissing_library="$Umissing_library libpcap-dev " | |||
Mmissing_library="$Mmissing_library libpcap " | Mmissing_library="$Mmissing_library libpcap " | |||
]) | ]) | |||
fi | fi | |||
AC_CHECK_FUNCS([pcap_findalldevs]) | ||||
dnl set with_wifi to 0 if you do not want it | dnl set with_wifi to 0 if you do not want it | |||
AC_ARG_ENABLE([wifi], | AC_ARG_ENABLE([wifi], | |||
AS_HELP_STRING([--disable-wifi], [Disable WIFI decoding]), | AS_HELP_STRING([--disable-wifi], [Disable WIFI decoding]), | |||
[], | [], | |||
[ | [ | |||
if test x"no" = x"$mingw"; then | if test x"no" = x"$mingw"; then | |||
AC_DEFINE(USE_WIFI, 1, [Use WIFI decompression]) | AC_DEFINE(USE_WIFI, 1, [Use WIFI decompression]) | |||
wifi="yes" | wifi="yes" | |||
fi | fi | |||
skipping to change at line 420 | skipping to change at line 353 | |||
semaphore.h \ | semaphore.h \ | |||
signal.h \ | signal.h \ | |||
string.h \ | string.h \ | |||
strings.h \ | strings.h \ | |||
stdio.h \ | stdio.h \ | |||
stdlib.h \ | stdlib.h \ | |||
string.h \ | string.h \ | |||
syslog.h \ | syslog.h \ | |||
sys/cdefs.h \ | sys/cdefs.h \ | |||
sys/mman.h \ | sys/mman.h \ | |||
sys/param.h \ | ||||
sys/resource.h \ | sys/resource.h \ | |||
sys/socket.h \ | sys/socket.h \ | |||
sys/types.h \ | sys/types.h \ | |||
sys/bitypes.h \ | sys/bitypes.h \ | |||
sys/wait.h \ | sys/wait.h \ | |||
unistd.h \ | unistd.h \ | |||
]) | ]) | |||
AC_CHECK_FUNCS([getdtablesize]) | AC_CHECK_FUNCS([getdtablesize]) | |||
End of changes. 10 change blocks. | ||||
78 lines changed or deleted | 12 lines changed or added |