diff --git a/configure.in b/configure.in index f682e71161..dc8d6e0c2a 100644 --- a/configure.in +++ b/configure.in @@ -666,6 +666,8 @@ AC_CHECK_HEADER(pcap.h,,[AC_ERROR(pcap.h not found ...)]) CFLAGS="${CFLAGS} -DUNITTESTS" ]) + AM_CONDITIONAL([BUILD_UNITTESTS], [test "x$enable_unittests" = "xyes"]) + # enable native timeval for unified alert output AC_ARG_ENABLE(unified-native-timeval, AS_HELP_STRING([--enable-unified-native-timeval], [Use native timeval for unified outputs]),,[enable_unified_native_timeval=no]) diff --git a/src/Makefile.am b/src/Makefile.am index a494c6859b..7ea6766f58 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -253,3 +253,7 @@ endif #suricata_CFLAGS = -Wall -fno-strict-aliasing +if BUILD_UNITTESTS +check: + $(top_builddir)/src/suricata -u -c $(top_srcdir)/suricata.yaml +endif