CFLAGS="$CFLAGS -Wno-unused-parameter"
CFLAGS="$CFLAGS -std=gnu99"
-# Checks for programs.
+ # Checks for programs.
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
AC_PATH_PROG(HAVE_PKG_CONFIG, pkg-config, "no")
if test "$HAVE_PKG_CONFIG" = "no"; then
- echo
- echo " ERROR! pkg-config not found, go get it "
- echo " http://pkg-config.freedesktop.org/wiki/ "
- echo " or install from your distribution "
- echo
- exit 1
+ echo
+ echo " ERROR! pkg-config not found, go get it "
+ echo " http://pkg-config.freedesktop.org/wiki/ "
+ echo " or install from your distribution "
+ echo
+ exit 1
fi
AC_PATH_PROG(HAVE_COCCINELLE_CONFIG, spatch, "no")
if test "$HAVE_COCCINELLE_CONFIG" = "no"; then
- echo
- echo " Warning! spatch not found, you will not be "
- echo " able to run code checking with coccinelle "
- echo " get it from http://coccinelle.lip6.fr "
- echo " or install from your distribution "
- echo
+ echo
+ echo " Warning! spatch not found, you will not be "
+ echo " able to run code checking with coccinelle "
+ echo " get it from http://coccinelle.lip6.fr "
+ echo " or install from your distribution "
+ echo
fi
AM_CONDITIONAL([HAVE_COCCINELLE], [test "$HAVE_COCCINELLE_CONFIG" != "no"])
+ # Checks for libraries.
-# Checks for libraries.
-
-# Checks for header files.
+ # Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h inttypes.h limits.h netdb.h poll.h signal.h stdint.h stdlib.h string.h syslog.h sys/ioctl.h sys/prctl.h sys/socket.h sys/syscall.h netinet/in.h sys/time.h unistd.h windows.h winsock2.h ws2tcpip.h])
AC_CHECK_HEADERS([sys/socket.h net/if.h sys/mman.h], [], [],
[[#ifdef HAVE_SYS_SOCKET_H
]])
-# Checks for typedefs, structures, and compiler characteristics.
+ # Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_UINT8_T
AC_HEADER_STDBOOL
-# Checks for library functions.
+ # Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
- AC_CHECK_FUNCS([gettimeofday memset strcasecmp strchr strdup strerror strncasecmp strtol strtoul])
+ AC_CHECK_FUNCS([gettimeofday memset strcasecmp strchr strdup strerror strncasecmp strtol strtoul memchr])
-# Add large file support
+ # Add large file support
AC_SYS_LARGEFILE
-#check for os
+ #check for os
AC_MSG_CHECKING([host os])
# If no host os was detected, try with uname
CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/local/include/libnet-1.1"
LDFLAGS="${LDFLAGS} -L/usr/local/lib -I/usr/local/lib/libnet-1.1"
;;
- *darwin*|*Darwin*)
+ *darwin*|*Darwin*)
CFLAGS="${CFLAGS} -DOS_DARWIN"
CPPFLAGS="${CPPFLAGS} -I/opt/local/include"
LDFLAGS="${LDFLAGS} -L/opt/local/lib"
- ;;
+ ;;
*-*-linux*)
#for now do nothing
;;
*-*-mingw32*)
CFLAGS="${CFLAGS} -DOS_WIN32"
LDFLAGS="${LDFLAGS} -lws2_32"
- WINDOWS_PATH="yes"
+ WINDOWS_PATH="yes"
;;
*-*-cygwin)
- WINDOWS_PATH="yes"
+ WINDOWS_PATH="yes"
;;
*)
AC_MSG_WARN([unsupported OS this may or may not work])
esac
AC_MSG_RESULT(ok)
-#Enable support for gcc compile time security options. There is no great way to do detection of valid cflags that I have found
-#AX_CFLAGS_GCC_OPTION don't seem to do a better job than the code below and are a pain because of extra m4 files etc.
-#These flags seem to be supported on CentOS 5+, Ubuntu 8.04+, and FedoreCore 11+
-#Options are taken from https://wiki.ubuntu.com/CompilerFlags
+ #Enable support for gcc compile time security options. There is no great way to do detection of valid cflags that I have found
+ #AX_CFLAGS_GCC_OPTION don't seem to do a better job than the code below and are a pain because of extra m4 files etc.
+ #These flags seem to be supported on CentOS 5+, Ubuntu 8.04+, and FedoreCore 11+
+ #Options are taken from https://wiki.ubuntu.com/CompilerFlags
AC_ARG_ENABLE(gccprotect,
AS_HELP_STRING([--enable-gccprotect], [Detect and use gcc hardening options]),,[enable_gccprotect=no])
LDFLAGS="${LDFLAGS} ${SECLDFLAGS}"
])
-#enable profile generation
+ #enable profile generation
AC_ARG_ENABLE(gccprofile,
AS_HELP_STRING([--enable-gccprofile], [Enable gcc profile info i.e -pg flag is set]),,[enable_gccprofile=no])
AS_IF([test "x$enable_gccprofile" = "xyes"], [
CFLAGS="${CFLAGS} -pg"
])
-#enable gcc march=native gcc 4.2 or later
+ #enable gcc march=native gcc 4.2 or later
AC_ARG_ENABLE(gccmarch_native,
AS_HELP_STRING([--enable-gccmarch-native], [Enable gcc march=native gcc 4.2 and later only]),,[enable_gccmarch_native=yes])
AS_IF([test "x$enable_gccmarch_native" = "xyes"], [
esac
])
-#libpcre
+# options
+
+ # enable the running of unit tests
+ AC_ARG_ENABLE(unittests,
+ AS_HELP_STRING([--enable-unittests], [Enable compilation of the unit tests]),,[enable_unittests=no])
+ AS_IF([test "x$enable_unittests" = "xyes"], [
+ UT_ENABLED="yes"
+ CFLAGS="${CFLAGS} -DUNITTESTS"
+ ])
+
+ AM_CONDITIONAL([BUILD_UNITTESTS], [test "x$enable_unittests" = "xyes"])
+
+ # enable workaround for old barnyard2 for unified alert output
+ AC_ARG_ENABLE(old-barnyard2,
+ 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"], [
+ CFLAGS="${CFLAGS} -DHAVE_OLD_BARNYARD2"
+ ])
+
+ # enable debug output
+ AC_ARG_ENABLE(debug,
+ AS_HELP_STRING([--enable-debug], [Enable debug output]),,[enable_debug=no])
+ AS_IF([test "x$enable_debug" = "xyes"], [
+ CFLAGS="${CFLAGS} -DDEBUG"
+ ])
+
+ # enable debug validation functions & macro's output
+ AC_ARG_ENABLE(debug-validation,
+ AS_HELP_STRING([--enable-debug-validation], [Enable (debug) validation code output]),,[enable_debug_validation=no])
+ AS_IF([test "x$enable_debug_validation" = "xyes"], [
+ CFLAGS="${CFLAGS} -DDEBUG_VALIDATION"
+ ])
+
+ # profiling support
+ AC_ARG_ENABLE(profiling,
+ AS_HELP_STRING([--enable-profiling], [Enable performance profiling]),,[enable_profiling=no])
+ AS_IF([test "x$enable_profiling" = "xyes"], [
+ CFLAGS="${CFLAGS} -DPROFILING"
+ ])
+
+ # enable support for IPFW
+ AC_ARG_ENABLE(ipfw,
+ AS_HELP_STRING([--enable-ipfw], [Enable FreeBSD IPFW support for inline IDP]),,[enable_ipfw=no])
+ AS_IF([test "x$enable_ipfw" = "xyes"], [
+ CFLAGS="$CFLAGS -DIPFW"
+ ])
+
+# libraries
+
+ #libpcre
AC_ARG_WITH(libpcre_includes,
[ --with-libpcre-includes=DIR libpcre include directory],
[with_libpcre_includes="$withval"],[with_libpcre_includes=no])
AC_MSG_RESULT(no)
fi
-#libyaml
+ # libyaml
AC_ARG_WITH(libyaml_includes,
[ --with-libyaml-includes=DIR libyaml include directory],
[with_libyaml_includes="$withval"],[with_libyaml_includes=no])
AC_CHECK_LIB(yaml,yaml_parser_initialize,,LIBYAML="no")
if test "$LIBYAML" = "no"; then
- echo
- echo " ERROR! libyaml library not found, go get it"
- echo " from http://pyyaml.org/wiki/LibYAML."
- echo " or check your package manager."
- echo
- exit 1
+ echo
+ echo " ERROR! libyaml library not found, go get it"
+ echo " from http://pyyaml.org/wiki/LibYAML "
+ echo " or your distribution:"
+ echo
+ echo " Ubuntu: apt-get install libyaml-dev"
+ echo " Fedora: yum install libyaml-devel"
+ echo
+ exit 1
fi
-#libpthread
+ # libpthread
AC_ARG_WITH(libpthread_includes,
[ --with-libpthread-includes=DIR libpthread include directory],
[with_libpthread_includes="$withval"],[with_libpthread_includes=no])
exit 1
fi
-#enable support for NFQUEUE
+ #enable support for NFQUEUE
AC_ARG_ENABLE(nfqueue,
AS_HELP_STRING([--enable-nfqueue], [Enable NFQUEUE support for inline IDP]),,[enable_nfqueue=no])
AS_IF([test "x$enable_nfqueue" = "xyes"], [
CFLAGS="$CFLAGS -DNFQ"
-#libnfnetlink
-case $host in
-*-*-mingw32*)
-;;
-*)
- AC_ARG_WITH(libnfnetlink_includes,
- [ --with-libnfnetlink-includes=DIR libnfnetlink include directory],
- [with_libnfnetlink_includes="$withval"],[with_libnfnetlink_includes=no])
- AC_ARG_WITH(libnfnetlink_libraries,
- [ --with-libnfnetlink-libraries=DIR libnfnetlink library directory],
- [with_libnfnetlink_libraries="$withval"],[with_libnfnetlink_libraries="no"])
-
- if test "$with_libnfnetlink_includes" != "no"; then
- CPPFLAGS="${CPPFLAGS} -I${with_libnfnetlink_includes}"
- fi
+ # libnfnetlink
+ case $host in
+ *-*-mingw32*)
+ ;;
+ *)
+ AC_ARG_WITH(libnfnetlink_includes,
+ [ --with-libnfnetlink-includes=DIR libnfnetlink include directory],
+ [with_libnfnetlink_includes="$withval"],[with_libnfnetlink_includes=no])
+ AC_ARG_WITH(libnfnetlink_libraries,
+ [ --with-libnfnetlink-libraries=DIR libnfnetlink library directory],
+ [with_libnfnetlink_libraries="$withval"],[with_libnfnetlink_libraries="no"])
+
+ if test "$with_libnfnetlink_includes" != "no"; then
+ CPPFLAGS="${CPPFLAGS} -I${with_libnfnetlink_includes}"
+ fi
- AC_CHECK_HEADER(libnfnetlink/libnfnetlink.h,,[AC_ERROR(libnfnetlink.h not found ...)])
+ AC_CHECK_HEADER(libnfnetlink/libnfnetlink.h,,[AC_ERROR(libnfnetlink.h not found ...)])
- if test "$with_libnfnetlink_libraries" != "no"; then
- LDFLAGS="${LDFLAGS} -L${with_libnfnetlink_libraries}"
- fi
+ if test "$with_libnfnetlink_libraries" != "no"; then
+ LDFLAGS="${LDFLAGS} -L${with_libnfnetlink_libraries}"
+ fi
- NFNL=""
- AC_CHECK_LIB(nfnetlink, nfnl_fd,, NFNL="no")
+ NFNL=""
+ AC_CHECK_LIB(nfnetlink, nfnl_fd,, NFNL="no")
- if test "$NFNL" = "no"; then
- echo
- echo " ERROR! nfnetlink library not found, go get it"
- echo " from www.netfilter.org."
- echo " we automatically append libnetfilter_queue/ when searching"
- echo " for headers etc. when the --with-libnfnetlink-inlcudes directive"
- echo " is used"
- echo
- exit
- fi
-;;
-esac
+ if test "$NFNL" = "no"; then
+ echo
+ echo " ERROR! nfnetlink library not found, go get it"
+ echo " from www.netfilter.org."
+ echo " we automatically append libnetfilter_queue/ when searching"
+ echo " for headers etc. when the --with-libnfnetlink-inlcudes directive"
+ echo " is used"
+ echo
+ exit 1
+ fi
+ ;;
+ esac
-#libnetfilter_queue
+ #libnetfilter_queue
AC_ARG_WITH(libnetfilter_queue_includes,
[ --with-libnetfilter_queue-includes=DIR libnetfilter_queue include directory],
[with_libnetfilter_queue_includes="$withval"],[with_libnetfilter_queue_includes=no])
[with_libnetfilter_queue_libraries="$withval"],[with_libnetfilter_queue_libraries="no"])
if test "$with_libnetfilter_queue_includes" != "no"; then
- CPPFLAGS="${CPPFLAGS} -I${with_libnetfilter_queue_includes}"
+ CPPFLAGS="${CPPFLAGS} -I${with_libnetfilter_queue_includes}"
fi
AC_CHECK_HEADER(libnetfilter_queue/libnetfilter_queue.h,,[AC_ERROR(libnetfilter_queue/libnetfilter_queue.h not found ...)])
if test "$with_libnetfilter_queue_libraries" != "no"; then
- LDFLAGS="${LDFLAGS} -L${with_libnetfilter_queue_libraries}"
+ LDFLAGS="${LDFLAGS} -L${with_libnetfilter_queue_libraries}"
fi
-#LDFLAGS="${LDFLAGS} -lnetfilter_queue"
+ #LDFLAGS="${LDFLAGS} -lnetfilter_queue"
NFQ=""
+ case $host in
+ *-*-mingw32*)
+ AC_CHECK_LIB(netfilter_queue, nfq_open,, NFQ="no",-lws2_32)
-case $host in
-*-*-mingw32*)
- AC_CHECK_LIB(netfilter_queue, nfq_open,, NFQ="no",-lws2_32)
-
- AC_ARG_WITH(netfilterforwin_includes,
+ AC_ARG_WITH(netfilterforwin_includes,
[ --with-netfilterforwin-includes=DIR netfilterforwin include directory],
[with_netfilterforwin_includes="$withval"],[with_netfilterforwin_includes=no])
- if test "$with_netfilterforwin_includes" != "no"; then
- CPPFLAGS="${CPPFLAGS} -I${with_netfilterforwin_includes}"
- else
- CPPFLAGS="${CPPFLAGS} -I../../netfilterforwin"
- fi
-;;
-*)
- AC_CHECK_LIB(netfilter_queue, nfq_open,, NFQ="no",)
- AC_CHECK_LIB([netfilter_queue], [nfq_set_queue_maxlen],AC_DEFINE_UNQUOTED([HAVE_NFQ_MAXLEN],[1],[Found queue max length support in netfilter_queue]) ,,[-lnfnetlink])
- AC_CHECK_LIB([netfilter_queue], [nfq_set_verdict2],AC_DEFINE_UNQUOTED([HAVE_NFQ_SET_VERDICT2],[1],[Found nfq_set_verdict2 function in netfilter_queue]) ,,[-lnfnetlink])
-
- # check if the argument to nfq_get_payload is signed or unsigned
- AC_MSG_CHECKING([for signed nfq_get_payload payload argument])
- STORECFLAGS="${CFLAGS}"
- CFLAGS="${CFLAGS} -Werror"
- AC_COMPILE_IFELSE(
+ if test "$with_netfilterforwin_includes" != "no"; then
+ CPPFLAGS="${CPPFLAGS} -I${with_netfilterforwin_includes}"
+ else
+ CPPFLAGS="${CPPFLAGS} -I../../netfilterforwin"
+ fi
+ ;;
+ *)
+ AC_CHECK_LIB(netfilter_queue, nfq_open,, NFQ="no",)
+ AC_CHECK_LIB([netfilter_queue], [nfq_set_queue_maxlen],AC_DEFINE_UNQUOTED([HAVE_NFQ_MAXLEN],[1],[Found queue max length support in netfilter_queue]) ,,[-lnfnetlink])
+ AC_CHECK_LIB([netfilter_queue], [nfq_set_verdict2],AC_DEFINE_UNQUOTED([HAVE_NFQ_SET_VERDICT2],[1],[Found nfq_set_verdict2 function in netfilter_queue]) ,,[-lnfnetlink])
+
+ # check if the argument to nfq_get_payload is signed or unsigned
+ AC_MSG_CHECKING([for signed nfq_get_payload payload argument])
+ STORECFLAGS="${CFLAGS}"
+ CFLAGS="${CFLAGS} -Werror"
+ AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[
#include <libnetfilter_queue/libnetfilter_queue.h>
])],
[libnetfilter_queue_nfq_get_payload_signed="yes"],
[libnetfilter_queue_nfq_get_payload_signed="no"])
- AC_MSG_RESULT($libnetfilter_queue_nfq_get_payload_signed)
- if test "x$libnetfilter_queue_nfq_get_payload_signed" = "xyes"; then
- AC_DEFINE([NFQ_GET_PAYLOAD_SIGNED], [], [For signed version of nfq_get_payload])
- fi
- CFLAGS="${STORECFLAGS}"
-;;
-esac
+ AC_MSG_RESULT($libnetfilter_queue_nfq_get_payload_signed)
+ if test "x$libnetfilter_queue_nfq_get_payload_signed" = "xyes"; then
+ AC_DEFINE([NFQ_GET_PAYLOAD_SIGNED], [], [For signed version of nfq_get_payload])
+ fi
+ CFLAGS="${STORECFLAGS}"
+ ;;
+ esac
if test "$NFQ" = "no"; then
- echo
- echo " ERROR! libnetfilter_queue library not found, go get it"
- echo " from www.netfilter.org."
- echo " we automatically append libnetfilter_queue/ when searching"
- echo " for headers etc. when the --with-libnfq-includes directive"
- echo " is used"
- echo
- exit 1
+ echo
+ echo " ERROR! libnetfilter_queue library not found, go get it"
+ echo " from www.netfilter.org."
+ echo " we automatically append libnetfilter_queue/ when searching"
+ echo " for headers etc. when the --with-libnfq-includes directive"
+ echo " is used"
+ echo
+ exit 1
fi
-])
-#enable support for IPFW
- AC_ARG_ENABLE(ipfw,
- AS_HELP_STRING([--enable-ipfw], [Enable FreeBSD IPFW support for inline IDP]),,[enable_ipfw=no])
- AS_IF([test "x$enable_ipfw" = "xyes"], [
- CFLAGS="$CFLAGS -DIPFW"
- ])
+ ])
-#prelude
+ # prelude
AC_ARG_ENABLE(prelude,
AS_HELP_STRING([--enable-prelude], [Enable Prelude support for alerts]),,[enable_prelude=no])
AS_IF([test "x$enable_prelude" = "xyes"], [
fi
])
-#libnet
+ # libnet
AC_ARG_WITH(libnet_includes,
[ --with-libnet-includes=DIR libnet include directory],
[with_libnet_includes="$withval"],[with_libnet_includes="no"])
LIBNET_DETECT_FAIL="yes"
LIBNET_FAIL_WARN($libnet_dir)
fi
-# libpfring (currently only supported for libpcap enabled pfring)
-# Error on the side of caution. If libpfring enabled pcap is being used and we don't link against -lpfring compilation will fail.
+ # libpfring (currently only supported for libpcap enabled pfring)
+ # Error on the side of caution. If libpfring enabled pcap is being used and we don't link against -lpfring compilation will fail.
AC_ARG_ENABLE(pfring,
AS_HELP_STRING([--enable-pfring], [Enable Native PF_RING support]),,[enable_pfring=no])
AS_IF([test "x$enable_pfring" = "xyes"], [
CFLAGS="$CFLAGS -DHAVE_PFRING"
-#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,
[ --with-libpfring-includes=DIR libpfring include directory],
[with_libpfring_includes="$withval"],[with_libpfring_includes=no])
])
-# libpcap
+ # libpcap
AC_ARG_WITH(libpcap_includes,
[ --with-libpcap-includes=DIR libpcap include directory],
[with_libpcap_includes="$withval"],[with_libpcap_includes=no])
[with_libpcap_libraries="$withval"],[with_libpcap_libraries="no"])
if test "$with_libpcap_includes" != "no"; then
- CPPFLAGS="${CPPFLAGS} -I${with_libpcap_includes}"
+ CPPFLAGS="${CPPFLAGS} -I${with_libpcap_includes}"
fi
-AC_CHECK_HEADER(pcap.h,,[AC_ERROR(pcap.h not found ...)])
+ AC_CHECK_HEADER(pcap.h,,[AC_ERROR(pcap.h not found ...)])
if test "$with_libpcap_libraries" != "no"; then
- LDFLAGS="${LDFLAGS} -L${with_libpcap_libraries}"
+ LDFLAGS="${LDFLAGS} -L${with_libpcap_libraries}"
fi
LIBPCAP=""
AC_CHECK_LIB(pcap, pcap_open_live,, LIBPCAP="no")
if test "$LIBPCAP" = "no"; then
- echo
- echo " ERROR! libpcap library not found, go get it"
- echo " from http://www.tcpdump.org."
- echo
- exit 1
+ echo
+ echo " ERROR! libpcap library not found, go get it"
+ echo " from http://www.tcpdump.org or your distribution:"
+ echo
+ echo " Ubuntu: apt-get install libpcap-dev"
+ echo " Fedora: yum install libpcap-devel"
+ echo
+ exit 1
fi
-# pcap_activate and pcap_create only exists in libpcap >= 1.0
+ # pcap_activate and pcap_create only exists in libpcap >= 1.0
LIBPCAPVTEST=""
-#To prevent duping the lib link we reset LIBS after this check. Setting action-if-found to NULL doesn't seem to work
-#see: http://blog.flameeyes.eu/2008/04/29/i-consider-ac_check_lib-harmful
+ #To prevent duping the lib link we reset LIBS after this check. Setting action-if-found to NULL doesn't seem to work
+ #see: http://blog.flameeyes.eu/2008/04/29/i-consider-ac_check_lib-harmful
TMPLIBS="${LIBS}"
AC_CHECK_LIB(pcap, pcap_activate,, LPCAPVTEST="no")
if test "$LPCAPVTEST" != "no"; then
- CFLAGS="${CFLAGS} `pcap-config --defines` `pcap-config --cflags` -DLIBPCAP_VERSION_MAJOR=1"
+ CFLAGS="${CFLAGS} `pcap-config --defines` `pcap-config --cflags` -DLIBPCAP_VERSION_MAJOR=1"
else
- CFLAGS="${CFLAGS} -DLIBPCAP_VERSION_MAJOR=0"
+ CFLAGS="${CFLAGS} -DLIBPCAP_VERSION_MAJOR=0"
fi
LIBS="${TMPLIBS}"
-#Appears as if pcap_set_buffer_size is linux only?
+ #Appears as if pcap_set_buffer_size is linux only?
LIBPCAPSBUFF=""
-#To prevent duping the lib link we reset LIBS after this check. Setting action-if-found to NULL doesn't seem to work
-#see: http://blog.flameeyes.eu/2008/04/29/i-consider-ac_check_lib-harmful
+ #To prevent duping the lib link we reset LIBS after this check. Setting action-if-found to NULL doesn't seem to work
+ #see: http://blog.flameeyes.eu/2008/04/29/i-consider-ac_check_lib-harmful
TMPLIBS="${LIBS}"
AC_CHECK_LIB(pcap, pcap_set_buffer_size,, LPCAPSBUFF="no")
if test "$LPCAPSBUFF" != "no"; then
- CFLAGS="${CFLAGS} -DHAVE_PCAP_SET_BUFF"
+ CFLAGS="${CFLAGS} -DHAVE_PCAP_SET_BUFF"
fi
LIBS="${TMPLIBS}"
-# enable the running of unit tests
- AC_ARG_ENABLE(unittests,
- AS_HELP_STRING([--enable-unittests], [Enable compilation of the unit tests]),,[enable_unittests=no])
- AS_IF([test "x$enable_unittests" = "xyes"], [
- UT_ENABLED="yes"
- CFLAGS="${CFLAGS} -DUNITTESTS"
- ])
-
- AM_CONDITIONAL([BUILD_UNITTESTS], [test "x$enable_unittests" = "xyes"])
-
-# AF_PACKET support
+ # AF_PACKET support
AC_ARG_ENABLE(af-packet,
AS_HELP_STRING([--enable-af-packet], [Enable AF_PACKET support [default=yes]]),
,[enable_af_packet=yes])
])
-# enable workaround for old barnyard2 for unified alert output
- AC_ARG_ENABLE(old-barnyard2,
- 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"], [
- CFLAGS="${CFLAGS} -DHAVE_OLD_BARNYARD2"
- ])
-
-# enable debug output
- AC_ARG_ENABLE(debug,
- AS_HELP_STRING([--enable-debug], [Enable debug output]),,[enable_debug=no])
- AS_IF([test "x$enable_debug" = "xyes"], [
- CFLAGS="${CFLAGS} -DDEBUG"
- ])
-
-# enable debug validation functions & macro's output
- AC_ARG_ENABLE(debug-validation,
- AS_HELP_STRING([--enable-debug-validation], [Enable (debug) validation code output]),,[enable_debug_validation=no])
- AS_IF([test "x$enable_debug_validation" = "xyes"], [
- CFLAGS="${CFLAGS} -DDEBUG_VALIDATION"
- ])
-
-#libhtp
+ # libhtp
AC_ARG_ENABLE(non-bundled-htp,
AS_HELP_STRING([--enable-non-bundled-htp], [Enable the use of an already installed version of htp]),,[enable_non_bundled_htp=no])
AS_IF([test "x$enable_non_bundled_htp" = "xyes"], [
[with_libhtp_libraries="$withval"],[with_libhtp_libraries="no"])
if test "$with_libhtp_includes" != "no"; then
- CPPFLAGS="${CPPFLAGS} -I${with_libhtp_includes}"
+ CPPFLAGS="${CPPFLAGS} -I${with_libhtp_includes}"
fi
if test "$with_libhtp_libraries" != "no"; then
- LDFLAGS="${LDFLAGS} -L${with_libhtp_libraries}"
+ LDFLAGS="${LDFLAGS} -L${with_libhtp_libraries}"
fi
AC_CHECK_HEADER(htp/htp.h,,[AC_ERROR(htp/htp.h not found ...)])
LIBHTP=""
AC_CHECK_LIB(htp, htp_conn_create,, LIBHTP="no")
if test "$LIBHTP" = "no"; then
- echo
- echo " ERROR! libhtp library not found"
- echo
- exit 1
+ echo
+ echo " ERROR! libhtp library not found"
+ echo
+ exit 1
fi
PKG_CHECK_MODULES(LIBHTPMINVERSION, htp >= 0.2.3,[libhtp_minver_found="yes"],[libhtp_minver_found="no"])
if test "$libhtp_minver_found" = "no"; then
- echo
- echo " ERROR! libhtp was found but is not the minimum version required >=0.2.3"
- echo
- exit 1
+ echo
+ echo " ERROR! libhtp was found but is not the minimum version required >=0.2.3"
+ echo
+ exit 1
fi
AC_CHECK_LIB([htp], [htp_config_register_request_uri_normalize],AC_DEFINE_UNQUOTED([HAVE_HTP_URI_NORMALIZE_HOOK],[1],[Found htp_config_register_request_uri_normalize function in libhtp]) ,,[-lhtp])
])
- #even if we are using an installed htp lib we still need to gen Makefiles inside of htp
+ # even if we are using an installed htp lib we still need to gen Makefiles inside of htp
AC_CONFIG_SUBDIRS([libhtp])
AM_CONDITIONAL([BUILD_LIBHTP], [test "x$enable_non_bundled_htp" = "xno"])
AS_IF([test "x$enable_non_bundled_htp" = "xno"], [
])
-# enable CUDA output
+ # enable CUDA output
AC_ARG_ENABLE(cuda,
AS_HELP_STRING([--enable-cuda], [Enable experimental CUDA pattern matching]),,[enable_cuda=no])
AS_IF([test "x$enable_cuda" = "xyes"], [
])
AM_CONDITIONAL([BUILD_CUDA], [test "x$enable_cuda" = "xyes"])
-# Check for libcap-ng
+ # Check for libcap-ng
AC_ARG_WITH(libcap_ng_includes,
[ --with-libcap_ng-includes=DIR libcap_ng include directory],
[with_libcap-ng_includes="$withval"],[with_libcap_ng_includes=no])
[with_libcap_ng_libraries="$withval"],[with_libcap_ng_libraries="no"])
if test "$with_libcap_ng_includes" != "no"; then
- CPPFLAGS="${CPPFLAGS} -I${with_libcap_ng_includes}"
+ CPPFLAGS="${CPPFLAGS} -I${with_libcap_ng_includes}"
fi
if test "$with_libcap_ng_libraries" != "no"; then
- LDFLAGS="${LDFLAGS} -L${with_libcap_ng_libraries}"
+ LDFLAGS="${LDFLAGS} -L${with_libcap_ng_libraries}"
fi
AC_CHECK_HEADER(cap-ng.h,,LIBCAP_NG="no")
fi
if test "$LIBCAP_NG" = "no"; then
- echo
- echo " WARNING! libcap-ng library not found, go get it"
- echo " from http://people.redhat.com/sgrubb/libcap-ng/"
- echo " or check your package manager."
- echo
- echo " Suricata will be built without support for dropping privs."
- echo
+ echo
+ echo " WARNING! libcap-ng library not found, go get it"
+ echo " from http://people.redhat.com/sgrubb/libcap-ng/"
+ echo " or your distribution:"
+ echo
+ echo " Ubuntu: apt-get install libcap-ng-dev"
+ echo " Fedora: yum install libcap-ng-devel"
+ echo
+ echo " Suricata will be built without support for dropping privs."
+ echo
fi
- AC_ARG_ENABLE(profiling,
- AS_HELP_STRING([--enable-profiling], [Enable performance profiling]),,[enable_profiling=no])
- AS_IF([test "x$enable_profiling" = "xyes"], [
- CFLAGS="${CFLAGS} -DPROFILING"
- ])
-
-# Check for DAG support.
+ # Check for DAG support.
AC_ARG_ENABLE(dag,
[ --enable-dag Enable DAG capture],
[ enable_dag=yes ],
fi
fi
-#libnspr
+ # libnspr
+ enable_nspr = "no"
AC_ARG_WITH(libnspr_includes,
[ --with-libnspr-includes=DIR libnspr include directory],
[with_libnspr_includes="$withval"],[with_libnspr_includes=no])
if test "$NSPR" = "no"; then
echo
echo " ERROR! libnspr library not found, go get it"
- echo " from Mozilla."
+ echo " from Mozilla or your distribution:"
+ echo
+ echo " Ubuntu: apt-get install libnspr4-dev"
+ echo " Fedora: yum install nspr-devel"
echo
exit 1
fi
+ enable_nspr = "yes"
fi
-#libnss
+ # libnss
+ enable_nss = "no"
AC_ARG_WITH(libnss_includes,
[ --with-libnss-includes=DIR libnss include directory],
[with_libnss_includes="$withval"],[with_libnss_includes=no])
if test "$NSS" = "no"; then
echo
echo " ERROR! libnss library not found, go get it"
- echo " from Mozilla."
+ echo " from Mozilla or your distribution:"
+ echo
+ echo " Ubuntu: apt-get install libnss3-dev"
+ echo " Fedora: yum install nss-devel"
echo
exit 1
fi
AC_DEFINE([HAVE_NSS],[1],[libnss available for md5])
+ enable_nss = "yes"
fi
-#libmagic
+ # libmagic
AC_ARG_WITH(libmagic_includes,
[ --with-libmagic-includes=DIR libmagic include directory],
[with_libmagic_includes="$withval"],[with_libmagic_includes=no])
if test "$MAGIC" = "no"; then
echo
echo " ERROR! magic library not found, go get it"
- echo " from http://www.darwinsys.com/file/."
+ echo " from http://www.darwinsys.com/file/ or your distribution:"
+ echo
+ echo " Ubuntu: apt-get install libmagic-dev"
+ echo " Fedora: yum install file-devel"
echo
exit 1
fi
-# Check for Napatech support.
-
+ # Check for Napatech support.
AC_ARG_ENABLE(napatech,
[ --enable-napatech Enable Napatech adapter],
[ enable_napatech=yes ],
if test "$NAPATECH" != "no"; then
NAPATECH=""
AC_CHECK_LIB(ntcommoninterface,NTCI_OpenCard,NAPATECH="yes",NAPATECH="no")
-#AC_CHECK_LIB(ntfeeds,napatech_open,NAPATECH="yes",NAPATECH="no")
+ #AC_CHECK_LIB(ntfeeds,napatech_open,NAPATECH="yes",NAPATECH="no")
fi
if test "$NAPATECH" != "no"; then
DAG enabled: ${enable_dag}
Napatech enabled: ${enable_napatech}
+ libnss support: ${enable_nss}
+ libnspr support: ${enable_nspr}
Prelude support: ${enable_prelude}
PCRE jit: ${pcre_jit_available}
Non-bundled htp: ${enable_non_bundled_htp}