autotools: cleanup

Remove most of the CFLAGS updates from configure. Flags are now (mostly)
set in AM_CLFLAGS.

Update all -DBLAH additions to CFLAGS to use AC_DEFINE([BLAH], ...)

Improve Lua vs LuaJIT checking.

Improve the configure output a bit.

Lots of smaller cleanups.
pull/1619/head
Victor Julien 10 years ago
parent 63a47967d7
commit ba81c4d290

@ -1,6 +1,3 @@
#TODO A better place for default CFLAGS?
AC_INIT(suricata, 2.1dev) AC_INIT(suricata, 2.1dev)
m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])AM_SILENT_RULES([yes]) m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])AM_SILENT_RULES([yes])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
@ -39,9 +36,29 @@
echo echo
]) ])
if test `basename $CC` = "clang"; then dnl Taken from https://llvm.org/svn/llvm-project/llvm/trunk/autoconf/configure.ac
CFLAGS="$CFLAGS -Wextra -Werror-implicit-function-declaration" dnl check if we compile using clang or gcc. On some systems the gcc binary is
AC_MSG_CHECKING([clang __sync_bool_compare_and_swap]) dnl is actually clang, so do a compile test.
AC_MSG_CHECKING([whether GCC or Clang is our compiler])
AC_LANG_PUSH([C])
compiler=unknown
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#if ! __clang__
#error
#endif
]])],
compiler=clang,
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#if ! __GNUC__
#error
#endif
]])],
compiler=gcc, [])])
AC_LANG_POP([C])
AC_MSG_RESULT([${compiler}])
case "$compiler" in
clang)
CLANG_CFLAGS="-Wextra -Werror-implicit-function-declaration"
AC_MSG_CHECKING([clang __sync_bool_compare_and_swap support])
AC_TRY_COMPILE([#include <stdio.h>], AC_TRY_COMPILE([#include <stdio.h>],
[ unsigned int i = 0; (void)__sync_bool_compare_and_swap(&i, 1, 1);], [ unsigned int i = 0; (void)__sync_bool_compare_and_swap(&i, 1, 1);],
[ [
@ -51,8 +68,9 @@
AC_DEFINE([__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8], [1], [Fake GCC atomic support]) AC_DEFINE([__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8], [1], [Fake GCC atomic support])
AC_MSG_RESULT([yes]) ], AC_MSG_RESULT([yes]) ],
[AC_MSG_RESULT([no])]) [AC_MSG_RESULT([no])])
fi AC_SUBST(CLANG_CFLAGS)
if test `basename $CC` = "gcc"; then ;;
gcc)
dnl get gcc version dnl get gcc version
AC_MSG_CHECKING([gcc version]) AC_MSG_CHECKING([gcc version])
gccver=$($CC -dumpversion) gccver=$($CC -dumpversion)
@ -63,17 +81,19 @@
if test "$gccvernum" -ge "400"; then if test "$gccvernum" -ge "400"; then
dnl gcc 4.0 or later dnl gcc 4.0 or later
CFLAGS="$CFLAGS -Wextra -Werror-implicit-function-declaration" GCC_CFLAGS="-Wextra -Werror-implicit-function-declaration"
# remove optimization options that break our code # remove optimization options that break our code
# VJ 2010/06/27: no-tree-pre added. It breaks ringbuffers code. # VJ 2010/06/27: no-tree-pre added. It breaks ringbuffers code.
CFLAGS="$CFLAGS -fno-tree-pre" GCC_CFLAGS="$GCC_CFLAGS -fno-tree-pre"
else else
CFLAGS="$CFLAGS -W" GCC_CFLAGS="-W"
fi
fi fi
CFLAGS="$CFLAGS -Wall" AC_SUBST(GCC_CFLAGS)
CFLAGS="$CFLAGS -Wno-unused-parameter" ;;
CFLAGS="$CFLAGS -std=gnu99" *)
AC_MSG_WARN([unsupported/untested compiler, this may or may not work])
;;
esac
# Checks for programs. # Checks for programs.
AC_PROG_AWK AC_PROG_AWK
@ -166,7 +186,11 @@
AC_FUNC_MALLOC AC_FUNC_MALLOC
AC_FUNC_REALLOC AC_FUNC_REALLOC
AC_CHECK_FUNCS([gettimeofday memset strcasecmp strchr strdup strerror strncasecmp strtol strtoul memchr memrchr]) AC_CHECK_FUNCS([gettimeofday memset strcasecmp strchr strdup strerror strncasecmp strtol strtoul memchr memrchr])
OCFLAGS=$CFLAGS
CFLAGS=""
AC_CHECK_FUNCS([strlcpy strlcat]) AC_CHECK_FUNCS([strlcpy strlcat])
CFLAGS=$OCFLAGS
# Add large file support # Add large file support
AC_SYS_LARGEFILE AC_SYS_LARGEFILE
@ -252,7 +276,7 @@
AC_MSG_CHECKING(for -fstack-protector) AC_MSG_CHECKING(for -fstack-protector)
TMPCFLAGS="${CFLAGS}" TMPCFLAGS="${CFLAGS}"
CFLAGS="${CFLAGS} -fstack-protector" CFLAGS="${CFLAGS} -fstack-protector"
AC_TRY_LINK(,,SECCFLAGS="${SECCFLAGS} -fstack-protector" AC_TRY_LINK(,,SECCFLAGS="-fstack-protector"
AC_MSG_RESULT(yes), AC_MSG_RESULT(yes),
AC_MSG_RESULT(no)) AC_MSG_RESULT(no))
CFLAGS="${TMPCFLAGS}" CFLAGS="${TMPCFLAGS}"
@ -293,8 +317,8 @@
AC_MSG_RESULT(no)) AC_MSG_RESULT(no))
LDFLAGS="${TMPLDFLAGS}" LDFLAGS="${TMPLDFLAGS}"
CFLAGS="${CFLAGS} ${SECCFLAGS}" AC_SUBST(SECCFLAGS)
LDFLAGS="${LDFLAGS} ${SECLDFLAGS}" AC_SUBST(SECLDFLAGS)
]) ])
#enable profile generation #enable profile generation
@ -314,7 +338,8 @@
AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include <stdlib.h>]])], AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include <stdlib.h>]])],
[ [
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
CFLAGS="$OFLAGS -march=native" OPTIMIZATION_CFLAGS="-march=native"
AC_SUBST(OPTIMIZATION_CFLAGS)
], ],
[ [
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
@ -330,44 +355,42 @@
AC_ARG_ENABLE(unittests, AC_ARG_ENABLE(unittests,
AS_HELP_STRING([--enable-unittests], [Enable compilation of the unit tests]),,[enable_unittests=no]) AS_HELP_STRING([--enable-unittests], [Enable compilation of the unit tests]),,[enable_unittests=no])
AS_IF([test "x$enable_unittests" = "xyes"], [ AS_IF([test "x$enable_unittests" = "xyes"], [
UT_ENABLED="yes" AC_DEFINE([UNITTESTS],[1],[Enable built-in unittests])
CFLAGS="${CFLAGS} -DUNITTESTS"
]) ])
AM_CONDITIONAL([BUILD_UNITTESTS], [test "x$enable_unittests" = "xyes"]) AM_CONDITIONAL([BUILD_UNITTESTS], [test "x$enable_unittests" = "xyes"])
# enable workaround for old barnyard2 for unified alert output # enable workaround for old barnyard2 for unified alert output
AC_ARG_ENABLE(old-barnyard2, AC_ARG_ENABLE(old-barnyard2,
AS_HELP_STRING([--enable-old-barnyard2], [Use workaround for old barnyard2 in unified2 output]),,[enable_old_barnyard2=no]) AS_HELP_STRING([--enable-old-barnyard2], [Use workaround for old barnyard2 in unified2 output]),,[enable_old_barnyard2=no])
AS_IF([test "x$enable_old_barnyard2" = "xyes"], [ AS_IF([test "x$enable_old_barnyard2" = "xyes"], [
CFLAGS="${CFLAGS} -DHAVE_OLD_BARNYARD2" AC_DEFINE([HAVE_OLD_BARNYARD2],[1],[Use workaround for old barnyard2 in unified2 output])
]) ])
# enable debug output # enable debug output
AC_ARG_ENABLE(debug, AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug], [Enable debug output]),,[enable_debug=no]) AS_HELP_STRING([--enable-debug], [Enable debug output]),,[enable_debug=no])
AS_IF([test "x$enable_debug" = "xyes"], [ AS_IF([test "x$enable_debug" = "xyes"], [
CFLAGS="${CFLAGS} -DDEBUG" AC_DEFINE([DEBUG],[1],[Enable debug output])
]) ])
AM_CONDITIONAL([DEBUG], [test "x$enable_debug" = "xyes"])
# enable debug validation functions & macro's output # enable debug validation functions & macro's output
AC_ARG_ENABLE(debug-validation, AC_ARG_ENABLE(debug-validation,
AS_HELP_STRING([--enable-debug-validation], [Enable (debug) validation code output]),,[enable_debug_validation=no]) AS_HELP_STRING([--enable-debug-validation], [Enable (debug) validation code output]),,[enable_debug_validation=no])
AS_IF([test "x$enable_debug_validation" = "xyes"], [ AS_IF([test "x$enable_debug_validation" = "xyes"], [
CFLAGS="${CFLAGS} -DDEBUG_VALIDATION" AC_DEFINE([DEBUG_VALIDATION],[1],[Enable (debug) validation code output])
]) ])
# profiling support # profiling support
AC_ARG_ENABLE(profiling, AC_ARG_ENABLE(profiling,
AS_HELP_STRING([--enable-profiling], [Enable performance profiling]),,[enable_profiling=no]) AS_HELP_STRING([--enable-profiling], [Enable performance profiling]),,[enable_profiling=no])
AS_IF([test "x$enable_profiling" = "xyes"], [ AS_IF([test "x$enable_profiling" = "xyes"], [
case "$host" in case "$host" in
*-*-openbsd*) *-*-openbsd*)
AC_MSG_ERROR([profiling is not supported on OpenBSD]) AC_MSG_ERROR([profiling is not supported on OpenBSD])
;; ;;
*) *)
CFLAGS="${CFLAGS} -DPROFILING" AC_DEFINE([PROFILING],[1],[Enable performance profiling])
;; ;;
esac esac
]) ])
@ -376,14 +399,15 @@
AC_ARG_ENABLE(profiling-locks, AC_ARG_ENABLE(profiling-locks,
AS_HELP_STRING([--enable-profiling-locks], [Enable performance profiling for locks]),,[enable_profiling_locks=no]) AS_HELP_STRING([--enable-profiling-locks], [Enable performance profiling for locks]),,[enable_profiling_locks=no])
AS_IF([test "x$enable_profiling_locks" = "xyes"], [ AS_IF([test "x$enable_profiling_locks" = "xyes"], [
CFLAGS="${CFLAGS} -DPROFILING -DPROFILE_LOCKING" AC_DEFINE([PROFILING],[1],[Enable performance profiling])
AC_DEFINE([PROFILE_LOCKING],[1],[Enable performance profiling for locks])
]) ])
# enable support for IPFW # enable support for IPFW
AC_ARG_ENABLE(ipfw, AC_ARG_ENABLE(ipfw,
AS_HELP_STRING([--enable-ipfw], [Enable FreeBSD IPFW support for inline IDP]),,[enable_ipfw=no]) AS_HELP_STRING([--enable-ipfw], [Enable FreeBSD IPFW support for inline IDP]),,[enable_ipfw=no])
AS_IF([test "x$enable_ipfw" = "xyes"], [ AS_IF([test "x$enable_ipfw" = "xyes"], [
CFLAGS="$CFLAGS -DIPFW" AC_DEFINE([IPFW],[1],[Enable FreeBSD IPFW support for inline IDP])
]) ])
AC_ARG_ENABLE(coccinelle, AC_ARG_ENABLE(coccinelle,
@ -407,6 +431,7 @@
AC_DEFINE([HAVE_DETECT_DISABLED], [1], [Detection is disabled]) AC_DEFINE([HAVE_DETECT_DISABLED], [1], [Detection is disabled])
]) ])
# Tilera PCIE logging
AM_CONDITIONAL([BUILD_PCIE_LOGGING], [test ! -z "$TILERA_ROOT"]) AM_CONDITIONAL([BUILD_PCIE_LOGGING], [test ! -z "$TILERA_ROOT"])
# libraries # libraries
@ -467,13 +492,13 @@
[ pcre_match_limit_recursion_available=yes ], [:] [ pcre_match_limit_recursion_available=yes ], [:]
) )
if test "$pcre_match_limit_recursion_available" != "yes"; then if test "$pcre_match_limit_recursion_available" != "yes"; then
CFLAGS="${CFLAGS} -DNO_PCRE_MATCH_RLIMIT"
echo echo
echo " Warning! pcre extra opt PCRE_EXTRA_MATCH_LIMIT_RECURSION not found" echo " Warning! pcre extra opt PCRE_EXTRA_MATCH_LIMIT_RECURSION not found"
echo " This could lead to potential DoS please upgrade to pcre >= 6.5" echo " This could lead to potential DoS please upgrade to pcre >= 6.5"
echo " Continuing for now...."
echo " from www.pcre.org." echo " from www.pcre.org."
echo " Continuing for now...."
echo echo
AC_DEFINE([NO_PCRE_MATCH_RLIMIT],[1],[Pcre PCRE_EXTRA_MATCH_LIMIT_RECURSION not available])
fi fi
TMPCFLAGS="${CFLAGS}" TMPCFLAGS="${CFLAGS}"
@ -702,9 +727,9 @@
esac esac
fi fi
#enable support for NFQUEUE # enable support for NFQUEUE
AS_IF([test "x$enable_nfqueue" = "xyes"], [ AS_IF([test "x$enable_nfqueue" = "xyes"], [
CFLAGS="$CFLAGS -DNFQ" AC_DEFINE_UNQUOTED([NFQ],[1],[Enable Linux Netfilter NFQUEUE support for inline IDP])
#libnetfilter_queue #libnetfilter_queue
AC_ARG_WITH(libnetfilter_queue_includes, AC_ARG_WITH(libnetfilter_queue_includes,
@ -892,7 +917,12 @@
LLIBNET="" LLIBNET=""
AC_CHECK_LIB(net, libnet_write,, LLIBNET="no") AC_CHECK_LIB(net, libnet_write,, LLIBNET="no")
if test "$LLIBNET" != "no"; then if test "$LLIBNET" != "no"; then
CFLAGS="${CFLAGS} -DHAVE_LIBNET11 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H" AC_DEFINE([HAVE_LIBNET11],[1],(libnet 1.1 available))
AC_DEFINE([_DEFAULT_SOURCE],[1],(default source))
AC_DEFINE([_BSD_SOURCE],[1],(bsd source))
AC_DEFINE([__BSD_SOURCE],[1],(bsd source))
AC_DEFINE([__FAVOR_BSD],[1],(favor bsd))
AC_DEFINE([HAVE_NET_ETHERNET_H],[1],(ethernet.h))
else else
#if we displayed a warning already no reason to do it again. #if we displayed a warning already no reason to do it again.
if test "$LIBNET_DETECT_FAIL" = "no"; then if test "$LIBNET_DETECT_FAIL" = "no"; then
@ -911,7 +941,7 @@
TMPLIBS="${LIBS}" TMPLIBS="${LIBS}"
AC_CHECK_LIB(net, libnet_build_icmpv6_unreach,, LLIBNET="no") AC_CHECK_LIB(net, libnet_build_icmpv6_unreach,, LLIBNET="no")
if test "$LLIBNET" != "no"; then if test "$LLIBNET" != "no"; then
CFLAGS="$CFLAGS -DHAVE_LIBNET_ICMPV6_UNREACH" AC_DEFINE([HAVE_LIBNET_ICMPV6_UNREACH],[1],(libnet_build_icmpv6_unreach available))
fi fi
LIBS="${TMPLIBS}" LIBS="${TMPLIBS}"
fi fi
@ -962,12 +992,14 @@
if test "$LPCAPVTEST" != "no"; then if test "$LPCAPVTEST" != "no"; then
AC_PATH_PROG(HAVE_PCAP_CONFIG, pcap-config, "no") AC_PATH_PROG(HAVE_PCAP_CONFIG, pcap-config, "no")
if test "$HAVE_PCAP_CONFIG" = "no" -o "$cross_compiling" = "yes"; then if test "$HAVE_PCAP_CONFIG" = "no" -o "$cross_compiling" = "yes"; then
CFLAGS="${CFLAGS} -DLIBPCAP_VERSION_MAJOR=1" AC_DEFINE([LIBPCAP_VERSION_MAJOR],[1],(libpcap version 1.0+))
else else
CFLAGS="${CFLAGS} `pcap-config --defines` `pcap-config --cflags` -DLIBPCAP_VERSION_MAJOR=1" PCAP_CFLAGS="$(pcap-config --defines) $(pcap-config --cflags)"
AC_SUBST(PCAP_CFLAGS)
AC_DEFINE([LIBPCAP_VERSION_MAJOR],[1],(libpcap version 1.0+))
fi fi
else else
CFLAGS="${CFLAGS} -DLIBPCAP_VERSION_MAJOR=0" AC_DEFINE([LIBPCAP_VERSION_MAJOR],[0],(libpcap version 0.x))
fi fi
LIBS="${TMPLIBS}" LIBS="${TMPLIBS}"
@ -978,7 +1010,7 @@
TMPLIBS="${LIBS}" TMPLIBS="${LIBS}"
AC_CHECK_LIB(pcap, pcap_set_buffer_size,, LPCAPSBUFF="no") AC_CHECK_LIB(pcap, pcap_set_buffer_size,, LPCAPSBUFF="no")
if test "$LPCAPSBUFF" != "no"; then if test "$LPCAPSBUFF" != "no"; then
CFLAGS="${CFLAGS} -DHAVE_PCAP_SET_BUFF" AC_DEFINE([HAVE_PCAP_SET_BUFF],[1],(libpcap has pcap_set_buffer_size function))
fi fi
LIBS="${TMPLIBS}" LIBS="${TMPLIBS}"
@ -988,7 +1020,7 @@
AC_ARG_ENABLE(pfring, AC_ARG_ENABLE(pfring,
AS_HELP_STRING([--enable-pfring], [Enable Native PF_RING support]),,[enable_pfring=no]) AS_HELP_STRING([--enable-pfring], [Enable Native PF_RING support]),,[enable_pfring=no])
AS_IF([test "x$enable_pfring" = "xyes"], [ AS_IF([test "x$enable_pfring" = "xyes"], [
CFLAGS="$CFLAGS -DHAVE_PFRING" AC_DEFINE([HAVE_PFRING],[1],(PF_RING support enabled))
#We have to set CFLAGS for AC_TRY_COMPILE as it doesn't pay attention to CPPFLAGS #We have to set CFLAGS for AC_TRY_COMPILE as it doesn't pay attention to CPPFLAGS
AC_ARG_WITH(libpfring_includes, AC_ARG_WITH(libpfring_includes,
@ -1068,7 +1100,7 @@
[with_netmap_includes="$withval"],[with_netmap_includes=no]) [with_netmap_includes="$withval"],[with_netmap_includes=no])
AS_IF([test "x$enable_netmap" = "xyes"], [ AS_IF([test "x$enable_netmap" = "xyes"], [
CFLAGS="$CFLAGS -DHAVE_NETMAP" AC_DEFINE([HAVE_NETMAP],[1],(NETMAP support enabled))
if test "$with_netmap_includes" != "no"; then if test "$with_netmap_includes" != "no"; then
CPPFLAGS="${CPPFLAGS} -I${with_netmap_includes}" CPPFLAGS="${CPPFLAGS} -I${with_netmap_includes}"
@ -1169,7 +1201,7 @@
[ --with-cuda-nvcc=DIR cuda nvcc compiler directory], [ --with-cuda-nvcc=DIR cuda nvcc compiler directory],
[with_cuda_nvcc="$withval"],[with_cuda_nvcc=no]) [with_cuda_nvcc="$withval"],[with_cuda_nvcc=no])
CFLAGS="${CFLAGS} -D__SC_CUDA_SUPPORT__" AC_DEFINE([SC_CUDA_SUPPORT__],[1],(CUDA support enabled))
if test "$with_cuda_includes" != "no"; then if test "$with_cuda_includes" != "no"; then
CPPFLAGS="${CPPFLAGS} -I${with_cuda_includes}" CPPFLAGS="${CPPFLAGS} -I${with_cuda_includes}"
@ -1253,7 +1285,7 @@
fi fi
if test "$LIBCAP_NG" != "no"; then if test "$LIBCAP_NG" != "no"; then
CFLAGS="${CFLAGS} -DHAVE_LIBCAP_NG" AC_DEFINE([HAVE_LIBCAP_NG],[1],[Libpcap-ng support])
fi fi
if test "$LIBCAP_NG" = "no"; then if test "$LIBCAP_NG" = "no"; then
@ -1299,16 +1331,14 @@
AC_CHECK_LIB(dag,dag_open,,DAG="no",) AC_CHECK_LIB(dag,dag_open,,DAG="no",)
fi fi
if test "$DAG" != "no"; then
CFLAGS="${CFLAGS} -DHAVE_DAG"
fi
if test "$DAG" = "no"; then if test "$DAG" = "no"; then
echo echo
echo " ERROR! libdag library not found" echo " ERROR! libdag library not found"
echo echo
exit 1 exit 1
fi fi
AC_DEFINE([HAVE_DAG],[1],(Endace DAG card support enabled))
fi fi
# libnspr # libnspr
@ -1450,16 +1480,14 @@
AC_CHECK_LIB(ntapi, NT_Init,NAPATECH="yes",NAPATECH="no") AC_CHECK_LIB(ntapi, NT_Init,NAPATECH="yes",NAPATECH="no")
fi fi
if test "$NAPATECH" != "no"; then
CFLAGS="${CFLAGS} -DHAVE_NAPATECH"
fi
if test "$NAPATECH" = "no"; then if test "$NAPATECH" = "no"; then
echo echo
echo " ERROR! libntapi library not found" echo " ERROR! libntapi library not found"
echo echo
exit 1 exit 1
fi fi
AC_DEFINE([HAVE_NAPATECH],[1],(Napatech capture card support))
fi fi
# liblua # liblua
@ -1467,6 +1495,22 @@
AS_HELP_STRING([--enable-lua],[Enable Lua support]), AS_HELP_STRING([--enable-lua],[Enable Lua support]),
[ enable_lua="yes"], [ enable_lua="yes"],
[ enable_lua="no"]) [ enable_lua="no"])
AC_ARG_ENABLE(luajit,
AS_HELP_STRING([--enable-luajit],[Enable Luajit support]),
[ enable_luajit="yes"],
[ enable_luajit="no"])
if test "$enable_lua" = "yes"; then
if test "$enable_luajit" = "yes"; then
echo "ERROR: can't enable liblua and luajit at the same time."
echo "For LuaJIT, just use --enable-luajit. For liblua (no jit)"
echo "support, use just --enable-lua."
echo "Both options will enable the Lua scripting capabilities"
echo "in Suricata".
echo
exit 1
fi
fi
AC_ARG_WITH(liblua_includes, AC_ARG_WITH(liblua_includes,
[ --with-liblua-includes=DIR liblua include directory], [ --with-liblua-includes=DIR liblua include directory],
[with_liblua_includes="$withval"],[with_liblua_includes="no"]) [with_liblua_includes="$withval"],[with_liblua_includes="no"])
@ -1544,10 +1588,6 @@
fi fi
# libluajit # libluajit
AC_ARG_ENABLE(luajit,
AS_HELP_STRING([--enable-luajit],[Enable Luajit support]),
[ enable_luajit="yes"],
[ enable_luajit="no"])
AC_ARG_WITH(libluajit_includes, AC_ARG_WITH(libluajit_includes,
[ --with-libluajit-includes=DIR libluajit include directory], [ --with-libluajit-includes=DIR libluajit include directory],
[with_libluajit_includes="$withval"],[with_libluajit_includes="no"]) [with_libluajit_includes="$withval"],[with_libluajit_includes="no"])
@ -1590,7 +1630,7 @@
AC_DEFINE([HAVE_LUA],[1],[lua support available]) AC_DEFINE([HAVE_LUA],[1],[lua support available])
AC_DEFINE([HAVE_LUAJIT],[1],[libluajit available]) AC_DEFINE([HAVE_LUAJIT],[1],[libluajit available])
enable_lua="yes" enable_lua="yes, through luajit"
enable_luajit="yes" enable_luajit="yes"
else else
echo echo
@ -1642,11 +1682,10 @@
echo echo
exit 1 exit 1
fi fi
if test "$GEOIP" = "yes"; then
AC_DEFINE([HAVE_GEOIP],[1],[libgeoip available]) AC_DEFINE([HAVE_GEOIP],[1],[libgeoip available])
enable_geoip="yes" enable_geoip="yes"
fi fi
fi
# get cache line size # get cache line size
AC_PATH_PROG(HAVE_GETCONF_CMD, getconf, "no") AC_PATH_PROG(HAVE_GETCONF_CMD, getconf, "no")
@ -1655,22 +1694,22 @@
if [test "$CLS" != "" && test "$CLS" != "0"]; then if [test "$CLS" != "" && test "$CLS" != "0"]; then
AC_DEFINE_UNQUOTED([CLS],[${CLS}],[L1 cache line size]) AC_DEFINE_UNQUOTED([CLS],[${CLS}],[L1 cache line size])
else else
AC_DEFINE_UNQUOTED([CLS],[64],[L1 cache line size]) AC_DEFINE([CLS],[64],[L1 cache line size])
fi fi
else else
AC_DEFINE_UNQUOTED([CLS],[64],[L1 cache line size]) AC_DEFINE([CLS],[64],[L1 cache line size])
fi fi
# get revision # get revision
if test -f ./revision; then if test -f ./revision; then
REVISION=`cat ./revision` REVISION=`cat ./revision`
CFLAGS="${CFLAGS} -DREVISION=\"${REVISION}\"" AC_DEFINE_UNQUOTED([REVISION],[${REVISION}],[Git revision])
else else
AC_PATH_PROG(HAVE_GIT_CMD, git, "no") AC_PATH_PROG(HAVE_GIT_CMD, git, "no")
if test "$HAVE_GIT_CMD" != "no"; then if test "$HAVE_GIT_CMD" != "no"; then
if [ test -d .git ]; then if [ test -d .git ]; then
REVISION=`git rev-parse --short HEAD` REVISION=`git rev-parse --short HEAD`
CFLAGS="${CFLAGS} -DREVISION=\"${REVISION}\"" AC_DEFINE_UNQUOTED([REVISION],[${REVISION}],[Git revision])
fi fi
fi fi
fi fi
@ -1730,6 +1769,13 @@ AC_SUBST(e_localstatedir)
AC_DEFINE_UNQUOTED([CONFIG_DIR],["$e_sysconfdir"],[Our CONFIG_DIR]) AC_DEFINE_UNQUOTED([CONFIG_DIR],["$e_sysconfdir"],[Our CONFIG_DIR])
AC_SUBST(e_magic_file) AC_SUBST(e_magic_file)
EXPAND_VARIABLE(prefix, CONFIGURE_PREFIX)
EXPAND_VARIABLE(sysconfdir, CONFIGURE_SYSCONDIR)
EXPAND_VARIABLE(localstatedir, CONFIGURE_LOCALSTATEDIR)
AC_SUBST(CONFIGURE_PREFIX)
AC_SUBST(CONFIGURE_SYSCONDIR)
AC_SUBST(CONFIGURE_LOCALSTATEDIR)
AC_OUTPUT(Makefile src/Makefile qa/Makefile qa/coccinelle/Makefile rules/Makefile doc/Makefile contrib/Makefile contrib/file_processor/Makefile contrib/file_processor/Action/Makefile contrib/file_processor/Processor/Makefile contrib/tile_pcie_logd/Makefile suricata.yaml scripts/Makefile scripts/suricatasc/Makefile scripts/suricatasc/suricatasc) AC_OUTPUT(Makefile src/Makefile qa/Makefile qa/coccinelle/Makefile rules/Makefile doc/Makefile contrib/Makefile contrib/file_processor/Makefile contrib/file_processor/Action/Makefile contrib/file_processor/Processor/Makefile contrib/tile_pcie_logd/Makefile suricata.yaml scripts/Makefile scripts/suricatasc/Makefile scripts/suricatasc/suricatasc)
SURICATA_BUILD_CONF="Suricata Configuration: SURICATA_BUILD_CONF="Suricata Configuration:
@ -1741,6 +1787,7 @@ SURICATA_BUILD_CONF="Suricata Configuration:
Netmap support: ${enable_netmap} Netmap support: ${enable_netmap}
DAG enabled: ${enable_dag} DAG enabled: ${enable_dag}
Napatech enabled: ${enable_napatech} Napatech enabled: ${enable_napatech}
Unix socket enabled: ${enable_unixsocket} Unix socket enabled: ${enable_unixsocket}
Detection enabled: ${enable_detection} Detection enabled: ${enable_detection}
@ -1766,15 +1813,22 @@ SURICATA_BUILD_CONF="Suricata Configuration:
Coccinelle / spatch: ${enable_coccinelle} Coccinelle / spatch: ${enable_coccinelle}
Generic build parameters: Generic build parameters:
Installation prefix (--prefix): ${prefix} Installation prefix: ${prefix}
Configuration directory (--sysconfdir): ${e_sysconfdir} Configuration directory: ${e_sysconfdir}
Log directory (--localstatedir) : ${e_logdir} Log directory: ${e_logdir}
--prefix ${CONFIGURE_PREFIX}
--sysconfdir ${CONFIGURE_SYSCONDIR}
--localstatedir ${CONFIGURE_LOCALSTATEDIR}
Host: ${host} Host: ${host}
GCC binary: ${CC} Compiler: ${CC} (exec name) / ${compiler} (real)
GCC Protect enabled: ${enable_gccprotect} GCC Protect enabled: ${enable_gccprotect}
GCC march native enabled: ${enable_gccmarch_native} GCC march native enabled: ${enable_gccmarch_native}
GCC Profile enabled: ${enable_gccprofile}" GCC Profile enabled: ${enable_gccprofile}
CFLAGS ${CFLAGS}
PCAP_CFLAGS ${PCAP_CFLAGS}
SECCFLAGS ${SECCFLAGS}"
echo echo
echo "$SURICATA_BUILD_CONF" echo "$SURICATA_BUILD_CONF"

@ -472,9 +472,14 @@ cuda-ptxdump.h: $(PTXS)
CLEANFILES = $(PTXS) cuda-ptxdump.h CLEANFILES = $(PTXS) cuda-ptxdump.h
endif endif
# default CFLAGS
AM_CFLAGS = ${OPTIMIZATION_CFLAGS} ${GCC_CFLAGS} ${CLANG_CFLAGS} ${SECCFLAGS} ${PCAP_CFLAGS} -Wall -Wno-unused-parameter -std=gnu99 -DLOCAL_STATE_DIR=\"$(localstatedir)\"
# different flags for different cases
if DEBUG
AM_CFLAGS += -ggdb -O0
endif
#suricata_CFLAGS = -Wall -fno-strict-aliasing AM_LDFLAGS = ${SECLDFLAGS}
AM_CFLAGS = -DLOCAL_STATE_DIR=\"$(localstatedir)\"
if BUILD_UNITTESTS if BUILD_UNITTESTS
check-am: check-am:

Loading…
Cancel
Save