]> git.ipfire.org Git - people/ms/suricata.git/blame - configure.ac
install: install all files for events rules
[people/ms/suricata.git] / configure.ac
CommitLineData
0795dc1e 1 AC_INIT([suricata],[5.0.0-dev])
d258a11f 2 m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])AM_SILENT_RULES([yes])
83014adc 3 AC_CONFIG_HEADERS([config.h])
7dbc97b0 4 AC_CONFIG_SRCDIR([src/suricata.c])
0cef0b88 5 AC_CONFIG_MACRO_DIR(m4)
7dbc97b0 6 AM_INIT_AUTOMAKE
a3510f20 7
0795dc1e 8 AC_LANG([C])
ff6a2a01 9 AC_PROG_CC_C99
0795dc1e 10 LT_INIT
119115d3 11 PKG_PROG_PKG_CONFIG
a3510f20 12
ba81c4d2
VJ
13 dnl Taken from https://llvm.org/svn/llvm-project/llvm/trunk/autoconf/configure.ac
14 dnl check if we compile using clang or gcc. On some systems the gcc binary is
15 dnl is actually clang, so do a compile test.
16 AC_MSG_CHECKING([whether GCC or Clang is our compiler])
17 AC_LANG_PUSH([C])
18 compiler=unknown
19 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#if ! __clang__
20 #error
21 #endif
22 ]])],
23 compiler=clang,
24 [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#if ! __GNUC__
25 #error
26 #endif
27 ]])],
28 compiler=gcc, [])])
29 AC_LANG_POP([C])
30 AC_MSG_RESULT([${compiler}])
31
e3f00c3d
HB
32 AC_ARG_WITH([clang],
33 [ --with-clang=PROGRAM path to Clang for compiling eBPF code. Use if the main C compiler is not Clang.],
34 [CLANG="$withval"],
35 [AS_IF([test "$compiler" = clang],
36 [CLANG="$CC"],
37 [AC_PATH_PROG([CLANG],[clang])])])
38
39 AC_SUBST([CLANG])
40
ba81c4d2
VJ
41 case "$compiler" in
42 clang)
9858ae41 43 CLANG_CFLAGS="-Wextra -Werror-implicit-function-declaration -Wno-error=unused-command-line-argument"
ba81c4d2 44 AC_MSG_CHECKING([clang __sync_bool_compare_and_swap support])
0795dc1e
AH
45 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]],
46 [[ unsigned int i = 0; (void)__sync_bool_compare_and_swap(&i, 1, 1);]])],
467f28e9
VJ
47 [
48 AC_DEFINE([__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1], [1], [Fake GCC atomic support])
49 AC_DEFINE([__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2], [1], [Fake GCC atomic support])
50 AC_DEFINE([__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], [1], [Fake GCC atomic support])
51 AC_DEFINE([__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8], [1], [Fake GCC atomic support])
0795dc1e 52 AC_MSG_RESULT([yes])],
467f28e9 53 [AC_MSG_RESULT([no])])
ba81c4d2
VJ
54 AC_SUBST(CLANG_CFLAGS)
55 ;;
56 gcc)
57 dnl get gcc version
58 AC_MSG_CHECKING([gcc version])
59 gccver=$($CC -dumpversion)
60 gccvermajor=$(echo $gccver | cut -d . -f1)
61 gccverminor=$(echo $gccver | cut -d . -f2)
62 gccvernum=$(expr $gccvermajor "*" 100 + $gccverminor)
63 AC_MSG_RESULT($gccver)
64
65 if test "$gccvernum" -ge "400"; then
1f94239d 66 dnl gcc 4.0 or later
ba81c4d2 67 GCC_CFLAGS="-Wextra -Werror-implicit-function-declaration"
ba81c4d2
VJ
68 else
69 GCC_CFLAGS="-W"
70 fi
71 AC_SUBST(GCC_CFLAGS)
72 ;;
73 *)
74 AC_MSG_WARN([unsupported/untested compiler, this may or may not work])
75 ;;
76 esac
0ffa1c24 77
89cee0ad 78 # Checks for programs.
fa5939ca
BR
79 AC_PROG_AWK
80 AC_PROG_CC
81 AC_PROG_CPP
82 AC_PROG_INSTALL
83 AC_PROG_LN_S
84 AC_PROG_MAKE_SET
91e1256b 85 AC_PROG_GREP
fa5939ca 86
24d6a164
VJ
87 AC_PATH_PROG(HAVE_CYGPATH, cygpath, "no")
88 AM_CONDITIONAL([HAVE_CYGPATH], [test "x$enable_cygpath" = "xyes"])
89
9f1d779a
WM
90 AC_PATH_PROG(HAVE_PKG_CONFIG, pkg-config, "no")
91 if test "$HAVE_PKG_CONFIG" = "no"; then
89cee0ad
VJ
92 echo
93 echo " ERROR! pkg-config not found, go get it "
94 echo " http://pkg-config.freedesktop.org/wiki/ "
95 echo " or install from your distribution "
96 echo
97 exit 1
9f1d779a
WM
98 fi
99
a228986c
JI
100 python_version="not set"
101 python_path="not set"
102
dc1bd5b6 103 AC_ARG_ENABLE(python,
a228986c
JI
104 AS_HELP_STRING([--enable-python], [Enable python]),
105 [enable_python=$enableval],[enable_python=yes])
106 if test "x$enable_python" != "xyes"; then
cd305c3a 107 enable_python="no"
a228986c
JI
108 else
109 AC_PATH_PROGS(HAVE_PYTHON, python3 python2.7 python2 python, "no")
110 if test "$HAVE_PYTHON" = "no"; then
111 echo
112 echo " Warning! python not found, you will not be "
113 echo " able to install suricatasc unix socket client "
114 echo
115 enable_python="no"
116 else
117 python_path="$HAVE_PYTHON"
118 python_version="$($HAVE_PYTHON --version)"
119 fi
cd305c3a 120 fi
dc1bd5b6 121 AM_CONDITIONAL([HAVE_PYTHON], [test "x$enable_python" = "xyes"])
cd305c3a 122
a69afd5c
JI
123 # Check for python-distutils (setup).
124 have_python_distutils="no"
125 if test "x$enable_python" = "xyes"; then
126 AC_MSG_CHECKING([for python-distutils])
127 if $HAVE_PYTHON -c "import distutils; from distutils.core import setup" 2>/dev/null; then
128 AC_MSG_RESULT([yes])
129 have_python_distutils="yes"
130 else
131 AC_MSG_RESULT([no])
132 fi
133 fi
134 AM_CONDITIONAL([HAVE_PYTHON_DISTUTILS],
135 [test "x$have_python_distutils" = "xyes"])
136 if test "$have_python_distutils" = "no"; then
137 echo ""
138 echo " Warning: Python distutils not found. Python tools will"
139 echo " not be installed."
140 echo ""
141 echo " Ubuntu/Debian: apt install `basename ${HAVE_PYTHON}`-distutils"
142 echo ""
143 fi
144
db367087
JI
145 # Check for python-yaml.
146 have_python_yaml="no"
147 if test "x$enable_python" = "xyes"; then
148 AC_MSG_CHECKING([for python-yaml])
149 if $HAVE_PYTHON -c "import yaml" 2>/dev/null; then
150 have_python_yaml="yes"
151 AC_MSG_RESULT([yes])
152 else
153 AC_MSG_RESULT([no])
154 fi
155 fi
156 AM_CONDITIONAL([HAVE_PYTHON_YAML], [test "x$have_python_yaml" = "xyes"])
157
daa9dcb7
EL
158 AC_PATH_PROG(HAVE_WGET, wget, "no")
159 if test "$HAVE_WGET" = "no"; then
160 AC_PATH_PROG(HAVE_CURL, curl, "no")
161 if test "$HAVE_CURL" = "no"; then
162 echo
163 echo " Warning curl or wget not found, you won't be able to"
164 echo " download latest ruleset with 'make install-rules'"
165 fi
166 fi
167 AM_CONDITIONAL([HAVE_FETCH_COMMAND], [test "x$HAVE_WGET" != "xno" || test "x$HAVE_CURL" != "xno"])
168 AM_CONDITIONAL([HAVE_WGET_COMMAND], [test "x$HAVE_WGET" != "xno"])
7c841e1d 169
89cee0ad 170 # Checks for libraries.
7c841e1d 171
89cee0ad 172 # Checks for header files.
4086938f 173 AC_CHECK_HEADERS([stddef.h])
472e061c
VJ
174 AC_CHECK_HEADERS([arpa/inet.h assert.h ctype.h errno.h fcntl.h inttypes.h])
175 AC_CHECK_HEADERS([getopt.h])
176 AC_CHECK_HEADERS([limits.h netdb.h netinet/in.h poll.h sched.h signal.h])
2c01985e 177 AC_CHECK_HEADERS([stdarg.h stdint.h stdio.h stdlib.h stdbool.h string.h strings.h sys/ioctl.h])
472e061c 178 AC_CHECK_HEADERS([syslog.h sys/prctl.h sys/socket.h sys/stat.h sys/syscall.h])
b63c2eda 179 AC_CHECK_HEADERS([sys/time.h time.h unistd.h])
472e061c 180 AC_CHECK_HEADERS([sys/ioctl.h linux/if_ether.h linux/if_packet.h linux/filter.h])
fcc87595 181 AC_CHECK_HEADERS([linux/ethtool.h linux/sockios.h])
2a237bdf 182 AC_CHECK_HEADERS([glob.h])
bbb93e48 183 AC_CHECK_HEADERS([dirent.h fnmatch.h])
c02739e5 184 AC_CHECK_HEADERS([sys/resource.h sys/types.h sys/un.h])
9b94679f 185 AC_CHECK_HEADERS([sys/random.h])
dbdac737 186 AC_CHECK_HEADERS([utime.h])
6ffa0507 187 AC_CHECK_HEADERS([libgen.h])
472e061c
VJ
188
189 AC_CHECK_HEADERS([sys/socket.h net/if.h sys/mman.h linux/if_arp.h], [], [],
5656e344 190 [[#ifdef HAVE_SYS_SOCKET_H
472e061c
VJ
191 #include <sys/types.h>
192 #include <sys/socket.h>
193 #endif
5656e344
EL
194 ]])
195
d1b6be99 196 AC_CHECK_HEADERS([windows.h winsock2.h ws2tcpip.h w32api/wtypes.h], [], [],
06f9b0ad
VJ
197 [[
198 #ifndef _X86_
199 #define _X86_
200 #endif
b63c2eda 201 ]])
d1b6be99 202 AC_CHECK_HEADERS([w32api/winbase.h wincrypt.h], [], [],
06f9b0ad
VJ
203 [[
204 #ifndef _X86_
205 #define _X86_
206 #endif
207 #include <windows.h>
b63c2eda 208 ]])
fa5939ca 209
89cee0ad 210 # Checks for typedefs, structures, and compiler characteristics.
fa5939ca
BR
211 AC_C_INLINE
212 AC_TYPE_PID_T
213 AC_TYPE_SIZE_T
214 AC_TYPE_INT32_T
215 AC_TYPE_UINT16_T
216 AC_TYPE_UINT32_T
217 AC_TYPE_UINT64_T
218 AC_TYPE_UINT8_T
219 AC_HEADER_STDBOOL
220
89cee0ad 221 # Checks for library functions.
fa5939ca
BR
222 AC_FUNC_MALLOC
223 AC_FUNC_REALLOC
d1525c6f 224 AC_CHECK_FUNCS([gettimeofday memset strcasecmp strchr strdup strndup strerror strncasecmp strtol strtoul memchr memrchr clock_gettime])
46cb00ec 225 AC_CHECK_FUNCS([strptime])
ba81c4d2 226
9b94679f
VJ
227 AC_CHECK_DECL([getrandom],
228 AC_DEFINE([HAVE_GETRANDOM], [1], [Use getrandom]),
229 [], [
230 #include <sys/random.h>
231 ])
232
dbdac737
JI
233 AC_CHECK_FUNCS([utime])
234
ba81c4d2
VJ
235 OCFLAGS=$CFLAGS
236 CFLAGS=""
8e946b92 237 AC_CHECK_FUNCS([strlcpy strlcat])
ba81c4d2 238 CFLAGS=$OCFLAGS
fa5939ca 239
89cee0ad 240 # Add large file support
3b3f5816
WM
241 AC_SYS_LARGEFILE
242
89cee0ad 243 #check for os
769022f4
PR
244 AC_MSG_CHECKING([host os])
245
7396237c
VJ
246 # lua pkg-config name differs per OS
247 LUA_PC_NAME="lua5.1"
248 LUA_LIB_NAME="lua5.1"
249
769022f4 250 # If no host os was detected, try with uname
25804f5a 251 if test -z "$host" ; then
769022f4
PR
252 host="`uname`"
253 fi
a49bce63 254 echo -n "installation for $host OS... "
769022f4 255
48566358
VJ
256 RUST_SURICATA_LIBNAME="libsuricata.a"
257
15c98c60
AH
258 e_magic_file=""
259 e_magic_file_comment="#"
d1e839ea 260 PCAP_LIB_NAME="pcap"
769022f4 261 case "$host" in
829238e4 262 *-*-*freebsd*)
7396237c
VJ
263 LUA_PC_NAME="lua-5.1"
264 LUA_LIB_NAME="lua-5.1"
829238e4
VJ
265 CFLAGS="${CFLAGS} -DOS_FREEBSD"
266 CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/local/include/libnet11"
267 LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/usr/local/lib/libnet11"
48566358 268 RUST_LDADD="-lrt -lm"
829238e4 269 ;;
829238e4 270 *-*-openbsd*)
7396237c 271 LUA_PC_NAME="lua51"
ddf9b417 272 CFLAGS="${CFLAGS} -D__OpenBSD__"
829238e4
VJ
273 CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/local/include/libnet-1.1"
274 LDFLAGS="${LDFLAGS} -L/usr/local/lib -I/usr/local/lib/libnet-1.1"
8a2b94c6 275 RUST_LDADD="-lm -lc++ -lc++abi"
829238e4
VJ
276 ;;
277 *darwin*|*Darwin*)
1177d489
VJ
278 LUA_PC_NAME="lua-5.1"
279 LUA_LIB_NAME="lua-5.1"
829238e4
VJ
280 CFLAGS="${CFLAGS} -DOS_DARWIN"
281 CPPFLAGS="${CPPFLAGS} -I/opt/local/include"
282 LDFLAGS="${LDFLAGS} -L/opt/local/lib"
283 ;;
284 *-*-linux*)
56d93f42 285 RUST_LDADD="-ldl -lrt -lm"
829238e4 286 ;;
bae83e61 287 *-*-mingw32*|*-*-msys)
829238e4 288 CFLAGS="${CFLAGS} -DOS_WIN32"
ec77632e 289 LDFLAGS="${LDFLAGS} -lws2_32 -liphlpapi -lwbemuuid -lOle32 -lOleAut32 -lUuid"
829238e4 290 WINDOWS_PATH="yes"
d1e839ea 291 PCAP_LIB_NAME="wpcap"
d8ddd3b5 292 AC_DEFINE([HAVE_NON_POSIX_MKDIR], [1], [mkdir is not POSIX compliant: single arg])
48566358
VJ
293 RUST_SURICATA_LIBNAME="suricata.lib"
294 RUST_LDADD="-luserenv -lshell32 -ladvapi32 -lgcc_eh"
829238e4
VJ
295 ;;
296 *-*-cygwin)
43c5b949
VJ
297 LUA_PC_NAME="lua"
298 LUA_LIB_NAME="lua"
829238e4 299 WINDOWS_PATH="yes"
d1e839ea 300 PCAP_LIB_NAME="wpcap"
829238e4 301 ;;
7847c4f8
VJ
302 *-*-solaris*)
303 AC_MSG_WARN([support for Solaris/Illumos/SunOS is experimental])
304 LDFLAGS="${LDFLAGS} -lsocket -lnsl"
305 ;;
829238e4
VJ
306 *)
307 AC_MSG_WARN([unsupported OS this may or may not work])
308 ;;
769022f4
PR
309 esac
310 AC_MSG_RESULT(ok)
311
faad6bd3
VJ
312 # enable modifications for AFL fuzzing
313 AC_ARG_ENABLE(afl,
314 AS_HELP_STRING([--enable-afl], Enable AFL fuzzing logic[])], [enable_afl="$enableval"],[enable_afl=no])
315
316 AS_IF([test "x$enable_afl" = "xyes"], [
317 AC_DEFINE([AFLFUZZ_NO_RANDOM], [1], [Disable all use of random functions])
318 AC_DEFINE([AFLFUZZ_DISABLE_MGTTHREADS], [1], [Disable all management threads])
319 AC_DEFINE([AFLFUZZ_PCAP_RUNMODE], [1], [Enable special AFL 'single' runmode])
320 AC_DEFINE([AFLFUZZ_CONF_TEST], [1], [Enable special --afl-parse-rules commandline option])
321 AC_DEFINE([AFLFUZZ_APPLAYER], [1], [Enable --afl-$proto-request commandline option])
322 AC_DEFINE([AFLFUZZ_MIME], [1], [Enable --afl-mime commandline option])
323 AC_DEFINE([AFLFUZZ_DECODER], [1], [Enable --afl-decoder-$proto commandline option])
324 AC_DEFINE([AFLFUZZ_DER], [1], [Enable --afl-der commandline option])
1c8775b3 325 AC_DEFINE([AFLFUZZ_RULES], [1], [Enable --afl-rules commandline option])
faad6bd3
VJ
326
327 # test for AFL PERSISTANT_MODE support
328 CFLAGS_ORIG=$CFLAGS
329 CFLAGS="-Werror"
330 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[while (__AFL_LOOP(1000))]])],
331 [AC_DEFINE([AFLFUZZ_PERSISTANT_MODE], [1], [Enable AFL PERSISTANT_MODE])],
332 [])
333 CFLAGS=$CFLAGS_ORIG
334 ])
335
6fa8922c
VJ
336 # disable TLS on user request
337 AC_ARG_ENABLE(threading-tls,
2a17e3e8 338 AS_HELP_STRING([--disable-threading-tls], [Disable TLS (thread local storage)]), [enable_tls="$enableval"],[enable_tls=yes])
6fa8922c
VJ
339 AS_IF([test "x$enable_tls" = "xyes"], [
340 # check if our target supports thread local storage
341 AC_MSG_CHECKING(for thread local storage __thread support)
0795dc1e
AH
342 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>]],
343 [[ static __thread int i; i = 1; i++; ]])],
6fa8922c 344 [AC_DEFINE([TLS], [1], [Thread local storage])
0795dc1e 345 AC_MSG_RESULT([yes])],
6fa8922c
VJ
346 [AC_MSG_RESULT([no])])
347 ])
900918a5 348
89cee0ad
VJ
349 #Enable support for gcc compile time security options. There is no great way to do detection of valid cflags that I have found
350 #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.
351 #These flags seem to be supported on CentOS 5+, Ubuntu 8.04+, and FedoreCore 11+
352 #Options are taken from https://wiki.ubuntu.com/CompilerFlags
c49785fb 353 AC_ARG_ENABLE(gccprotect,
d01ce2e5 354 AS_HELP_STRING([--enable-gccprotect], [Detect and use gcc hardening options]),[enable_gccprotect=$enableval],[enable_gccprotect=no])
c49785fb 355
e07e9e16 356 AS_IF([test "x$enable_gccprotect" = "xyes"], [
98b9009b
WM
357 #buffer overflow protection
358 AC_MSG_CHECKING(for -fstack-protector)
359 TMPCFLAGS="${CFLAGS}"
360 CFLAGS="${CFLAGS} -fstack-protector"
0795dc1e
AH
361 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[SECCFLAGS="-fstack-protector"
362 AC_MSG_RESULT(yes)],
363 [AC_MSG_RESULT(no)])
98b9009b
WM
364 CFLAGS="${TMPCFLAGS}"
365
366 #compile-time best-practices errors for certain libc functions, provides checks of buffer lengths and memory regions
367 AC_MSG_CHECKING(for -D_FORTIFY_SOURCE=2)
368 TMPCFLAGS="${CFLAGS}"
369 CFLAGS="${CFLAGS} -D_FORTIFY_SOURCE=2"
0795dc1e
AH
370 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[SECCFLAGS="${SECCFLAGS} -D_FORTIFY_SOURCE=2"
371 AC_MSG_RESULT(yes)],
372 [AC_MSG_RESULT(no)])
98b9009b
WM
373 CFLAGS="${TMPCFLAGS}"
374
375 #compile-time warnings about misuse of format strings
376 AC_MSG_CHECKING(for -Wformat -Wformat-security)
377 TMPCFLAGS="${CFLAGS}"
378 CFLAGS="${CFLAGS} -Wformat -Wformat-security"
0795dc1e
AH
379 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[SECCFLAGS="${SECCFLAGS} -Wformat -Wformat-security"
380 AC_MSG_RESULT(yes)],
381 [AC_MSG_RESULT(no)])
98b9009b
WM
382 CFLAGS="${TMPCFLAGS}"
383
384 #provides a read-only relocation table area in the final ELF
385 AC_MSG_CHECKING(for -z relro)
386 TMPLDFLAGS="${LDFLAGS}"
387 LDFLAGS="${LDFLAGS} -z relro"
0795dc1e
AH
388 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[SECLDFLAGS="${SECLDFLAGS} -z relro"
389 AC_MSG_RESULT(yes)],
390 [AC_MSG_RESULT(no)])
98b9009b
WM
391 LDFLAGS="${TMPLDFLAGS}"
392
393 #forces all relocations to be resolved at run-time
394 AC_MSG_CHECKING(for -z now)
395 TMPLDFLAGS="${LDFLAGS}"
396 LDFLAGS="${LDFLAGS} -z now"
0795dc1e
AH
397 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[SECLDFLAGS="${SECLDFLAGS} -z now"
398 AC_MSG_RESULT(yes)],
399 [AC_MSG_RESULT(no)])
98b9009b
WM
400 LDFLAGS="${TMPLDFLAGS}"
401
ba81c4d2
VJ
402 AC_SUBST(SECCFLAGS)
403 AC_SUBST(SECLDFLAGS)
e07e9e16 404 ])
5bde1217 405
89cee0ad 406 #enable profile generation
5bde1217 407 AC_ARG_ENABLE(gccprofile,
d01ce2e5 408 AS_HELP_STRING([--enable-gccprofile], [Enable gcc profile info i.e -pg flag is set]),[enable_gccprofile=$enableval],[enable_gccprofile=no])
e07e9e16
WM
409 AS_IF([test "x$enable_gccprofile" = "xyes"], [
410 CFLAGS="${CFLAGS} -pg"
411 ])
5bde1217 412
89cee0ad 413 #enable gcc march=native gcc 4.2 or later
22f3e3d8 414 AC_ARG_ENABLE(gccmarch_native,
d01ce2e5 415 AS_HELP_STRING([--enable-gccmarch-native], [Enable gcc march=native gcc 4.2 and later only]),[enable_gccmarch_native=$enableval],[enable_gccmarch_native=yes])
e07e9e16 416 AS_IF([test "x$enable_gccmarch_native" = "xyes"], [
ffba26d0
VJ
417 case "$host" in
418 *powerpc*)
419 ;;
420 *)
37b05b23
EL
421 OFLAGS="$CFLAGS"
422 CFLAGS="$CFLAGS -march=native"
423 AC_MSG_CHECKING([checking if $CC supports -march=native])
424 AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include <stdlib.h>]])],
425 [
426 AC_MSG_RESULT([yes])
ba81c4d2
VJ
427 OPTIMIZATION_CFLAGS="-march=native"
428 AC_SUBST(OPTIMIZATION_CFLAGS)
37b05b23
EL
429 ],
430 [
431 AC_MSG_RESULT([no])
432 CFLAGS="$OFLAGS"
433 enable_gccmarch_native=no
434 ]
435 )
ffba26d0
VJ
436 ;;
437 esac
e07e9e16 438 ])
22f3e3d8 439
89cee0ad
VJ
440# options
441
442 # enable the running of unit tests
443 AC_ARG_ENABLE(unittests,
d01ce2e5 444 AS_HELP_STRING([--enable-unittests], [Enable compilation of the unit tests]),[enable_unittests=$enableval],[enable_unittests=no])
89cee0ad 445 AS_IF([test "x$enable_unittests" = "xyes"], [
ba81c4d2 446 AC_DEFINE([UNITTESTS],[1],[Enable built-in unittests])
89cee0ad 447 ])
89cee0ad
VJ
448 AM_CONDITIONAL([BUILD_UNITTESTS], [test "x$enable_unittests" = "xyes"])
449
91e1256b
EL
450 # enable the building of ebpf files
451 AC_ARG_ENABLE(ebpf-build,
d01ce2e5 452 AS_HELP_STRING([--enable-ebpf-build], [Enable compilation of ebpf files]),[enable_ebpf_build=$enableval],[enable_ebpf_build=no])
91e1256b
EL
453 AM_CONDITIONAL([BUILD_EBPF], [test "x$enable_ebpf_build" = "xyes"])
454
f105bb72
HB
455 AS_IF([test "x$enable_ebpf_build" = "xyes"],
456 [
457 AS_IF([test "$CLANG" != no],
458 [
459 llc_candidates=$($CLANG --version | \
460 awk '/^clang version/ {
461 split($3, v, ".");
462 printf("llc-%s.%s llc-%s llc", v[[1]], v[[2]], v[[1]])
463 }')
464 AC_CHECK_PROGS([LLC], [$llc_candidates], "no")
d14fe372
JI
465 if test "$LLC" = "no"; then
466 AC_MSG_ERROR([unable to find any of $llc_candidates needed to build ebpf files])
467 fi
468 AC_SUBST(LLC)
f105bb72
HB
469 ],
470 [AC_MSG_ERROR([clang needed to build ebpf files])])
471 ])
91e1256b 472
89cee0ad
VJ
473 # enable workaround for old barnyard2 for unified alert output
474 AC_ARG_ENABLE(old-barnyard2,
d01ce2e5 475 AS_HELP_STRING([--enable-old-barnyard2], [Use workaround for old barnyard2 in unified2 output]),[enable_old_barnyard2=$enableval],[enable_old_barnyard2=no])
89cee0ad 476 AS_IF([test "x$enable_old_barnyard2" = "xyes"], [
ba81c4d2 477 AC_DEFINE([HAVE_OLD_BARNYARD2],[1],[Use workaround for old barnyard2 in unified2 output])
89cee0ad
VJ
478 ])
479
480 # enable debug output
481 AC_ARG_ENABLE(debug,
d01ce2e5 482 AS_HELP_STRING([--enable-debug], [Enable debug output]),[enable_debug=$enableval],[enable_debug=no])
89cee0ad 483 AS_IF([test "x$enable_debug" = "xyes"], [
ba81c4d2 484 AC_DEFINE([DEBUG],[1],[Enable debug output])
89cee0ad 485 ])
ba81c4d2 486 AM_CONDITIONAL([DEBUG], [test "x$enable_debug" = "xyes"])
89cee0ad
VJ
487
488 # enable debug validation functions & macro's output
489 AC_ARG_ENABLE(debug-validation,
d01ce2e5 490 AS_HELP_STRING([--enable-debug-validation], [Enable (debug) validation code output]),[enable_debug_validation=$enableval],[enable_debug_validation=no])
89cee0ad 491 AS_IF([test "x$enable_debug_validation" = "xyes"], [
a18af732
AH
492 if test "$enable_unittests" = "yes"; then
493 AC_MSG_ERROR([debug_validation can't be enabled with enabled unittests!])
494 else
495 AC_DEFINE([DEBUG_VALIDATION],[1],[Enable (debug) validation code output])
496 fi
89cee0ad
VJ
497 ])
498
499 # profiling support
500 AC_ARG_ENABLE(profiling,
d01ce2e5 501 AS_HELP_STRING([--enable-profiling], [Enable performance profiling]),[enable_profiling=$enableval],[enable_profiling=no])
89cee0ad 502 AS_IF([test "x$enable_profiling" = "xyes"], [
ba81c4d2
VJ
503 case "$host" in
504 *-*-openbsd*)
505 AC_MSG_ERROR([profiling is not supported on OpenBSD])
506 ;;
507 *)
508 AC_DEFINE([PROFILING],[1],[Enable performance profiling])
509 ;;
510 esac
89cee0ad
VJ
511 ])
512
d908e707
VJ
513 # profiling support, locking
514 AC_ARG_ENABLE(profiling-locks,
d01ce2e5 515 AS_HELP_STRING([--enable-profiling-locks], [Enable performance profiling for locks]),[enable_profiling_locks=$enableval],[enable_profiling_locks=no])
d908e707 516 AS_IF([test "x$enable_profiling_locks" = "xyes"], [
ba81c4d2
VJ
517 AC_DEFINE([PROFILING],[1],[Enable performance profiling])
518 AC_DEFINE([PROFILE_LOCKING],[1],[Enable performance profiling for locks])
d908e707
VJ
519 ])
520
89cee0ad
VJ
521 # enable support for IPFW
522 AC_ARG_ENABLE(ipfw,
d01ce2e5 523 AS_HELP_STRING([--enable-ipfw], [Enable FreeBSD IPFW support for inline IDP]),[enable_ipfw=$enableval],[enable_ipfw=no])
89cee0ad 524 AS_IF([test "x$enable_ipfw" = "xyes"], [
ba81c4d2 525 AC_DEFINE([IPFW],[1],[Enable FreeBSD IPFW support for inline IDP])
89cee0ad
VJ
526 ])
527
7fb860ac 528 AC_ARG_ENABLE(coccinelle,
20dd5939 529 AS_HELP_STRING([--disable-coccinelle], [Disable coccinelle QA steps during make check]),[enable_coccinelle="$enableval"],[enable_coccinelle=yes])
7fb860ac
VJ
530 AS_IF([test "x$enable_coccinelle" = "xyes"], [
531 AC_PATH_PROG(HAVE_COCCINELLE_CONFIG, spatch, "no")
532 if test "$HAVE_COCCINELLE_CONFIG" = "no"; then
e4b39a41 533 enable_coccinelle=no
7fb860ac
VJ
534 fi
535 ])
536 AM_CONDITIONAL([HAVE_COCCINELLE], [test "x$enable_coccinelle" != "xno"])
537
f4872a2f
VJ
538 # disable detection
539 AC_ARG_ENABLE(detection,
20dd5939 540 AS_HELP_STRING([--disable-detection], [Disable Detection Modules]), [enable_detection="$enableval"],[enable_detection=yes])
f4872a2f 541 AS_IF([test "x$enable_detection" = "xno"], [
65d8ae93 542 AC_DEFINE([HAVE_DETECT_DISABLED], [1], [Detection is disabled])
f4872a2f
VJ
543 ])
544
89cee0ad
VJ
545# libraries
546
b60065ca
GL
547 # zlib
548 AC_ARG_WITH(zlib_includes,
549 [ --with-zlib-includes=DIR zlib include directory],
550 [with_zlib_includes="$withval"],[with_zlib_includes=no])
551 AC_ARG_WITH(zlib_libraries,
552 [ --with-zlib-libraries=DIR zlib library directory],
553 [with_zlib_libraries="$withval"],[with_zlib_libraries="no"])
554
555 if test "$with_zlib_includes" != "no"; then
556 CPPFLAGS="${CPPFLAGS} -I${with_zlib_includes}"
557 fi
558
559 AC_CHECK_HEADER(zlib.h, ZLIB="yes",ZLIB="no")
560 if test "$ZLIB" = "yes"; then
561 if test "$with_zlib_libraries" != "no"; then
562 LDFLAGS="${LDFLAGS} -L${with_zlib_libraries}"
563 fi
564
565 # To prevent duping the lib link we reset LIBS after this check. Setting action-if-found to NULL doesn't seem to work
566 # see: http://blog.flameeyes.eu/2008/04/29/i-consider-ac_check_lib-harmful
567 ZLIB=""
568 TMPLIBS="${LIBS}"
569 AC_CHECK_LIB(z,inflate,,ZLIB="no")
570
571 if test "$ZLIB" = "no"; then
572 echo
573 echo " ERROR! zlib library not found, go get it"
b98c28a6 574 echo " Debian/Ubuntu: apt install zlib1g-dev"
575 echo " Fedora: dnf install zlib-devel"
576 echo " CentOS/RHEL: yum install zlib-devel"
b60065ca
GL
577 echo
578 exit 1
579 fi
580 LIBS="${TMPLIBS} -lz"
581 fi
582
583 # liblzma
584 enable_liblzma=no
585
586 AC_ARG_WITH(liblzma_includes,
587 [ --with-liblzma-includes=DIR liblzma include directory],
b98c28a6 588 [with_liblzma_includes="$withval"],[with_liblzma_includes="no"])
b60065ca
GL
589 AC_ARG_WITH(liblzma_libraries,
590 [ --with-liblzma-libraries=DIR liblzma library directory],
591 [with_liblzma_libraries="$withval"],[with_liblzma_libraries="no"])
592
593 if test "$with_liblzma_includes" != "no"; then
594 CPPFLAGS="${CPPFLAGS} -I${with_liblzma_includes}"
595 fi
b98c28a6 596 TMPLIBS="${LIBS}"
b60065ca 597
b98c28a6 598 AC_CHECK_HEADER(lzma.h,
599 AC_CHECK_LIB(lzma,lzma_code,[
600 AC_DEFINE([HAVE_LIBLZMA],[1],[liblzma available])
601 LIBLZMA="yes"
602 if test "$LIBLZMA" = "yes"; then
603 if test "$with_liblzma_libraries" != "no"; then
604 LDFLAGS="${LDFLAGS} -L${with_liblzma_libraries}"
605 LIBS="${TMPLIBS} -llzma"
606 else
607 LIBS="${TMPLIBS} -llzma"
608 fi
609 fi]),LIBLZMA="no")
b60065ca 610
b98c28a6 611 if test "$LIBLZMA" != "yes"; then
612 echo
613 echo " Warning! liblzma library not found, you will not be"
614 echo " able to decompress flash file compressed with lzma."
615 echo " Debian/Ubuntu: apt install liblzma-dev"
616 echo " Fedora: dnf install xz-devel"
617 echo " CentOS/RHEL: yum install xz-devel"
618 echo
619 enable_liblzma=no
620 else
621 enable_liblzma=yes
622 LIBS="${TMPLIBS} -llzma"
b60065ca
GL
623 fi
624
89cee0ad 625 #libpcre
a3510f20
WM
626 AC_ARG_WITH(libpcre_includes,
627 [ --with-libpcre-includes=DIR libpcre include directory],
b98c28a6 628 [with_libpcre_includes="$withval"],[with_libpcre_includes="no"])
a3510f20
WM
629 AC_ARG_WITH(libpcre_libraries,
630 [ --with-libpcre-libraries=DIR libpcre library directory],
631 [with_libpcre_libraries="$withval"],[with_libpcre_libraries="no"])
632
633 if test "$with_libpcre_includes" != "no"; then
89f83c2e 634 CPPFLAGS="${CPPFLAGS} -I${with_libpcre_includes}"
a3510f20 635 fi
0795dc1e 636 AC_CHECK_HEADER(pcre.h,,[AC_MSG_ERROR(pcre.h not found ...)])
6899b3da 637
a3510f20 638 if test "$with_libpcre_libraries" != "no"; then
ba81c4d2 639 LDFLAGS="${LDFLAGS} -L${with_libpcre_libraries}"
a3510f20 640 fi
a3510f20 641 PCRE=""
b98c28a6 642 AC_CHECK_LIB(pcre, pcre_get_substring,,PCRE="no")
89f83c2e
VJ
643 if test "$PCRE" = "no"; then
644 echo
645 echo " ERROR! pcre library not found, go get it"
b98c28a6 646 echo " from www.pcre.org. Or from packages:"
647 echo " Debian/Ubuntu: apt install libpcre3-dev"
648 echo " Fedora: dnf install pcre-devel"
649 echo " CentOS/RHEL: yum install pcre-devel"
89f83c2e
VJ
650 echo
651 exit 1
652 fi
6899b3da 653
8c0e5750
AH
654 # libpcre 8.35 (especially on debian) has a known issue that results in segfaults
655 # see https://redmine.openinfosecfoundation.org/issues/1693
c8399e8c
AH
656 if test "$with_libpcre_libraries" = "no"; then
657 PKG_CHECK_MODULES(LIBPCREVERSION, [libpcre = 8.35],[libpcre_buggy_found="yes"],[libprce_buggy_found="no"])
658 if test "$libpcre_buggy_found" = "yes"; then
659 echo
660 echo " Warning! vulnerable libpcre version 8.35 found"
661 echo " This version has a known issue that could result in segfaults"
662 echo " please upgrade to a newer version of pcre which you can get from"
663 echo " www.pcre.org. For more information, see issue #1693"
664 echo
665 echo " Continuing for now with JIT disabled..."
666 echo
667 fi
8c0e5750
AH
668 fi
669
89f83c2e
VJ
670 # To prevent duping the lib link we reset LIBS after this check. Setting action-if-found to NULL doesn't seem to work
671 # see: http://blog.flameeyes.eu/2008/04/29/i-consider-ac_check_lib-harmful
672 PCRE=""
673 TMPLIBS="${LIBS}"
674 AC_CHECK_LIB(pcre, pcre_dfa_exec,, PCRE="no")
a3510f20 675 if test "$PCRE" = "no"; then
89f83c2e
VJ
676 echo
677 echo " ERROR! pcre library was found but version was < 6.0"
678 echo " please upgrade to a newer version of pcre which you can get from"
679 echo " www.pcre.org."
680 echo
681 exit 1
a3510f20 682 fi
89f83c2e 683 LIBS="${TMPLIBS}"
6899b3da 684
0795dc1e
AH
685 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <pcre.h> ]],
686 [[ int eo = 0; eo |= PCRE_EXTRA_MATCH_LIMIT_RECURSION; ]])],
687 [ pcre_match_limit_recursion_available=yes ],[:]
89f83c2e
VJ
688 )
689 if test "$pcre_match_limit_recursion_available" != "yes"; then
89f83c2e
VJ
690 echo
691 echo " Warning! pcre extra opt PCRE_EXTRA_MATCH_LIMIT_RECURSION not found"
692 echo " This could lead to potential DoS please upgrade to pcre >= 6.5"
89f83c2e 693 echo " from www.pcre.org."
ba81c4d2 694 echo " Continuing for now...."
89f83c2e 695 echo
ba81c4d2 696 AC_DEFINE([NO_PCRE_MATCH_RLIMIT],[1],[Pcre PCRE_EXTRA_MATCH_LIMIT_RECURSION not available])
89f83c2e 697 fi
5bde1217 698
0bfba835
VJ
699 TMPCFLAGS="${CFLAGS}"
700 CFLAGS="-O0 -g -Werror -Wall"
0795dc1e
AH
701 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <pcre.h> ]],
702 [[ pcre_extra *extra = NULL; pcre_free_study(extra); ]])],
703 [ AC_DEFINE([HAVE_PCRE_FREE_STUDY], [1], [Pcre pcre_free_study supported])],[:]
0bfba835
VJ
704 )
705 CFLAGS="${TMPCFLAGS}"
706
3d396e8b 707 #enable support for PCRE-jit available since pcre-8.20
3d558bf0 708 AC_MSG_CHECKING(for PCRE JIT support)
0795dc1e
AH
709 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <pcre.h> ]],
710 [[
3d558bf0
EL
711 int jit = 0;
712 pcre_config(PCRE_CONFIG_JIT, &jit);
0795dc1e 713 ]])],[ pcre_jit_available=yes ],[ pcre_jit_available=no ]
3d558bf0
EL
714 )
715
bc480fa8
VJ
716 case $host in
717 *powerpc64*)
cee5c9fa
VJ
718 PKG_CHECK_MODULES(LIBPCREVERSION, [libpcre = 8.39],[libpcre_ppc64_buggy_found1="yes"],[libprce_ppc64_buggy_found1="no"])
719 PKG_CHECK_MODULES(LIBPCREVERSION, [libpcre = 8.40],[libpcre_ppc64_buggy_found2="yes"],[libprce_ppc64_buggy_found2="no"])
720
721 if test "$libprce_ppc64_buggy_found1" = "yes" || test "$libprce_ppc64_buggy_found2"; then
722 # on powerpc64, both gcc and clang lead to SIGILL in
723 # unittests when jit is enabled.
724 pcre_jit_available="no, pcre 8.39/8.40 jit disabled for powerpc64"
725 fi
bc480fa8
VJ
726 ;;
727 *)
728 # bug 1693, libpcre 8.35 is broken and debian jessie is still using that
729 if test "$libpcre_buggy_found" = "yes"; then
730 pcre_jit_available="no, libpcre 8.35 blacklisted"
731 fi
732 ;;
733 esac
e51707be 734
3d558bf0
EL
735 if test "x$pcre_jit_available" = "xyes"; then
736 AC_MSG_RESULT(yes)
737 AC_DEFINE([PCRE_HAVE_JIT], [1], [Pcre with JIT compiler support enabled])
738
739 AC_MSG_CHECKING(for PCRE JIT support usability)
0795dc1e
AH
740 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <pcre.h> ]],
741 [[
3d558bf0
EL
742 const char* regexstr = "(a|b|c|d)";
743 pcre *re;
744 const char *error;
745 pcre_extra *extra;
746 int err_offset;
747 re = pcre_compile(regexstr,0, &error, &err_offset,NULL);
748 extra = pcre_study(re, PCRE_STUDY_JIT_COMPILE, &error);
749 if (extra == NULL)
750 exit(EXIT_FAILURE);
751 int jit = 0;
752 int ret = pcre_fullinfo(re, extra, PCRE_INFO_JIT, &jit);
753 if (ret != 0 || jit != 1)
754 exit(EXIT_FAILURE);
755 exit(EXIT_SUCCESS);
0795dc1e 756 ]])],[ pcre_jit_works=yes ],[:]
3d558bf0
EL
757 )
758 if test "x$pcre_jit_works" != "xyes"; then
759 AC_MSG_RESULT(no)
760 echo
761 echo " PCRE JIT support detection worked but testing it failed"
762 echo " something odd is going on, please file a bug report."
763 echo
764 exit 1
765 else
766 AC_MSG_RESULT(yes)
767 fi
5ea1b1d1 768 else
89f83c2e 769 AC_MSG_RESULT(no)
3d558bf0 770 fi
3d396e8b 771
13b87f5a
JV
772 # libhs
773 enable_hyperscan="no"
774
775 # Try pkg-config first:
776 PKG_CHECK_MODULES([libhs], libhs,, [with_pkgconfig_libhs=no])
777 if test "$with_pkgconfig_libhs" != "no"; then
778 CPPFLAGS="${CPPFLAGS} ${libhs_CFLAGS}"
779 LIBS="${LIBS} ${libhs_LIBS}"
780 fi
781
782 AC_ARG_WITH(libhs_includes,
783 [ --with-libhs-includes=DIR libhs include directory],
784 [with_libhs_includes="$withval"],[with_libhs_includes=no])
785 AC_ARG_WITH(libhs_libraries,
786 [ --with-libhs-libraries=DIR libhs library directory],
787 [with_libhs_libraries="$withval"],[with_libhs_libraries="no"])
788
789 if test "$with_libhs_includes" != "no"; then
790 CPPFLAGS="${CPPFLAGS} -I${with_libhs_includes}"
791 fi
792 AC_CHECK_HEADER(hs.h,HYPERSCAN="yes",HYPERSCAN="no")
793 if test "$HYPERSCAN" = "yes"; then
794 if test "$with_libhs_libraries" != "no"; then
795 LDFLAGS="${LDFLAGS} -L${with_libhs_libraries}"
796 fi
797
798 AC_CHECK_LIB(hs,hs_compile,,HYPERSCAN="no")
e6044aaf 799 AC_CHECK_FUNCS(hs_valid_platform)
13b87f5a
JV
800 enable_hyperscan="yes"
801 if test "$HYPERSCAN" = "no"; then
802 echo
803 echo " Hyperscan headers are present, but link test failed."
804 echo " Check that you have a shared library and C++ linkage available."
805 echo
806 enable_hyperscan="no"
807 fi
808 fi
809 AS_IF([test "x$enable_hyperscan" = "xyes"], [AC_DEFINE([BUILD_HYPERSCAN], [1], [Intel Hyperscan support enabled])])
810
89cee0ad 811 # libyaml
c91a4baa
JI
812 AC_ARG_WITH(libyaml_includes,
813 [ --with-libyaml-includes=DIR libyaml include directory],
814 [with_libyaml_includes="$withval"],[with_libyaml_includes=no])
815 AC_ARG_WITH(libyaml_libraries,
816 [ --with-libyaml-libraries=DIR libyaml library directory],
817 [with_libyaml_libraries="$withval"],[with_libyaml_libraries="no"])
818
819 if test "$with_libyaml_includes" != "no"; then
89f83c2e 820 CPPFLAGS="${CPPFLAGS} -I${with_libyaml_includes}"
c91a4baa
JI
821 fi
822
823 AC_CHECK_HEADER(yaml.h,,LIBYAML="no")
824
825 if test "$with_libyaml_libraries" != "no"; then
ba81c4d2 826 LDFLAGS="${LDFLAGS} -L${with_libyaml_libraries}"
c91a4baa
JI
827 fi
828
829 LIBYAML=""
830 AC_CHECK_LIB(yaml,yaml_parser_initialize,,LIBYAML="no")
831
832 if test "$LIBYAML" = "no"; then
89cee0ad
VJ
833 echo
834 echo " ERROR! libyaml library not found, go get it"
835 echo " from http://pyyaml.org/wiki/LibYAML "
836 echo " or your distribution:"
837 echo
838 echo " Ubuntu: apt-get install libyaml-dev"
015cd930 839 echo " Fedora: dnf install libyaml-devel"
840 echo " CentOS/RHEL: yum install libyaml-devel"
89cee0ad
VJ
841 echo
842 exit 1
c91a4baa
JI
843 fi
844
89cee0ad 845 # libpthread
a3510f20
WM
846 AC_ARG_WITH(libpthread_includes,
847 [ --with-libpthread-includes=DIR libpthread include directory],
848 [with_libpthread_includes="$withval"],[with_libpthread_includes=no])
849 AC_ARG_WITH(libpthread_libraries,
850 [ --with-libpthread-libraries=DIR libpthread library directory],
851 [with_libpthread_libraries="$withval"],[with_libpthread_libraries="no"])
852
853 if test "$with_libpthread_includes" != "no"; then
89f83c2e 854 CPPFLAGS="${CPPFLAGS} -I${with_libpthread_includes}"
a3510f20 855 fi
6899b3da 856
0795dc1e 857 dnl AC_CHECK_HEADER(pthread.h,,[AC_MSG_ERROR(pthread.h not found ...)])
6899b3da 858
a3510f20 859 if test "$with_libpthread_libraries" != "no"; then
89f83c2e 860 LDFLAGS="${LDFLAGS} -L${with_libpthread_libraries}"
a3510f20 861 fi
6899b3da 862
a3510f20
WM
863 PTHREAD=""
864 AC_CHECK_LIB(pthread, pthread_create,, PTHREAD="no")
6899b3da 865
a3510f20 866 if test "$PTHREAD" = "no"; then
89f83c2e
VJ
867 echo
868 echo " ERROR! libpthread library not found, glibc problem?"
869 echo
870 exit 1
a3510f20
WM
871 fi
872
9b05db7d
FF
873 AC_CHECK_FUNCS([pthread_spin_unlock])
874
20a8b9db 875 # libjansson
20a8b9db
EL
876 AC_ARG_WITH(libjansson_includes,
877 [ --with-libjansson-includes=DIR libjansson include directory],
878 [with_libjansson_includes="$withval"],[with_libjansson_includes=no])
879 AC_ARG_WITH(libjansson_libraries,
880 [ --with-libjansson-libraries=DIR libjansson library directory],
881 [with_libjansson_libraries="$withval"],[with_libjansson_libraries="no"])
882
883 if test "$with_libjansson_includes" != "no"; then
884 CPPFLAGS="${CPPFLAGS} -I${with_libjansson_includes}"
885 fi
886
e49c4042
JI
887 if test "$with_libjansson_libraries" != "no"; then
888 LDFLAGS="${LDFLAGS} -L${with_libjansson_libraries}"
889 fi
890
891 AC_CHECK_HEADER(jansson.h,JANSSON="yes",JANSSON="no")
892 AC_CHECK_LIB(jansson, json_dump_callback,, JANSSON="no")
893
894 if test "$JANSSON" = "no"; then
895 echo ""
896 echo " ERROR: Jansson is now required."
897 echo ""
898 echo " Go get it from your distribution or from:"
899 echo " http://www.digip.org/jansson/"
900 echo ""
901 echo " Ubuntu/Debian: apt install libjansson-dev"
902 echo " CentOS: yum install jansson-devel"
903 echo " Fedora: dnf install jansson-devel"
904 echo ""
905 exit 1
906 fi
907
908 enable_jansson="yes"
20a8b9db 909 enable_unixsocket="no"
7d706563
EL
910
911 AC_ARG_ENABLE(unix-socket,
912 AS_HELP_STRING([--enable-unix-socket], [Enable unix socket [default=test]]),[enable_unixsocket="$enableval"],[enable_unixsocket=test])
913
20a8b9db 914 if test "$JANSSON" = "yes"; then
20a8b9db
EL
915 enable_jansson="yes"
916 if test "$JANSSON" = "no"; then
917 echo
0470c0f6 918 echo " Jansson >= 2.2 is required for features like unix socket"
42227e87 919 echo " Go get it from your distribution or from:"
b98c28a6 920 echo " http://www.digip.org/jansson/"
921 echo " Ubuntu: apt-get install libjansson-dev"
922 echo " Fedora: dnf install jansson-devel"
923 echo " CentOS/RHEL: yum install jansson-devel"
20a8b9db 924 echo
ba81c4d2 925 if test "x$enable_unixsocket" = "xyes"; then
7d706563
EL
926 exit 1
927 fi
20a8b9db
EL
928 enable_unixsocket="no"
929 enable_jansson="no"
930 else
931 case $host in
bae83e61 932 *-*-mingw32*|*-*-msys*|*-*-cygwin)
1261d30d 933 enable_unixsocket="no"
ba81c4d2 934 ;;
20a8b9db 935 *)
ba81c4d2
VJ
936 if test "x$enable_unixsocket" = "xtest"; then
937 enable_unixsocket="yes"
938 fi
939 ;;
20a8b9db
EL
940 esac
941 fi
7d706563
EL
942 else
943 if test "x$enable_unixsocket" = "xyes"; then
944 echo
945 echo " Jansson >= 2.2 is required for features like unix socket"
42227e87 946 echo " Go get it from your distribution or from:"
7d706563 947 echo " http://www.digip.org/jansson/"
b98c28a6 948 echo " Ubuntu: apt-get install libjansson-dev"
949 echo " Fedora: dnf install jansson-devel"
950 echo " CentOS/RHEL: yum install jansson-devel"
7d706563
EL
951 echo
952 exit 1
953 fi
954 enable_unixsocket="no"
20a8b9db
EL
955 fi
956
957 AS_IF([test "x$enable_unixsocket" = "xyes"], [AC_DEFINE([BUILD_UNIX_SOCKET], [1], [Unix socket support enabled])])
f55dbca5 958 e_enable_evelog=$enable_jansson
20a8b9db 959
5f4b745f
EL
960 AC_ARG_ENABLE(nflog,
961 AS_HELP_STRING([--enable-nflog],[Enable libnetfilter_log support]),
d01ce2e5 962 [ enable_nflog="$enableval"],
5f4b745f
EL
963 [ enable_nflog="no"])
964 AC_ARG_ENABLE(nfqueue,
d01ce2e5 965 AS_HELP_STRING([--enable-nfqueue], [Enable NFQUEUE support for inline IDP]),[enable_nfqueue=$enableval],[enable_nfqueue=no])
15766ce2
AH
966 if test "$enable_nfqueue" != "no"; then
967 PKG_CHECK_MODULES([libnetfilter_queue], [libnetfilter_queue], [enable_nfqueue=yes], [enable_nfqueue=no])
968 CPPFLAGS="${CPPFLAGS} ${libnetfilter_queue_CFLAGS}"
969 fi
0ffa1c24 970
5f4b745f
EL
971 if test "x$enable_nflog" = "xyes" || test "x$enable_nfqueue" = "xyes"; then
972 # libnfnetlink
973 case $host in
974 *-*-mingw32*)
975 ;;
976 *)
977 AC_ARG_WITH(libnfnetlink_includes,
978 [ --with-libnfnetlink-includes=DIR libnfnetlink include directory],
979 [with_libnfnetlink_includes="$withval"],[with_libnfnetlink_includes=no])
980 AC_ARG_WITH(libnfnetlink_libraries,
981 [ --with-libnfnetlink-libraries=DIR libnfnetlink library directory],
982 [with_libnfnetlink_libraries="$withval"],[with_libnfnetlink_libraries="no"])
983
984 if test "$with_libnfnetlink_includes" != "no"; then
985 CPPFLAGS="${CPPFLAGS} -I${with_libnfnetlink_includes}"
986 fi
0ffa1c24 987
5f4b745f
EL
988 if test "$with_libnfnetlink_libraries" != "no"; then
989 LDFLAGS="${LDFLAGS} -L${with_libnfnetlink_libraries}"
990 fi
0ffa1c24 991
5f4b745f
EL
992 NFNL=""
993 AC_CHECK_LIB(nfnetlink, nfnl_fd,, NFNL="no")
994
995 if test "$NFNL" = "no"; then
996 echo
997 echo " ERROR! nfnetlink library not found, go get it"
998 echo " from www.netfilter.org."
999 echo " we automatically append libnetfilter_queue/ when searching"
1000 echo " for headers etc. when the --with-libnfnetlink-includes directive"
1001 echo " is used"
b98c28a6 1002 echo " Ubuntu: apt-get install libnetfilter-queue-dev"
1003 echo " Fedora: dnf install libnetfilter_queue-devel"
1004 echo " CentOS/RHEL: yum install libnetfilter_queue-devel"
5f4b745f
EL
1005 echo
1006 fi
1007 ;;
1008 esac
1009 fi
0ffa1c24 1010
ba81c4d2 1011 # enable support for NFQUEUE
3ff5dc36 1012 if test "x$enable_nfqueue" = "xyes"; then
ba81c4d2 1013 AC_DEFINE_UNQUOTED([NFQ],[1],[Enable Linux Netfilter NFQUEUE support for inline IDP])
4851568a 1014
3ff5dc36
VJ
1015 #libnetfilter_queue
1016 AC_ARG_WITH(libnetfilter_queue_includes,
a3510f20
WM
1017 [ --with-libnetfilter_queue-includes=DIR libnetfilter_queue include directory],
1018 [with_libnetfilter_queue_includes="$withval"],[with_libnetfilter_queue_includes=no])
3ff5dc36 1019 AC_ARG_WITH(libnetfilter_queue_libraries,
a3510f20
WM
1020 [ --with-libnetfilter_queue-libraries=DIR libnetfilter_queue library directory],
1021 [with_libnetfilter_queue_libraries="$withval"],[with_libnetfilter_queue_libraries="no"])
1022
3ff5dc36
VJ
1023 if test "$with_libnetfilter_queue_includes" != "no"; then
1024 CPPFLAGS="${CPPFLAGS} -I${with_libnetfilter_queue_includes}"
1025 fi
366671a8 1026
0795dc1e 1027 AC_CHECK_HEADER(libnetfilter_queue/libnetfilter_queue.h,,[AC_MSG_ERROR(libnetfilter_queue/libnetfilter_queue.h not found ...)])
366671a8 1028
3ff5dc36
VJ
1029 if test "$with_libnetfilter_queue_libraries" != "no"; then
1030 LDFLAGS="${LDFLAGS} -L${with_libnetfilter_queue_libraries}"
89cee0ad 1031 fi
3ff5dc36
VJ
1032
1033 NFQ=""
89cee0ad
VJ
1034 AC_CHECK_LIB(netfilter_queue, nfq_open,, NFQ="no",)
1035 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])
1036 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])
2c572759 1037 AC_CHECK_LIB([netfilter_queue], [nfq_set_queue_flags],AC_DEFINE_UNQUOTED([HAVE_NFQ_SET_QUEUE_FLAGS],[1],[Found nfq_set_queue_flags function in netfilter_queue]) ,,[-lnfnetlink])
8da02115 1038 AC_CHECK_LIB([netfilter_queue], [nfq_set_verdict_batch],AC_DEFINE_UNQUOTED([HAVE_NFQ_SET_VERDICT_BATCH],[1],[Found nfq_set_verdict_batch function in netfilter_queue]) ,,[-lnfnetlink])
89cee0ad
VJ
1039
1040 # check if the argument to nfq_get_payload is signed or unsigned
1041 AC_MSG_CHECKING([for signed nfq_get_payload payload argument])
1042 STORECFLAGS="${CFLAGS}"
adbf85c4
EL
1043 if test `basename $CC` = "clang"; then
1044 CFLAGS="${CFLAGS} -Werror=incompatible-pointer-types"
1045 else
58bf4ea4 1046 CFLAGS="${CFLAGS} -Werror"
adbf85c4 1047 fi
89cee0ad 1048 AC_COMPILE_IFELSE(
c9f9e3f9
VJ
1049 [AC_LANG_PROGRAM(
1050 [
3ff5dc36
VJ
1051 #include <stdio.h>
1052 #include <libnetfilter_queue/libnetfilter_queue.h>
c9f9e3f9
VJ
1053 ],
1054 [
3ff5dc36
VJ
1055 char *pktdata;
1056 nfq_get_payload(NULL, &pktdata);
c9f9e3f9
VJ
1057 ])],
1058 [libnetfilter_queue_nfq_get_payload_signed="yes"],
1059 [libnetfilter_queue_nfq_get_payload_signed="no"])
89cee0ad
VJ
1060 AC_MSG_RESULT($libnetfilter_queue_nfq_get_payload_signed)
1061 if test "x$libnetfilter_queue_nfq_get_payload_signed" = "xyes"; then
adbf85c4 1062 AC_DEFINE([NFQ_GET_PAYLOAD_SIGNED], [1], [For signed version of nfq_get_payload])
89cee0ad
VJ
1063 fi
1064 CFLAGS="${STORECFLAGS}"
0ffa1c24 1065
3ff5dc36
VJ
1066 if test "$NFQ" = "no"; then
1067 echo
1068 echo " ERROR! libnetfilter_queue library not found, go get it"
1069 echo " from www.netfilter.org."
1070 echo " we automatically append libnetfilter_queue/ when searching"
1071 echo " for headers etc. when the --with-libnfq-includes directive"
1072 echo " is used"
b98c28a6 1073 echo " Ubuntu: apt-get install libnetfilter-queue-dev"
1074 echo " Fedora: dnf install libnetfilter_queue-devel"
1075 echo " CentOS/RHEL: yum install libnetfilter_queue-devel"
3ff5dc36
VJ
1076 echo
1077 exit 1
1078 fi
a3510f20 1079 fi
2b7b78f1 1080
4851568a 1081 # libnetfilter_log
4851568a
GL
1082 AC_ARG_WITH(libnetfilter_log_includes,
1083 [ --with-libnetfilter_log-includes=DIR libnetfilter_log include directory],
1084 [with_libnetfilter_log_includes="$withval"],[with_libnetfilter_log_includes="no"])
1085 AC_ARG_WITH(libnetfilter_log_libraries,
1086 [ --with-libnetfilter_log-libraries=DIR libnetfilter_log library directory],
1087 [with_libnetfilter_log_libraries="$withval"],[with_libnetfilter_log_libraries="no"])
1088
1089 if test "$enable_nflog" = "yes"; then
1090 if test "$with_libnetfilter_log_includes" != "no"; then
1091 CPPFLAGS="${CPPFLAGS} -I${with_libnetfilter_log_includes}"
1092 fi
1093
0795dc1e 1094 AC_CHECK_HEADER(libnetfilter_log/libnetfilter_log.h,,[AC_MSG_ERROR(libnetfilter_log.h not found ...)])
4851568a
GL
1095
1096 if test "$with_libnetfilter_log_libraries" != "no"; then
1097 LDFLAGS="${LDFLAGS} -L${with_libnetfilter_log_libraries}"
1098 fi
1099
1100 NFLOG=""
1101 AC_CHECK_LIB(netfilter_log, nflog_open,, NFLOG="no")
1102
1103 if test "$NFLOG" = "no"; then
1104 echo
1105 echo " ERROR! libnetfilter_log library not found, go get it"
1106 echo " from http://www.netfilter.org."
1107 echo
1108 exit 1
1109 else
1110 AC_DEFINE([HAVE_NFLOG],[1],[nflog available])
1111 enable_nflog="yes"
1112 fi
1113 fi
1114
ec77632e
JMS
1115 # WinDivert support
1116 AC_ARG_ENABLE(windivert,
d01ce2e5 1117 AS_HELP_STRING([--enable-windivert],[Enable WinDivert support [default=no]]),[enable_windivert=$enableval],
ec77632e
JMS
1118 [enable_windivert="no"])
1119
1120 # WinDivert can only be enabled on Windows builds
1121 AC_CHECK_DECL([OS_WIN32],,[enable_windivert="no"])
1122
1123 if test "x$enable_windivert" = "xyes"; then
1124 # WinDivert requires Vista at a minimum. If the user has selected their own NTDDI_VERSION
1125 # then don't override it.
1126 AC_CHECK_DECL([NTDDI_VERSION],,
1127 [CFLAGS="${CFLAGS} -DNTDDI_VERSION=NTDDI_VISTA -D_WIN32_WINNT=_WIN32_WINNT_VISTA"])
1128
1129 AC_DEFINE_UNQUOTED([WINDIVERT],[1],[Enable Windows WinDivert support for inline IDP])
1130
1131 AC_ARG_WITH(windivert_include,
1132 [ --with-windivert-include=DIR WinDivert include path],
1133 [with_windivert_include="$withval"],[with_windivert_include="no"])
1134 AC_ARG_WITH(windivert_libraries,
1135 [ --with-windivert-libraries=DIR WinDivert library path],
1136 [with_windivert_libraries="$withval"],[with_windivert_libraries="no"])
1137
1138 if test "$with_windivert_include" != "no"; then
1139 CPPFLAGS="${CPPFLAGS} -I${with_windivert_include}"
1140 fi
1141
1142 if test "$with_windivert_libraries" != "no"; then
1143 LDFLAGS="${LDFLAGS} -L${with_windivert_libraries}"
1144 fi
1145
1146 AC_CHECK_HEADER(windivert.h,,WINDIVERT_INC="no")
1147 AC_CHECK_LIB(WinDivert, WinDivertOpen,, WINDIVERT_LIB="no")
1148
1149 if test "$WINDIVERT_LIB" = "no" || test "$WINDIVERT_INC" = "no"; then
1150 echo
1151 echo " ERROR! WinDivert not found, go get it from"
1152 echo " https://www.reqrypt.org/windivert.html"
1153 echo
1154 exit 1
1155 fi
1156 fi
1157 # /WinDivert
1158
89cee0ad 1159 # prelude
eb33dc16 1160 AC_ARG_ENABLE(prelude,
d01ce2e5 1161 AS_HELP_STRING([--enable-prelude], [Enable Prelude support for alerts]),[enable_prelude=$enableval],[enable_prelude=no])
f0c785cc
KS
1162 # Prelude doesn't work with -Werror
1163 STORECFLAGS="${CFLAGS}"
1164 CFLAGS="${CFLAGS} -Wno-error=unused-result"
1165
4e84ffe2 1166 AS_IF([test "x$enable_prelude" = "xyes"], [
eb33dc16
PC
1167 AM_PATH_LIBPRELUDE(0.9.9, , AC_MSG_ERROR(Cannot find libprelude: Is libprelude-config in the path?), no)
1168 if test "x${LIBPRELUDE_CFLAGS}" != "x"; then
1169 CPPFLAGS="${CPPFLAGS} ${LIBPRELUDE_CFLAGS}"
1170 fi
1171
1172 if test "x${LIBPRELUDE_LDFLAGS}" != "x"; then
1173 LDFLAGS="${LDFLAGS} ${LIBPRELUDE_LDFLAGS}"
1174 fi
1175
1176 if test "x${LIBPRELUDE_LIBS}" != "x"; then
1177 LDFLAGS="${LDFLAGS} ${LIBPRELUDE_LIBS}"
1178 fi
8623b8f9 1179 AC_DEFINE([PRELUDE], [1], [Libprelude support enabled])
4e84ffe2 1180 ])
f0c785cc
KS
1181 CFLAGS="${STORECFLAGS}"
1182
eb33dc16 1183
89cee0ad 1184 # libnet
a3510f20
WM
1185 AC_ARG_WITH(libnet_includes,
1186 [ --with-libnet-includes=DIR libnet include directory],
1187 [with_libnet_includes="$withval"],[with_libnet_includes="no"])
1188
1189 AC_ARG_WITH(libnet_libraries,
1190 [ --with-libnet-libraries=DIR libnet library directory],
1191 [with_libnet_libraries="$withval"],[with_libnet_libraries="no"])
1192
1193 if test "x$with_libnet_includes" != "xno"; then
3678dda1
WM
1194 CPPFLAGS="${CPPFLAGS} -I${with_libnet_includes}"
1195 libnet_dir="${with_libnet_includes}"
f7111f38 1196 else
829238e4 1197 libnet_dir="/usr/include /usr/local/include /usr/local/include/libnet11 /opt/local/include /usr/local/include/libnet-1.1"
a3510f20 1198 fi
0ffa1c24 1199
a3510f20 1200 if test "x$with_libnet_libraries" != "xno"; then
3678dda1 1201 LDFLAGS="${LDFLAGS} -L${with_libnet_libraries}"
a3510f20
WM
1202 fi
1203
3678dda1 1204 LIBNET_DETECT_FAIL="no"
a3510f20 1205 LIBNET_INC_DIR=""
3678dda1 1206
a3510f20
WM
1207 for i in $libnet_dir; do
1208 if test -r "$i/libnet.h"; then
3678dda1 1209 LIBNET_INC_DIR="$i"
a3510f20
WM
1210 fi
1211 done
1212
439b62fe 1213 enable_libnet="no"
3678dda1 1214 AC_MSG_CHECKING(for libnet.h version 1.1.x)
a3510f20 1215 if test "$LIBNET_INC_DIR" != ""; then
365015c2
AG
1216 LIBNET_VER=`grep LIBNET_VERSION $LIBNET_INC_DIR/libnet.h | grep '1.[[12]]' | sed 's/[[^"]]*"\([[^"]]*\).*/\1/'`
1217
1218 if test -z "$LIBNET_VER" ; then
3678dda1 1219 AC_MSG_RESULT(no)
3678dda1
WM
1220 else
1221 AC_MSG_RESULT(yes)
1222 fi
6e8c75ff 1223
3678dda1
WM
1224 #CentOS, Fedora, Ubuntu-LTS, Ubuntu all set defines to the same values. libnet-config seems
1225 #to have been depreciated but all distro's seem to include it as part of the package.
1226 if test "$LIBNET_DETECT_FAIL" = "no"; then
1227 LLIBNET=""
1228 AC_CHECK_LIB(net, libnet_write,, LLIBNET="no")
1229 if test "$LLIBNET" != "no"; then
ba81c4d2
VJ
1230 AC_DEFINE([HAVE_LIBNET11],[1],(libnet 1.1 available))
1231 AC_DEFINE([_DEFAULT_SOURCE],[1],(default source))
1232 AC_DEFINE([_BSD_SOURCE],[1],(bsd source))
1233 AC_DEFINE([__BSD_SOURCE],[1],(bsd source))
1234 AC_DEFINE([__FAVOR_BSD],[1],(favor bsd))
1235 AC_DEFINE([HAVE_NET_ETHERNET_H],[1],(ethernet.h))
439b62fe 1236 enable_libnet="yes"
3678dda1
WM
1237 fi
1238
1239 # see if we have the patched libnet 1.1
2e8678a5 1240 # https://www.inliniac.net/blog/2007/10/16/libnet-11-ipv6-fixes-and-additions.html
3678dda1
WM
1241 #
1242 # To prevent duping the lib link we reset LIBS after this check. Setting action-if-found to NULL doesn't seem to work
1243 # see: http://blog.flameeyes.eu/2008/04/29/i-consider-ac_check_lib-harmful
439b62fe 1244 if test "$enable_libnet" = "yes"; then
3678dda1
WM
1245 LLIBNET=""
1246 TMPLIBS="${LIBS}"
1247 AC_CHECK_LIB(net, libnet_build_icmpv6_unreach,, LLIBNET="no")
1248 if test "$LLIBNET" != "no"; then
ba81c4d2 1249 AC_DEFINE([HAVE_LIBNET_ICMPV6_UNREACH],[1],(libnet_build_icmpv6_unreach available))
3678dda1
WM
1250 fi
1251 LIBS="${TMPLIBS}"
1252 fi
365015c2
AG
1253
1254 # See if we have libnet 1.1.6 or newer - these versions handle capabilities correctly
1255 # Some patched 1.1.4 versions are also good, but it's not guaranteed for all distros.
1256 #
1257 # Details: https://bugzilla.redhat.com/show_bug.cgi?id=589770
1258 AS_VERSION_COMPARE([LIBNET_VER], [1.1.6],
1259 [],
1260 [AC_DEFINE([HAVE_LIBNET_CAPABILITIES],[1], (libnet_have_capabilities_patch))],
1261 [AC_DEFINE([HAVE_LIBNET_CAPABILITIES],[1], (libnet_have_capabilities_patch))])
66346e46
VJ
1262
1263
1264 # check if the argument to libnet_init is char* or const char*
1265 AC_MSG_CHECKING([libnet_init dev type])
1266 STORECFLAGS="${CFLAGS}"
1267 if test `basename $CC` = "clang"; then
1268 CFLAGS="${CFLAGS} -Werror=incompatible-pointer-types"
1269 else
1270 CFLAGS="${CFLAGS} -Werror"
1271 fi
1272 AC_COMPILE_IFELSE(
1273 [AC_LANG_PROGRAM(
1274 [
1275 #include <stdio.h>
1276 #include <libnet.h>
1277 ],
1278 [[
1279 const char dev[32] = "";
1280 char ebuf[LIBNET_ERRBUF_SIZE];
1281 (void)libnet_init(LIBNET_LINK, dev, ebuf);
1282 ]])],
1283 [libnet_init_const="yes"],
1284 [libnet_init_const="no"])
1285 AC_MSG_RESULT($libnet_init_const)
1286 if test "x$libnet_init_const" = "xyes"; then
1287 AC_DEFINE([HAVE_LIBNET_INIT_CONST], [1], [libnet_init takes const argument])
1288 fi
1289 CFLAGS="${STORECFLAGS}"
3678dda1 1290 fi
a3510f20 1291 else
439b62fe 1292 AC_MSG_RESULT(no)
a3510f20 1293 fi
0d15d4f6
MK
1294
1295 # libpcap
1296 AC_ARG_WITH(libpcap_includes,
1297 [ --with-libpcap-includes=DIR libpcap include directory],
1298 [with_libpcap_includes="$withval"],[with_libpcap_includes=no])
1299 AC_ARG_WITH(libpcap_libraries,
1300 [ --with-libpcap-libraries=DIR libpcap library directory],
1301 [with_libpcap_libraries="$withval"],[with_libpcap_libraries="no"])
1302
1303 if test "$with_libpcap_includes" != "no"; then
1304 CPPFLAGS="${CPPFLAGS} -I${with_libpcap_includes}"
1305 fi
1306
0795dc1e 1307 AC_CHECK_HEADER(pcap.h,,[AC_MSG_ERROR(pcap.h not found ...)])
0d15d4f6
MK
1308
1309 if test "$with_libpcap_libraries" != "no"; then
1310 LDFLAGS="${LDFLAGS} -L${with_libpcap_libraries}"
1311 fi
1312 AC_CHECK_HEADERS([pcap.h pcap/pcap.h pcap/bpf.h])
1313
1314 LIBPCAP=""
d1e839ea 1315 AC_CHECK_LIB(${PCAP_LIB_NAME}, pcap_open_live,, LIBPCAP="no")
0d15d4f6
MK
1316 if test "$LIBPCAP" = "no"; then
1317 echo
1318 echo " ERROR! libpcap library not found, go get it"
1319 echo " from http://www.tcpdump.org or your distribution:"
1320 echo
1321 echo " Ubuntu: apt-get install libpcap-dev"
015cd930 1322 echo " Fedora: dnf install libpcap-devel"
1323 echo " CentOS/RHEL: yum install libpcap-devel"
0d15d4f6
MK
1324 echo
1325 exit 1
1326 fi
1327
1328 # pcap_activate and pcap_create only exists in libpcap >= 1.0
1329 LIBPCAPVTEST=""
1330 #To prevent duping the lib link we reset LIBS after this check. Setting action-if-found to NULL doesn't seem to work
1331 #see: http://blog.flameeyes.eu/2008/04/29/i-consider-ac_check_lib-harmful
1332 TMPLIBS="${LIBS}"
d1e839ea 1333 AC_CHECK_LIB(${PCAP_LIB_NAME}, pcap_activate,, LPCAPVTEST="no")
cda6e029
VJ
1334 if test "$LPCAPVTEST" = "no"; then
1335 echo
1336 echo " ERROR! libpcap library too old, need at least 1+, "
1337 echo " go get it from http://www.tcpdump.org or your distribution:"
1338 echo
1339 echo " Ubuntu: apt-get install libpcap-dev"
015cd930 1340 echo " Fedora: dnf install libpcap-devel"
1341 echo " CentOS/RHEL: yum install libpcap-devel"
cda6e029
VJ
1342 echo
1343 exit 1
1344 fi
1345 AC_PATH_PROG(HAVE_PCAP_CONFIG, pcap-config, "no")
1346 if test "$HAVE_PCAP_CONFIG" = "no" -o "$cross_compiling" = "yes"; then
1347 AC_MSG_RESULT(no pcap-config is use)
0d15d4f6 1348 else
cda6e029
VJ
1349 PCAP_CFLAGS="$(pcap-config --defines) $(pcap-config --cflags)"
1350 AC_SUBST(PCAP_CFLAGS)
0d15d4f6
MK
1351 fi
1352 LIBS="${TMPLIBS}"
1353
1354 #Appears as if pcap_set_buffer_size is linux only?
1355 LIBPCAPSBUFF=""
1356 #To prevent duping the lib link we reset LIBS after this check. Setting action-if-found to NULL doesn't seem to work
1357 #see: http://blog.flameeyes.eu/2008/04/29/i-consider-ac_check_lib-harmful
1358 TMPLIBS="${LIBS}"
d1e839ea 1359 AC_CHECK_LIB(${PCAP_LIB_NAME}, pcap_set_buffer_size,, LPCAPSBUFF="no")
0d15d4f6 1360 if test "$LPCAPSBUFF" != "no"; then
ba81c4d2 1361 AC_DEFINE([HAVE_PCAP_SET_BUFF],[1],(libpcap has pcap_set_buffer_size function))
0d15d4f6
MK
1362 fi
1363 LIBS="${TMPLIBS}"
1364
1365 # libpfring
89cee0ad
VJ
1366 # libpfring (currently only supported for libpcap enabled pfring)
1367 # Error on the side of caution. If libpfring enabled pcap is being used and we don't link against -lpfring compilation will fail.
04b0f177 1368 AC_ARG_ENABLE(pfring,
d01ce2e5 1369 AS_HELP_STRING([--enable-pfring], [Enable Native PF_RING support]),[enable_pfring=$enableval],[enable_pfring=no])
e07e9e16 1370 AS_IF([test "x$enable_pfring" = "xyes"], [
ba81c4d2 1371 AC_DEFINE([HAVE_PFRING],[1],(PF_RING support enabled))
ddf995da 1372
0795dc1e 1373 #We have to set CFLAGS for AC_COMPILE_IFELSE as it doesn't pay attention to CPPFLAGS
6408feba
W
1374 AC_ARG_WITH(libpfring_includes,
1375 [ --with-libpfring-includes=DIR libpfring include directory],
1376 [with_libpfring_includes="$withval"],[with_libpfring_includes=no])
1377 AC_ARG_WITH(libpfring_libraries,
1378 [ --with-libpfring-libraries=DIR libpfring library directory],
1379 [with_libpfring_libraries="$withval"],[with_libpfring_libraries="no"])
1380
1381 if test "$with_libpfring_includes" != "no"; then
89f83c2e 1382 CPPFLAGS="${CPPFLAGS} -I${with_libpfring_includes}"
6408feba 1383 fi
073d0421 1384
6408feba 1385 if test "$with_libpfring_libraries" != "no"; then
89f83c2e 1386 LDFLAGS="${LDFLAGS} -L${with_libpfring_libraries}"
6408feba 1387 fi
073d0421 1388
6408feba 1389 LIBPFRING=""
43ffd779 1390 AC_CHECK_LIB(pfring, pfring_open,, LIBPFRING="no", [-lpcap])
dde78e49
GL
1391 if test "$LIBPFRING" != "no"; then
1392 STORECFLAGS="${CFLAGS}"
1393 CFLAGS="${CFLAGS} -Werror"
1394 AC_COMPILE_IFELSE(
1395 [AC_LANG_PROGRAM(
1396 [
1397 #include <pfring.h>
1398 ],
1399 [
1400 pfring_recv_chunk(NULL, NULL, 0, 0);
1401 ])],
1402 [pfring_recv_chunk="yes"],
1403 [pfring_recv_chunk="no"])
1404 CFLAGS="${STORECFLAGS}"
1405 if test "x$pfring_recv_chunk" != "xyes"; then
a75911e0
EL
1406 if test "x$enable_pfring" = "xyes"; then
1407 echo
dde78e49
GL
1408 echo " ERROR! --enable-pfring was passed but the library version is < 6, go get it"
1409 echo " from http://www.ntop.org/products/pf_ring/"
a75911e0
EL
1410 echo
1411 exit 1
1412 fi
6408feba 1413 fi
b6baafb3
AC
1414 AC_COMPILE_IFELSE(
1415 [AC_LANG_SOURCE([[
1416 #include <pfring.h>
1417 #ifndef PF_RING_FLOW_OFFLOAD
1418 # error PF_RING_FLOW_OFFLOAD not defined
1419 #endif
1420 ]])],
1421 [
1422 AC_DEFINE([HAVE_PF_RING_FLOW_OFFLOAD], [1], [PF_RING bypass support enabled])
1423 ],
1424 [
1425 echo
1426 echo " Warning! Pfring hw bypass not supported by this library version < 7,"
1427 echo " please upgrade to a newer version to use this feature."
1428 echo
1429 echo " Continuing for now with hw bypass support disabled..."
1430 echo
1431 ])
6408feba 1432 else
dde78e49
GL
1433 if test "x$enable_pfring" = "xyes"; then
1434 echo
1435 echo " ERROR! --enable-pfring was passed but the library was not found, go get it"
1436 echo " from http://www.ntop.org/products/pf_ring/"
1437 echo
1438 exit 1
1439 fi
dbf5d79e 1440 fi
6408feba 1441 ])
ddf995da 1442
89cee0ad 1443 # AF_PACKET support
e80b30c0 1444 AC_ARG_ENABLE(af-packet,
b2ebd4a1 1445 AS_HELP_STRING([--enable-af-packet], [Enable AF_PACKET support [default=yes]]),
d01ce2e5 1446 [enable_af_packet=$enableval],[enable_af_packet=yes])
e80b30c0 1447 AS_IF([test "x$enable_af_packet" = "xyes"], [
ac2d13d6 1448 AC_CHECK_DECL([TPACKET_V2],
e80b30c0 1449 AC_DEFINE([HAVE_AF_PACKET],[1],[AF_PACKET support is available]),
ac2d13d6
EL
1450 [enable_af_packet="no"],
1451 [[#include <sys/socket.h>
1452 #include <linux/if_packet.h>]])
851fcef9
EL
1453 AC_CHECK_DECL([PACKET_FANOUT_QM],
1454 AC_DEFINE([HAVE_PACKET_FANOUT],[1],[Recent packet fanout support is available]),
e80b30c0
EL
1455 [],
1456 [[#include <linux/if_packet.h>]])
c2d0d938
EL
1457 AC_CHECK_DECL([TPACKET_V3],
1458 AC_DEFINE([HAVE_TPACKET_V3],[1],[AF_PACKET tpcket_v3 support is available]),
1459 [],
1460 [[#include <sys/socket.h>
1461 #include <linux/if_packet.h>]])
a40f08a2
EL
1462 AC_CHECK_DECL([SOF_TIMESTAMPING_RAW_HARDWARE],
1463 AC_DEFINE([HAVE_HW_TIMESTAMPING],[1],[Hardware timestamping support is available]),
1464 [],
f79f6409 1465 [[#include <linux/net_tstamp.h>]])
e80b30c0
EL
1466 ])
1467
10104066 1468 # Netmap support
1469 AC_ARG_ENABLE(netmap,
d01ce2e5 1470 AS_HELP_STRING([--enable-netmap], [Enable Netmap support]),[enable_netmap=$enableval],[enable_netmap=no])
10104066 1471 AC_ARG_WITH(netmap_includes,
1472 [ --with-netmap-includes=DIR netmap include directory],
1473 [with_netmap_includes="$withval"],[with_netmap_includes=no])
1474
1475 AS_IF([test "x$enable_netmap" = "xyes"], [
ba81c4d2 1476 AC_DEFINE([HAVE_NETMAP],[1],(NETMAP support enabled))
10104066 1477
1478 if test "$with_netmap_includes" != "no"; then
1479 CPPFLAGS="${CPPFLAGS} -I${with_netmap_includes}"
1480 fi
1481
0795dc1e 1482 AC_CHECK_HEADER(net/netmap_user.h,,[AC_MSG_ERROR(net/netmap_user.h not found ...)],)
517b45ea
VJ
1483
1484 have_recent_netmap="no"
1485 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1486 #include <net/netmap_user.h>
1487 ],[
1488 #ifndef NETMAP_API
1489 #error "outdated netmap, need one with NETMAP_API"
1490 #endif
1491 #if NETMAP_API < 11
1492 #error "outdated netmap, need at least api version 11"
1493 #endif
1494 ])], [have_recent_netmap="yes"])
1495 if test "x$have_recent_netmap" != "xyes"; then
1496 echo "ERROR: outdated netmap"
1497 exit 1
1498 fi
1499 have_netmap_version="unknown"
1500 have_v11_netmap="no"
1501 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1502 #include <net/netmap_user.h>
1503 ],[
1504 #if NETMAP_API != 11
1505 #error "not 11"
1506 #endif
1507 ])], [have_v11_netmap="yes"])
1508 if test "x$have_v11_netmap" = "xyes"; then
1509 have_netmap_version="v11"
1510 fi
1511 have_v12_netmap="no"
1512 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1513 #include <net/netmap_user.h>
1514 ],[
1515 #if NETMAP_API != 12
1516 #error "not 12"
1517 #endif
1518 ])], [have_v12_netmap="yes"])
1519 if test "x$have_v12_netmap" = "xyes"; then
1520 have_netmap_version="v12"
1521 fi
1522 have_v13_netmap="no"
1523 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1524 #include <net/netmap_user.h>
1525 ],[
1526 #if NETMAP_API != 13
1527 #error "not 13"
1528 #endif
1529 ])], [have_v13_netmap="yes"])
1530 if test "x$have_v13_netmap" = "xyes"; then
1531 have_netmap_version="v13"
1532 fi
1533 have_gtv13_netmap="no"
1534 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1535 #include <net/netmap_user.h>
1536 ],[
1537 #if NETMAP_API <= 13
1538 #error "not gt 13"
1539 #endif
1540 ])], [have_gtv13_netmap="yes"])
1541 if test "x$have_gtv13_netmap" = "xyes"; then
1542 have_netmap_version="> v13"
1543 fi
10104066 1544 ])
c45d8985 1545
345ec58d
JI
1546 # Suricata-Update.
1547 AC_ARG_ENABLE([suricata-update], AS_HELP_STRING([--disable-suricata-update],
1548 [Disable suricata-update]), [enable_suricata_update=$enableval],
1549 [enable_suricata_update="yes"])
1550
1551 # Assume suircata-update will not be installed.
1552 have_suricata_update="no"
1553 ruledirprefix="$sysconfdir"
1554 no_suricata_update_comment="#"
1555 has_suricata_update_comment=""
1556 suricata_update_rule_files="suricata-update-rule-files"
1557
1558 if test "$enable_suricata_update" = "yes"; then
1559 AC_CHECK_FILE([$srcdir/suricata-update/setup.py], [
1560 have_suricata_update="yes"], [])
1561 fi
1562 AM_CONDITIONAL([HAVE_SURICATA_UPDATE],
1563 [test "x$have_suricata_update" != "xno"])
1564
345ec58d
JI
1565 if test "$have_suricata_update" = "yes"; then
1566 if test "$have_python_yaml" != "yes"; then
1567 echo ""
1568 echo " Warning: suricata-update will not be installed as the"
1569 echo " depedency python-yaml is not installed."
1570 echo ""
1571 echo " Debian/Ubuntu: apt install python-yaml"
1572 echo " Fedora: dnf install python-yaml"
1573 echo " CentOS/RHEL: yum install python-yaml"
b98c28a6 1574 echo
345ec58d 1575 else
345ec58d
JI
1576 SURICATA_UPDATE_DIR="suricata-update"
1577 AC_SUBST(SURICATA_UPDATE_DIR)
0795dc1e
AH
1578 AC_CONFIG_FILES(suricata-update/Makefile)
1579 AC_OUTPUT
345ec58d
JI
1580 ruledirprefix="$localstatedir/lib"
1581 no_suricata_update_comment=""
1582 has_suricata_update_comment="#"
1583 fi
1584 fi
cbcbc0f6 1585
a69afd5c
JI
1586 # Test to see if suricatactl (and suricatasc) can be installed.
1587 if test "x$enable_python" != "xyes"; then
1588 install_suricatactl="requires python"
1589 elif test "x$have_python_distutils" != "xyes"; then
1590 install_suricatactl="requires distutils"
1591 else
1592 install_suricatactl="yes"
1593 fi
1594
1595 # Test to see if suricata-update can be installed.
1596 if test "x$have_suricata_update" != "xyes"; then
1597 install_suricata_update="not bundled"
1598 elif test "x$enable_python" != "xyes"; then
1599 install_suricata_update="requires python"
1600 elif test "x$have_python_distutils" != "xyes"; then
1601 install_suricata_update="requires distutils"
1602 elif test "x$have_python_yaml" != "xyes"; then
1603 install_suricata_update="requires pyyaml"
1604 else
1605 install_suricata_update="yes"
1606 fi
1607
89cee0ad 1608 # libhtp
e07e9e16 1609 AC_ARG_ENABLE(non-bundled-htp,
d01ce2e5 1610 AS_HELP_STRING([--enable-non-bundled-htp], [Enable the use of an already installed version of htp]),[enable_non_bundled_htp=$enableval],[enable_non_bundled_htp=no])
e07e9e16 1611 AS_IF([test "x$enable_non_bundled_htp" = "xyes"], [
f8b8b6f7
EL
1612 PKG_CHECK_MODULES([libhtp], htp,, [with_pkgconfig_htp=no])
1613 if test "$with_pkgconfig_htp" != "no"; then
1614 CPPFLAGS="${CPPFLAGS} ${libhtp_CFLAGS}"
1615 LIBS="${LIBS} ${libhtp_LIBS}"
1616 fi
1617
e07e9e16
WM
1618 AC_ARG_WITH(libhtp_includes,
1619 [ --with-libhtp-includes=DIR libhtp include directory],
1620 [with_libhtp_includes="$withval"],[with_libhtp_includes=no])
1621 AC_ARG_WITH(libhtp_libraries,
1622 [ --with-libhtp-libraries=DIR libhtp library directory],
1623 [with_libhtp_libraries="$withval"],[with_libhtp_libraries="no"])
1624
1625 if test "$with_libhtp_includes" != "no"; then
0c37f76f 1626 CPPFLAGS="-I${with_libhtp_includes} ${CPPFLAGS}"
e07e9e16 1627 fi
07f7ba55 1628
e07e9e16 1629 if test "$with_libhtp_libraries" != "no"; then
89cee0ad 1630 LDFLAGS="${LDFLAGS} -L${with_libhtp_libraries}"
e07e9e16 1631 fi
ed856de9 1632
0795dc1e 1633 AC_CHECK_HEADER(htp/htp.h,,[AC_MSG_ERROR(htp/htp.h not found ...)])
ed856de9 1634
e07e9e16
WM
1635 LIBHTP=""
1636 AC_CHECK_LIB(htp, htp_conn_create,, LIBHTP="no")
1637 if test "$LIBHTP" = "no"; then
89cee0ad
VJ
1638 echo
1639 echo " ERROR! libhtp library not found"
1640 echo
1641 exit 1
e07e9e16 1642 fi
37b10c13 1643 PKG_CHECK_MODULES(LIBHTPMINVERSION, [htp >= 0.5.20],[libhtp_minver_found="yes"],[libhtp_minver_found="no"])
e07e9e16 1644 if test "$libhtp_minver_found" = "no"; then
f85a2dc8
AS
1645 PKG_CHECK_MODULES(LIBHTPDEVVERSION, [htp = 0.5.X],[libhtp_devver_found="yes"],[libhtp_devver_found="no"])
1646 if test "$libhtp_devver_found" = "no"; then
1647 echo
37b10c13 1648 echo " ERROR! libhtp was found but it is neither >= 0.5.20, nor the dev 0.5.X"
f85a2dc8
AS
1649 echo
1650 exit 1
1651 fi
d472d606
EL
1652 fi
1653
a3e2b355 1654 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])
80fb33c6
VJ
1655 # check for htp_tx_get_response_headers_raw
1656 AC_CHECK_LIB([htp], [htp_tx_get_response_headers_raw],AC_DEFINE_UNQUOTED([HAVE_HTP_TX_GET_RESPONSE_HEADERS_RAW],[1],[Found htp_tx_get_response_headers_raw in libhtp]) ,,[-lhtp])
cc51eec5 1657 AC_CHECK_LIB([htp], [htp_decode_query_inplace],AC_DEFINE_UNQUOTED([HAVE_HTP_DECODE_QUERY_INPLACE],[1],[Found htp_decode_query_inplace function in libhtp]) ,,[-lhtp])
5ec885e4 1658 AC_CHECK_LIB([htp], [htp_config_set_response_decompression_layer_limit],AC_DEFINE_UNQUOTED([HAVE_HTP_CONFIG_SET_RESPONSE_DECOMPRESSION_LAYER_LIMIT],[1],[Found htp_config_set_response_decompression_layer_limit function in libhtp]) ,,[-lhtp])
6d225378 1659 AC_EGREP_HEADER(htp_config_set_path_decode_u_encoding, htp/htp.h, AC_DEFINE_UNQUOTED([HAVE_HTP_SET_PATH_DECODE_U_ENCODING],[1],[Found usable htp_config_set_path_decode_u_encoding function in libhtp]) )
80fb33c6 1660 ])
4acd5a04 1661
aafc65c7
VJ
1662 if test "x$enable_non_bundled_htp" = "xno"; then
1663 # test if we have a bundled htp
1664 if test -d "$srcdir/libhtp"; then
1665 AC_CONFIG_SUBDIRS([libhtp])
1666 HTP_DIR="libhtp"
1667 AC_SUBST(HTP_DIR)
1668 HTP_LDADD="../libhtp/htp/libhtp.la"
1669 AC_SUBST(HTP_LDADD)
1670 # make sure libhtp is added to the includes
667e4e68 1671 CPPFLAGS="-I\${srcdir}/../libhtp/ ${CPPFLAGS}"
aafc65c7 1672
0795dc1e 1673 AC_CHECK_HEADER(iconv.h,,[AC_MSG_ERROR(iconv.h not found ...)])
c0993495 1674 AC_CHECK_LIB(iconv, libiconv_close)
aafc65c7
VJ
1675 AC_DEFINE_UNQUOTED([HAVE_HTP_URI_NORMALIZE_HOOK],[1],[Assuming htp_config_register_request_uri_normalize function in bundled libhtp])
1676 AC_DEFINE_UNQUOTED([HAVE_HTP_TX_GET_RESPONSE_HEADERS_RAW],[1],[Assuming htp_tx_get_response_headers_raw function in bundled libhtp])
1677 AC_DEFINE_UNQUOTED([HAVE_HTP_DECODE_QUERY_INPLACE],[1],[Assuming htp_decode_query_inplace function in bundled libhtp])
5ec885e4
VJ
1678 # enable when libhtp has been updated
1679 AC_DEFINE_UNQUOTED([HAVE_HTP_CONFIG_SET_RESPONSE_DECOMPRESSION_LAYER_LIMIT],[1],[Assuming htp_config_set_response_decompression_layer_limit function in bundled libhtp])
aafc65c7
VJ
1680 else
1681 echo
1bbbcf51 1682 echo " ERROR: Libhtp is not bundled. Get libhtp by doing:"
5ec885e4 1683 echo " git clone https://github.com/OISF/libhtp"
1bbbcf51
KS
1684 echo " Then re-run Suricata's autogen.sh and configure script."
1685 echo " Or, if libhtp is installed in a different location,"
1686 echo " pass --enable-non-bundled-htp to Suricata's configure script."
aafc65c7
VJ
1687 echo " Add --with-libhtp-includes=<dir> and --with-libhtp-libraries=<dir> if"
1688 echo " libhtp is not installed in the include and library paths."
1689 echo
1690 exit 1
1691 fi
1692 fi
36917c7d 1693
08328f9d 1694
89cee0ad 1695 # Check for libcap-ng
829238e4
VJ
1696 case $host in
1697 *-*-linux*)
070ed778
VJ
1698 AC_ARG_WITH(libcap_ng_includes,
1699 [ --with-libcap_ng-includes=DIR libcap_ng include directory],
f01027e9 1700 [with_libcap_ng_includes="$withval"],[with_libcap_ng_includes=no])
070ed778
VJ
1701 AC_ARG_WITH(libcap_ng_libraries,
1702 [ --with-libcap_ng-libraries=DIR libcap_ng library directory],
1703 [with_libcap_ng_libraries="$withval"],[with_libcap_ng_libraries="no"])
1704
1705 if test "$with_libcap_ng_includes" != "no"; then
89cee0ad 1706 CPPFLAGS="${CPPFLAGS} -I${with_libcap_ng_includes}"
070ed778
VJ
1707 fi
1708
1709 if test "$with_libcap_ng_libraries" != "no"; then
89cee0ad 1710 LDFLAGS="${LDFLAGS} -L${with_libcap_ng_libraries}"
070ed778
VJ
1711 fi
1712
1713 AC_CHECK_HEADER(cap-ng.h,,LIBCAP_NG="no")
1714 if test "$LIBCAP_NG" != "no"; then
1715 LIBCAP_NG=""
1716 AC_CHECK_LIB(cap-ng,capng_clear,,LIBCAP_NG="no")
1717 fi
1718
1719 if test "$LIBCAP_NG" != "no"; then
ba81c4d2 1720 AC_DEFINE([HAVE_LIBCAP_NG],[1],[Libpcap-ng support])
070ed778
VJ
1721 fi
1722
1723 if test "$LIBCAP_NG" = "no"; then
89cee0ad
VJ
1724 echo
1725 echo " WARNING! libcap-ng library not found, go get it"
1726 echo " from http://people.redhat.com/sgrubb/libcap-ng/"
1727 echo " or your distribution:"
1728 echo
1729 echo " Ubuntu: apt-get install libcap-ng-dev"
015cd930 1730 echo " Fedora: dnf install libcap-ng-devel"
1731 echo " CentOS/RHEL: yum install libcap-ng-devel"
89cee0ad
VJ
1732 echo
1733 echo " Suricata will be built without support for dropping privs."
1734 echo
070ed778 1735 fi
829238e4
VJ
1736 ;;
1737 esac
835630ef 1738
91e1256b
EL
1739
1740 AC_ARG_ENABLE(ebpf,
1741 AS_HELP_STRING([--enable-ebpf],[Enable eBPF support]),
d01ce2e5 1742 [ enable_ebpf="$enableval"],
91e1256b
EL
1743 [ enable_ebpf="no"])
1744
731c2b2e 1745 have_xdp="no"
91e1256b
EL
1746 if test "$enable_ebpf" = "yes"; then
1747 AC_CHECK_LIB(elf,elf_begin,,LIBELF="no")
1748 if test "$LIBELF" = "no"; then
1749 echo
1750 echo " libelf library and development headers not found but"
1751 echo " but needed to use eBPF code"
1752 echo
1753 exit 1
1754 fi;
1755
1756 AC_CHECK_LIB(bpf,bpf_object__open,,LIBBPF="no")
1757 if test "$LIBBPF" = "no"; then
1758 echo
1759 echo " libbpf library and development headers not found but"
ccb8f3cd
EL
1760 echo " needed to use eBPF code. It can be found at"
1761 echo " https://github.com/libbpf/libbpf"
91e1256b
EL
1762 echo
1763 exit 1
1764 fi;
1765 AC_CHECK_DECL([PACKET_FANOUT_EBPF],
1766 AC_DEFINE([HAVE_PACKET_EBPF],[1],[Recent ebpf fanout support is available]),
1767 [],
1768 [[#include <linux/if_packet.h>]])
731c2b2e 1769 AC_CHECK_LIB(bpf, bpf_set_link_xdp_fd,have_xdp="yes")
8c880879
EL
1770 if test "$have_xdp" = "yes"; then
1771 AC_DEFINE([HAVE_PACKET_XDP],[1],[XDP support is available])
1772 fi
91e1256b
EL
1773 fi;
1774
89cee0ad 1775 # Check for DAG support.
835630ef 1776 AC_ARG_ENABLE(dag,
6913109b 1777 AS_HELP_STRING([--enable-dag],[Enable DAG capture]),
d01ce2e5 1778 [ enable_dag=$enableval ],
835630ef
JM
1779 [ enable_dag=no])
1780 AC_ARG_WITH(dag_includes,
1781 [ --with-dag-includes=DIR dagapi include directory],
1782 [with_dag_includes="$withval"],[with_dag_includes="no"])
1783 AC_ARG_WITH(dag_libraries,
1784 [ --with-dag-libraries=DIR dagapi library directory],
1785 [with_dag_libraries="$withval"],[with_dag_libraries="no"])
1786
1787 if test "$enable_dag" = "yes"; then
1788
c9cc137d 1789 if test "$with_dag_includes" != "no"; then
835630ef
JM
1790 CPPFLAGS="${CPPFLAGS} -I${with_dag_includes}"
1791 fi
1792
1793 if test "$with_dag_libraries" != "no"; then
573f31b2 1794 LDFLAGS="${LDFLAGS} -L${with_dag_libraries}"
835630ef
JM
1795 fi
1796
1797 AC_CHECK_HEADER(dagapi.h,DAG="yes",DAG="no")
1798 if test "$DAG" != "no"; then
1799 DAG=""
ba81c4d2 1800 AC_CHECK_LIB(dag,dag_open,,DAG="no",)
835630ef
JM
1801 fi
1802
1803 if test "$DAG" = "no"; then
1804 echo
1805 echo " ERROR! libdag library not found"
1806 echo
1807 exit 1
1808 fi
ba81c4d2
VJ
1809
1810 AC_DEFINE([HAVE_DAG],[1],(Endace DAG card support enabled))
835630ef
JM
1811 fi
1812
7ea269a2 1813# libnspr (enabled by default)
8f926fb7 1814 AC_ARG_ENABLE(nspr,
4ece6ba7
VJ
1815 AS_HELP_STRING([--disable-nspr],[Disable libnspr support]),
1816 [enable_nspr=$enableval],[enable_nspr="yes"])
7ea269a2 1817
69b3df96
VJ
1818 AC_ARG_WITH(libnspr_includes,
1819 [ --with-libnspr-includes=DIR libnspr include directory],
7ea269a2 1820 [with_libnspr_includes="$withval"],[with_libnspr_includes="no"])
1821
69b3df96
VJ
1822 AC_ARG_WITH(libnspr_libraries,
1823 [ --with-libnspr-libraries=DIR libnspr library directory],
1824 [with_libnspr_libraries="$withval"],[with_libnspr_libraries="no"])
1825
8f926fb7 1826 if test "$enable_nspr" != "no"; then
4ece6ba7 1827 # Try pkg-config first:
7ea269a2 1828 PKG_CHECK_MODULES([libnspr],nspr,,[with_pkgconfig_nspr="no"])
1829
4ece6ba7
VJ
1830 if test "$with_pkgconfig_nspr" != "no"; then
1831 CPPFLAGS="${CPPFLAGS} ${libnspr_CFLAGS}"
1832 LIBS="${LIBS} ${libnspr_LIBS}"
1833 fi
1834
1835 if test "$with_libnspr_includes" != "no"; then
1836 CPPFLAGS="${CPPFLAGS} -I${with_libnspr_includes}"
1837 fi
7ea269a2 1838 TMPLIBS="${LIBS}"
1839 AC_CHECK_HEADER(nspr.h,
1840 AC_CHECK_LIB(nspr4,PR_GetCurrentThread,[AC_DEFINE([HAVE_NSPR],[1],[libnspr available])
1841 NSPR="yes"
1842 if test "$NSPR" = "yes"; then
1843 if test "$with_libnspr_libraries" != "no"; then
1844 LDFLAGS="${LDFLAGS} -L${with_libnspr_libraries}"
1845 LIBS="${TMPLIBS}"
1846 else
1847 LIBS="${TMPLIBS}"
1848 fi
1849 fi]),NSPR="no")
4ece6ba7 1850
7ea269a2 1851 if test "$NSPR" = "no"; then
1852 echo
1853 echo " ERROR! libnspr library not found, go get it"
1854 echo " from Mozilla or your distribution:"
1855 echo
1856 echo " Ubuntu: apt-get install libnspr4-dev"
1857 echo " Fedora: dnf install nspr-devel"
1858 echo " CentOS/RHEL: yum install nspr-devel"
1859 echo
4ece6ba7 1860 fi
69b3df96 1861 fi
337f7861 1862
dd2063a7 1863 # libnss (enabled by default)
1864
8f926fb7 1865 AC_ARG_ENABLE(nss,
4ece6ba7
VJ
1866 AS_HELP_STRING([--disable-nss],[Disable libnss support]),
1867 [enable_nss=$enableval],[enable_nss="yes"])
dd2063a7 1868
69b3df96
VJ
1869 AC_ARG_WITH(libnss_includes,
1870 [ --with-libnss-includes=DIR libnss include directory],
4ece6ba7 1871 [with_libnss_includes="$withval"],[with_libnss_includes="no"])
dd2063a7 1872
69b3df96
VJ
1873 AC_ARG_WITH(libnss_libraries,
1874 [ --with-libnss-libraries=DIR libnss library directory],
1875 [with_libnss_libraries="$withval"],[with_libnss_libraries="no"])
1876
8f926fb7 1877 if test "$enable_nss" != "no"; then
4ece6ba7 1878 # Try pkg-config first:
dd2063a7 1879 PKG_CHECK_MODULES([libnss],nss,,[with_pkgconfig_nss="no"])
1880
4ece6ba7
VJ
1881 if test "$with_pkgconfig_nss" != "no"; then
1882 CPPFLAGS="${CPPFLAGS} ${libnss_CFLAGS}"
1883 LIBS="${LIBS} ${libnss_LIBS}"
1884 fi
dd2063a7 1885
4ece6ba7
VJ
1886 if test "$with_libnss_includes" != "no"; then
1887 CPPFLAGS="${CPPFLAGS} -I${with_libnss_includes}"
1888 fi
dd2063a7 1889 TMPLIBS="${LIBS}"
4ece6ba7 1890
dd2063a7 1891 AC_CHECK_HEADER(sechash.h,
1892 AC_CHECK_LIB(nss3,HASH_Begin,[AC_DEFINE([HAVE_NSS],[1],[libnss available])
1893 NSS="yes"
1894 if test "$NSS" = "yes"; then
1895 if test "$with_libnss_libraries" != "no"; then
1896 LDFLAGS="${LDFLAGS} -L${with_libnss_libraries}"
1897 LIBS="${TMPLIBS}"
1898 else
1899 LIBS="${TMPLIBS}"
1900 fi
1901 fi]),NSS="no")
4ece6ba7 1902
dd2063a7 1903 if test "$NSS" = "no"; then
1904 echo
1905 echo " ERROR! libnss library not found, go get it"
1906 echo " from Mozilla or your distribution:"
1907 echo
1908 echo " Ubuntu: apt-get install libnss3-dev"
1909 echo " Fedora: dnf install nss-devel"
1910 echo " CentOS/RHEL: yum install nss-devel"
1911 echo
4ece6ba7 1912 fi
69b3df96
VJ
1913 fi
1914
89cee0ad 1915 # libmagic
810e43f3
VJ
1916 enable_magic="no"
1917 AC_ARG_ENABLE(libmagic,
1918 AS_HELP_STRING([--enable-libmagic], [Enable libmagic support [default=yes]]),
d01ce2e5 1919 [enable_magic=$enableval],[enable_magic=yes])
810e43f3
VJ
1920 if test "$enable_magic" = "yes"; then
1921 AC_ARG_WITH(libmagic_includes,
1922 [ --with-libmagic-includes=DIR libmagic include directory],
1923 [with_libmagic_includes="$withval"],[with_libmagic_includes=no])
1924 AC_ARG_WITH(libmagic_libraries,
1925 [ --with-libmagic-libraries=DIR libmagic library directory],
1926 [with_libmagic_libraries="$withval"],[with_libmagic_libraries="no"])
1927
1928 if test "$with_libmagic_includes" != "no"; then
1929 CPPFLAGS="${CPPFLAGS} -I${with_libmagic_includes}"
1930 fi
f4a6f4b2 1931
810e43f3
VJ
1932 AC_CHECK_HEADER(magic.h,,MAGIC="no")
1933 if test "$MAGIC" != "no"; then
1934 MAGIC=""
1935 AC_CHECK_LIB(magic, magic_open,, MAGIC="no")
1936 fi
f4a6f4b2 1937
810e43f3
VJ
1938 if test "x$MAGIC" != "xno"; then
1939 if test "$with_libmagic_libraries" != "no"; then
1940 LDFLAGS="${LDFLAGS} -L${with_libmagic_libraries}"
1941 fi
1942 AC_DEFINE([HAVE_MAGIC],[1],(Libmagic for file handling))
1943 else
1944 echo
1945 echo " WARNING! magic library not found, go get it"
1946 echo " from http://www.darwinsys.com/file/ or your distribution:"
1947 echo
1948 echo " Ubuntu: apt-get install libmagic-dev"
015cd930 1949 echo " Fedora: dnf install file-devel"
1950 echo " CentOS/RHEL: yum install file-devel"
810e43f3
VJ
1951 echo
1952 enable_magic="no"
1953 fi
f4a6f4b2
VJ
1954 fi
1955
37e3de84
MK
1956 # Napatech - Using the 3GD API
1957 AC_ARG_ENABLE(napatech,
6913109b 1958 AS_HELP_STRING([--enable-napatech],[Enabled Napatech Devices]),
d01ce2e5 1959 [ enable_napatech=$enableval ],
37e3de84
MK
1960 [ enable_napatech=no])
1961 AC_ARG_WITH(napatech_includes,
1962 [ --with-napatech-includes=DIR napatech include directory],
1963 [with_napatech_includes="$withval"],[with_napatech_includes="/opt/napatech3/include"])
1964 AC_ARG_WITH(napatech_libraries,
1965 [ --with-napatech-libraries=DIR napatech library directory],
1966 [with_napatech_libraries="$withval"],[with_napatech_libraries="/opt/napatech3/lib"])
1967
1968 if test "$enable_napatech" = "yes"; then
1969 CPPFLAGS="${CPPFLAGS} -I${with_napatech_includes}"
1970 LDFLAGS="${LDFLAGS} -L${with_napatech_libraries} -lntapi"
1971 AC_CHECK_HEADER(nt.h,NAPATECH="yes",NAPATECH="no")
1972 if test "$NAPATECH" != "no"; then
1973 NAPATECH=""
1974 AC_CHECK_LIB(ntapi, NT_Init,NAPATECH="yes",NAPATECH="no")
844e4dba
MK
1975 fi
1976
37e3de84 1977 if test "$NAPATECH" = "no"; then
844e4dba
MK
1978 echo
1979 echo " ERROR! libntapi library not found"
1980 echo
1981 exit 1
05271bfb
PY
1982 else
1983 AC_CHECK_LIB(numa, numa_available,, LIBNUMA="no")
1984 if test "$LIBNUMA" = "no"; then
1985 echo
1986 echo " WARNING: libnuma is required to use Napatech auto-config"
1987 echo " libnuma is not found. Go get it"
1988 echo " from http://github.com/numactl/numactl or your distribution:"
1989 echo " Ubuntu: apt-get install libnuma-dev"
1990 echo " Fedora: dnf install numactl-devel"
1991 echo " CentOS/RHEL: yum install numactl-devel"
1992 echo
1993 exit 1
1994 fi
844e4dba 1995 fi
ba81c4d2
VJ
1996
1997 AC_DEFINE([HAVE_NAPATECH],[1],(Napatech capture card support))
844e4dba
MK
1998 fi
1999
e366c62c
VJ
2000 # liblua
2001 AC_ARG_ENABLE(lua,
2002 AS_HELP_STRING([--enable-lua],[Enable Lua support]),
d01ce2e5 2003 [ enable_lua="$enableval"],
e366c62c 2004 [ enable_lua="no"])
ba81c4d2
VJ
2005 AC_ARG_ENABLE(luajit,
2006 AS_HELP_STRING([--enable-luajit],[Enable Luajit support]),
d01ce2e5 2007 [ enable_luajit="$enableval"],
ba81c4d2
VJ
2008 [ enable_luajit="no"])
2009 if test "$enable_lua" = "yes"; then
2010 if test "$enable_luajit" = "yes"; then
2011 echo "ERROR: can't enable liblua and luajit at the same time."
2012 echo "For LuaJIT, just use --enable-luajit. For liblua (no jit)"
2013 echo "support, use just --enable-lua."
2014 echo "Both options will enable the Lua scripting capabilities"
2015 echo "in Suricata".
2016 echo
2017 exit 1
2018 fi
2019 fi
2020
e366c62c
VJ
2021 AC_ARG_WITH(liblua_includes,
2022 [ --with-liblua-includes=DIR liblua include directory],
2023 [with_liblua_includes="$withval"],[with_liblua_includes="no"])
2024 AC_ARG_WITH(liblua_libraries,
2025 [ --with-liblua-libraries=DIR liblua library directory],
2026 [with_liblua_libraries="$withval"],[with_liblua_libraries="no"])
2027
2028 if test "$enable_lua" = "yes"; then
2029 if test "$with_liblua_includes" != "no"; then
2030 CPPFLAGS="${CPPFLAGS} -I${with_liblua_includes}"
2031 else
da1fe759
VJ
2032 # lua lua51 lua5.1 lua-5.1
2033 PKG_CHECK_MODULES([LUA], [lua], [LUA="yes"], [
2034 PKG_CHECK_MODULES([LUA], [lua5.1], [LUA="yes"], [
2035 PKG_CHECK_MODULES([LUA], [lua-5.1], [LUA="yes"], [
2036 PKG_CHECK_MODULES([LUA], [lua51], [LUA="yes"], [
2037 LUA="no"
2038 ])
2039 ])
2040 ])
2041 ])
e366c62c
VJ
2042 CPPFLAGS="${CPPFLAGS} ${LUA_CFLAGS}"
2043 fi
2044
2045 AC_CHECK_HEADER(lualib.h,LUA="yes",LUA="no")
2046 if test "$LUA" = "yes"; then
2047 if test "$with_liblua_libraries" != "no"; then
2048 LDFLAGS="${LDFLAGS} -L${with_liblua_libraries}"
da1fe759
VJ
2049 AC_CHECK_LIB(${LUA_LIB_NAME}, luaL_openlibs,, LUA="no")
2050 if test "$LUA" = "no"; then
2051 echo
2052 echo " ERROR! liblua library not found, go get it"
2053 echo " from http://lua.org/index.html or your distribution:"
2054 echo
5db32204 2055 echo " Ubuntu: apt-get install liblua5.1-dev"
015cd930 2056 echo " Fedora: dnf install lua-devel"
2057 echo " CentOS/RHEL: yum install lua-devel"
da1fe759
VJ
2058 echo
2059 echo " If you installed software in a non-standard prefix"
2060 echo " consider adjusting the PKG_CONFIG_PATH environment variable"
2061 echo " or use --with-liblua-libraries configure option."
2062 echo
2063 exit 1
2064 fi
e366c62c 2065 else
da1fe759
VJ
2066 # lua lua51 lua5.1 lua-5.1
2067 PKG_CHECK_MODULES([LUA], [lua], [LUA="yes"], [
2068 PKG_CHECK_MODULES([LUA], [lua5.1], [LUA="yes"], [
2069 PKG_CHECK_MODULES([LUA], [lua-5.1], [LUA="yes"], [
2070 PKG_CHECK_MODULES([LUA], [lua51], [LUA="yes"], [
2071 LUA="no"
2072 ])
2073 ])
2074 ])
2075 ])
e366c62c
VJ
2076 LDFLAGS="${LDFLAGS} ${LUA_LIBS}"
2077 fi
2078
6228f5f6
VJ
2079 if test "$LUA" = "no"; then
2080 AC_CHECK_LIB(lua, luaL_openlibs,, LUA="no")
2081 fi
2082
2083 if test "$LUA" = "yes"; then
2084 AC_DEFINE([HAVE_LUA],[1],[liblua available])
2085 enable_lua="yes"
2086 fi
e366c62c
VJ
2087 else
2088 echo
2089 echo " ERROR! liblua headers not found, go get them"
2090 echo " from http://lua.org/index.html or your distribution:"
2091 echo
5db32204 2092 echo " Ubuntu: apt-get install liblua5.1-dev"
015cd930 2093 echo " Fedora: dnf install lua-devel"
2094 echo " CentOS/RHEL: yum install lua-devel"
e366c62c
VJ
2095 echo
2096 echo " If you installed software in a non-standard prefix"
2097 echo " consider adjusting the PKG_CONFIG_PATH environment variable"
2098 echo " or use --with-liblua-includes and --with-liblua-libraries"
2099 echo " configure option."
2100 echo
2101 exit 1
2102 fi
2103 fi
2104
5b2fbfb1 2105 # libluajit
5b2fbfb1
VJ
2106 AC_ARG_WITH(libluajit_includes,
2107 [ --with-libluajit-includes=DIR libluajit include directory],
c9cc137d 2108 [with_libluajit_includes="$withval"],[with_libluajit_includes="no"])
5b2fbfb1
VJ
2109 AC_ARG_WITH(libluajit_libraries,
2110 [ --with-libluajit-libraries=DIR libluajit library directory],
2111 [with_libluajit_libraries="$withval"],[with_libluajit_libraries="no"])
2112
c9cc137d
VJ
2113 if test "$enable_luajit" = "yes"; then
2114 if test "$with_libluajit_includes" != "no"; then
2115 CPPFLAGS="${CPPFLAGS} -I${with_libluajit_includes}"
819debdc 2116 else
344ea3fa 2117 PKG_CHECK_MODULES([LUAJIT], [luajit], , LUAJIT="no")
819debdc 2118 CPPFLAGS="${CPPFLAGS} ${LUAJIT_CFLAGS}"
5b2fbfb1
VJ
2119 fi
2120
c9cc137d
VJ
2121 AC_CHECK_HEADER(lualib.h,LUAJIT="yes",LUAJIT="no")
2122 if test "$LUAJIT" = "yes"; then
2123 if test "$with_libluajit_libraries" != "no"; then
2124 LDFLAGS="${LDFLAGS} -L${with_libluajit_libraries}"
819debdc
EL
2125 else
2126 PKG_CHECK_MODULES([LUAJIT], [luajit])
2127 LDFLAGS="${LDFLAGS} ${LUAJIT_LIBS}"
c9cc137d 2128 fi
5b2fbfb1 2129
c9cc137d 2130 AC_CHECK_LIB(luajit-5.1, luaL_openlibs,, LUAJIT="no")
5b2fbfb1 2131
c9cc137d
VJ
2132 if test "$LUAJIT" = "no"; then
2133 echo
2134 echo " ERROR! libluajit library not found, go get it"
2135 echo " from http://luajit.org/index.html or your distribution:"
2136 echo
2137 echo " Ubuntu: apt-get install libluajit-5.1-dev"
2138 echo
344ea3fa
EL
2139 echo " If you installed software in a non-standard prefix"
2140 echo " consider adjusting the PKG_CONFIG_PATH environment variable"
2141 echo " or use --with-libluajit-libraries configure option."
2142 echo
c9cc137d
VJ
2143 exit 1
2144 fi
2145
e366c62c 2146 AC_DEFINE([HAVE_LUA],[1],[lua support available])
c9cc137d 2147 AC_DEFINE([HAVE_LUAJIT],[1],[libluajit available])
ba81c4d2 2148 enable_lua="yes, through luajit"
c9cc137d 2149 enable_luajit="yes"
e125869d
EL
2150 else
2151 echo
2152 echo " ERROR! libluajit headers not found, go get them"
2153 echo " from http://luajit.org/index.html or your distribution:"
2154 echo
2155 echo " Ubuntu: apt-get install libluajit-5.1-dev"
2156 echo
344ea3fa
EL
2157 echo " If you installed software in a non-standard prefix"
2158 echo " consider adjusting the PKG_CONFIG_PATH environment variable"
2159 echo " or use --with-libluajit-includes and --with-libluajit-libraries"
2160 echo " configure option."
2161 echo
e125869d 2162 exit 1
c9cc137d 2163 fi
5b2fbfb1
VJ
2164 fi
2165
9d687025
JI
2166 AM_CONDITIONAL([HAVE_LUA], [test "x$enable_lua" != "xno"])
2167
a291209e 2168 # libmaxminddb
d771e081 2169 AC_ARG_ENABLE(geoip,
a291209e
BM
2170 AS_HELP_STRING([--enable-geoip],[Enable GeoIP2 support]),
2171 [ enable_geoip="yes"],
d771e081 2172 [ enable_geoip="no"])
a291209e
BM
2173 AC_ARG_WITH(libmaxminddb_includes,
2174 [ --with-libmaxminddb-includes=DIR libmaxminddb include directory],
2175 [with_libmaxminddb_includes="$withval"],[with_libmaxminddb_includes="no"])
2176 AC_ARG_WITH(libmaxminddb_libraries,
2177 [ --with-libmaxminddb-libraries=DIR libmaxminddb library directory],
2178 [with_libmaxminddb_libraries="$withval"],[with_libmaxminddb_libraries="no"])
d771e081
IS
2179
2180 if test "$enable_geoip" = "yes"; then
a291209e
BM
2181 if test "$with_libmaxminddb_includes" != "no"; then
2182 CPPFLAGS="${CPPFLAGS} -I${with_libmaxminddb_includes}"
d771e081
IS
2183 fi
2184
a291209e 2185 AC_CHECK_HEADER(maxminddb.h,GEOIP="yes",GEOIP="no")
d771e081 2186 if test "$GEOIP" = "yes"; then
a291209e
BM
2187 if test "$with_libmaxminddb_libraries" != "no"; then
2188 LDFLAGS="${LDFLAGS} -L${with_libmaxminddb_libraries}"
d771e081 2189 fi
a291209e 2190 AC_CHECK_LIB(maxminddb, MMDB_open,, GEOIP="no")
d771e081
IS
2191 fi
2192 if test "$GEOIP" = "no"; then
2193 echo
a291209e
BM
2194 echo " ERROR! libmaxminddb GeoIP2 library not found, go get it"
2195 echo " from https://github.com/maxmind/libmaxminddb or your distribution:"
d771e081 2196 echo
a291209e
BM
2197 echo " Ubuntu: apt-get install libmaxminddb-dev"
2198 echo " Fedora: dnf install libmaxminddb-devel"
2199 echo " CentOS/RHEL: yum install libmaxminddb-devel"
d771e081
IS
2200 echo
2201 exit 1
2202 fi
ba81c4d2 2203
a291209e 2204 AC_DEFINE([HAVE_GEOIP],[1],[libmaxminddb available])
ba81c4d2 2205 enable_geoip="yes"
d771e081
IS
2206 fi
2207
437fe406
AG
2208 # Position Independent Executable
2209 AC_ARG_ENABLE(pie,
2210 AS_HELP_STRING([--enable-pie],[Enable compiling as a position independent executable]),
d01ce2e5 2211 [ enable_pie="$enableval"],
437fe406
AG
2212 [ enable_pie="no"])
2213 if test "$enable_pie" = "yes"; then
2214 CPPFLAGS="${CPPFLAGS} -fPIC"
2215 LDFLAGS="${LDFLAGS} -pie"
2216 fi
2217
a64e5e77 2218#libevent includes and libraries
2219 AC_ARG_WITH(libevent_includes,
2220 [ --with-libevent-includes=DIR libevent include directory],
2221 [with_libevent_includes="$withval"],[with_libevent_includes="no"])
2222 AC_ARG_WITH(libevent_libraries,
2223 [ --with-libevent-libraries=DIR libevent library directory],
2224 [with_libevent_libraries="$withval"],[with_libevent_libraries="no"])
2225
eef5678e
EL
2226# libhiredis
2227 AC_ARG_ENABLE(hiredis,
2228 AS_HELP_STRING([--enable-hiredis],[Enable Redis support]),
d01ce2e5 2229 [ enable_hiredis="$enableval"],
eef5678e
EL
2230 [ enable_hiredis="no"])
2231 AC_ARG_WITH(libhiredis_includes,
2232 [ --with-libhiredis-includes=DIR libhiredis include directory],
2233 [with_libhiredis_includes="$withval"],[with_libhiredis_includes="no"])
2234 AC_ARG_WITH(libhiredis_libraries,
2235 [ --with-libhiredis-libraries=DIR libhiredis library directory],
2236 [with_libhiredis_libraries="$withval"],[with_libhiredis_libraries="no"])
2237
a64e5e77 2238 enable_hiredis_async="no"
eef5678e
EL
2239 if test "$enable_hiredis" = "yes"; then
2240 if test "$with_libhiredis_includes" != "no"; then
2241 CPPFLAGS="${CPPFLAGS} -I${with_libhiredis_includes}"
2242 fi
2243
2244 AC_CHECK_HEADER("hiredis/hiredis.h",HIREDIS="yes",HIREDIS="no")
2245 if test "$HIREDIS" = "yes"; then
2246 if test "$with_libhiredis_libraries" != "no"; then
2247 LDFLAGS="${LDFLAGS} -L${with_libhiredis_libraries}"
2248 fi
2249 AC_CHECK_LIB(hiredis, redisConnect,, HIREDIS="no")
2250 fi
2251 if test "$HIREDIS" = "no"; then
2252 echo
2253 echo " ERROR! libhiredis library not found, go get it"
2254 echo " from https://github.com/redis/hiredis or your distribution:"
2255 echo
2256 echo " Ubuntu: apt-get install libhiredis-dev"
80bd59ae 2257 echo " Fedora: dnf install hiredis-devel"
015cd930 2258 echo " CentOS/RHEL: yum install hiredis-devel"
eef5678e
EL
2259 echo
2260 exit 1
2261 fi
2262 if test "$HIREDIS" = "yes"; then
2263 AC_DEFINE([HAVE_LIBHIREDIS],[1],[libhiredis available])
2264 enable_hiredis="yes"
a64e5e77 2265 #
2266 # Check if async adapters and libevent is installed
2267 #
2268 AC_CHECK_HEADER("hiredis/adapters/libevent.h",HIREDIS_LIBEVENT_ADAPTER="yes",HIREDIS_LIBEVENT_ADAPTER="no")
2269 if test "$HIREDIS_LIBEVENT_ADAPTER" = "yes"; then
2270 #Look for libevent headers
2271 if test "$with_libevent_includes" != "no"; then
2272 CPPFLAGS="${CPPFLAGS} -I${with_libevent_includes}"
2273 fi
2274 AC_CHECK_HEADER("event.h",LIBEVENT="yes",LIBEVENT="no")
2275 if test "$LIBEVENT" = "yes"; then
2276 if test "$with_libevent_libraries" != "no"; then
2277 LDFLAGS="${LDFLAGS} -L${with_libevent_libraries}"
2278 fi
2279 AC_CHECK_LIB(event, event_base_free,, HAVE_LIBEVENT="no")
2280 AC_CHECK_LIB(event_pthreads, evthread_use_pthreads,, HAVE_LIBEVENT_PTHREADS="no")
2281 fi
7ea80b5c 2282 if [ test "$HAVE_LIBEVENT" = "no" ] && [ -o test "$HAVE_LIBEVENT_PTHREADS" = "no"]; then
a64e5e77 2283 if test "$HAVE_LIBEVENT" = "no"; then
2284 echo
2285 echo " Async mode for redis output will not be available."
2286 echo " To enable it install libevent"
2287 echo
2288 echo " Ubuntu: apt-get install libevent-dev"
0f41172c 2289 echo " Fedora: dnf install libevent-devel"
015cd930 2290 echo " CentOS/RHEL: yum install libevent-devel"
a64e5e77 2291 echo
2292 fi
2293 if test "$HAVE_LIBEVENT_PTHREADS" = "no"; then
2294 echo
2295 echo " Async mode for redis output will not be available."
2296 echo " To enable it install libevent with pthreads support"
2297 echo
2298 echo " Ubuntu: apt-get install libevent-pthreads-2.0-5"
2299 echo
2300 fi
2301 else
2302 AC_DEFINE([HAVE_LIBEVENT],[1],[libevent available])
2303 enable_hiredis_async="yes"
2304 fi
2305 fi
eef5678e
EL
2306 fi
2307 fi
2308
b85a0b18 2309# Check for lz4
58e92392
MF
2310enable_liblz4="yes"
2311AC_CHECK_LIB(lz4, LZ4F_createCompressionContext, , enable_liblz4="no")
2312
2313if test "$enable_liblz4" = "no"; then
2314 echo
2315 echo " Compressed pcap logging is not available without liblz4."
2316 echo " If you want to enable compression, you need to install it."
2317 echo
2318 echo " Ubuntu: apt-get install liblz4-dev"
2319 echo " Fedora: dnf install lz4-devel"
015cd930 2320 echo " CentOS/RHEL: yum install epel-release"
58e92392
MF
2321 echo " yum install lz4-devel"
2322 echo
2323fi
b85a0b18 2324
724ad9e8
VJ
2325# get cache line size
2326 AC_PATH_PROG(HAVE_GETCONF_CMD, getconf, "no")
2327 if test "$HAVE_GETCONF_CMD" != "no"; then
2328 CLS=$(getconf LEVEL1_DCACHE_LINESIZE)
fdc3b5ba 2329 if [test "$CLS" != "" && test "$CLS" != "0"]; then
0ddd57cb 2330 AC_DEFINE_UNQUOTED([CLS],[${CLS}],[L1 cache line size])
71c22ddf 2331 else
ba81c4d2 2332 AC_DEFINE([CLS],[64],[L1 cache line size])
0ddd57cb 2333 fi
71c22ddf 2334 else
ba81c4d2 2335 AC_DEFINE([CLS],[64],[L1 cache line size])
724ad9e8 2336 fi
d771e081 2337
6eedd006
JI
2338# sphinx for documentation
2339 AC_PATH_PROG(HAVE_SPHINXBUILD, sphinx-build, "no")
2340 if test "$HAVE_SPHINXBUILD" = "no"; then
2341 enable_sphinxbuild=no
7fa390de
JI
2342 if test -e "$srcdir/doc/userguide/suricata.1"; then
2343 have_suricata_man=yes
2344 fi
6eedd006
JI
2345 fi
2346 AM_CONDITIONAL([HAVE_SPHINXBUILD], [test "x$enable_sphinxbuild" != "xno"])
7fa390de 2347 AM_CONDITIONAL([HAVE_SURICATA_MAN], [test "x$have_suricata_man" = "xyes"])
6eedd006 2348
0792f809
JI
2349# pdflatex for the pdf version of the user manual
2350 AC_PATH_PROG(HAVE_PDFLATEX, pdflatex, "no")
2351 if test "$HAVE_PDFLATEX" = "no"; then
2352 enable_pdflatex=no
2353 fi
2354 AM_CONDITIONAL([HAVE_PDFLATEX], [test "x$enable_pdflatex" != "xno"])
2355
75429bbe
JI
2356# Cargo/Rust
2357 AC_PATH_PROG(RUSTC, rustc, "no")
2358 if test "$RUSTC" = "no"; then
2359 echo ""
2360 echo " ERROR: Suricata now requires Rust to build."
2361 echo ""
2362 echo " Ubuntu/Debian: apt install rustc cargo"
2363 echo " Fedora: dnf install rustc cargo"
2364 echo " CentOS: yum install rustc cargo (requires EPEL)"
2365 echo ""
2366 echo " Rustup works as well: https://rustup.rs/"
2367 echo ""
2368 exit 1
2369 fi
2370
2371 AC_PATH_PROG(CARGO, cargo, "no")
2372 if test "CARGO" = "no"; then
2373 AC_MSG_ERROR([cargo required])
2374 fi
2375
2376 AC_DEFINE([HAVE_RUST],[1],[Enable Rust language])
2377 AM_CONDITIONAL([HAVE_RUST],true)
2378 AC_SUBST([CARGO], [$CARGO])
2379
2380 enable_rust="yes"
2381 rust_compiler_version=$($RUSTC --version)
2382 rust_cargo_version=$($CARGO --version)
4fe9292e 2383
8f81792d
JI
2384 rust_vendor_comment="# "
2385 have_rust_vendor="no"
ed712768
VJ
2386 rust_compiler_version="not set"
2387 rust_cargo_version="not set"
8f81792d 2388
75429bbe
JI
2389 # We may require Python if the Rust header stubs are not already
2390 # generated.
2391 if test "x$enable_python" != "xyes" && test ! -f rust/gen/c-headers/rust-core-gen.h; then
699fd6cb
EL
2392 echo ""
2393 echo " ERROR! Rust support requires Python."
2394 echo
2395 echo " Ubuntu: apt install python"
b98c28a6 2396 echo
699fd6cb 2397 exit 1
75429bbe 2398 fi
75429bbe
JI
2399 if test "x$enable_debug" = "xyes"; then
2400 RUST_SURICATA_LIB="../rust/target/debug/${RUST_SURICATA_LIBNAME}"
2401 else
2402 RUST_SURICATA_LIB="../rust/target/release/${RUST_SURICATA_LIBNAME}"
2403 fi
f750e4ca 2404
75429bbe
JI
2405 RUST_LDADD="${RUST_SURICATA_LIB} ${RUST_LDADD}"
2406 CFLAGS="${CFLAGS} -I\${srcdir}/../rust/gen/c-headers"
2407 AC_SUBST(RUST_SURICATA_LIB)
2408 AC_SUBST(RUST_LDADD)
2409 if test "x$CARGO_HOME" = "x"; then
2410 AC_SUBST([CARGO_HOME], [~/.cargo])
2411 else
2412 AC_SUBST([CARGO_HOME], [$CARGO_HOME])
8f81792d 2413 fi
75429bbe
JI
2414 AC_CHECK_FILES([$srcdir/rust/vendor], [have_rust_vendor="yes"])
2415 if test "x$have_rust_vendor" = "xyes"; then
2416 rust_vendor_comment=""
2417 fi
2418
2419 rust_compiler_version=$(rustc --version)
2420 rust_cargo_version=$(cargo --version)
8f81792d 2421
8f81792d
JI
2422 AC_SUBST(rust_vendor_comment)
2423 AM_CONDITIONAL([HAVE_RUST_VENDOR], [test "x$have_rust_vendor" = "xyes"])
2424
ed712768 2425 if test "x$enable_rust" = "xyes" || test "x$enable_rust" = "xyes (default)"; then
8f81792d
JI
2426 AC_PATH_PROG(HAVE_CARGO_VENDOR, cargo-vendor, "no")
2427 if test "x$HAVE_CARGO_VENDOR" = "xno"; then
2428 echo " Warning: cargo-vendor not found, but it is only required"
2429 echo " for building the distribution"
2430 echo " To install: cargo install cargo-vendor"
2431 fi
2432 fi
2433 AM_CONDITIONAL([HAVE_CARGO_VENDOR], [test "x$HAVE_CARGO_VENDOR" != "xno"])
2434
6a4cefb7 2435 AC_ARG_ENABLE(rust_strict,
d01ce2e5 2436 AS_HELP_STRING([--enable-rust-strict], [Rust warnings as errors]),[enable_rust_strict=$enableval],[enable_rust_strict=no])
6a4cefb7
JI
2437 AS_IF([test "x$enable_rust_strict" = "xyes"], [
2438 RUST_FEATURES="strict"
2439 ])
2440 AC_SUBST(RUST_FEATURES)
2441
e3bde3e9
VJ
2442# get revision
2443 if test -f ./revision; then
2444 REVISION=`cat ./revision`
ba81c4d2 2445 AC_DEFINE_UNQUOTED([REVISION],[${REVISION}],[Git revision])
e3bde3e9 2446 else
042d0c6e
VJ
2447 AC_PATH_PROG(HAVE_GIT_CMD, git, "no")
2448 if test "$HAVE_GIT_CMD" != "no"; then
5886ef82
VJ
2449 if [ test -d .git ]; then
2450 REVISION=`git rev-parse --short HEAD`
8c2c78f0
SB
2451 DATE=`git log -1 --date=short --pretty=format:%cd`
2452 REVISION="$REVISION $DATE"
ba81c4d2 2453 AC_DEFINE_UNQUOTED([REVISION],[${REVISION}],[Git revision])
5886ef82 2454 fi
e3bde3e9
VJ
2455 fi
2456 fi
2457
53a62953
EL
2458if test "${enable_ebpf}" = "yes" || test "${enable_unittests}" = "yes"; then
2459 AC_DEFINE([CAPTURE_OFFLOAD_MANAGER], [1],[Building flow bypass manager code])
2460fi
2461if test "${enable_ebpf}" = "yes" || test "${enable_nfqueue}" = "yes" || test "${enable_pfring}" = "yes" || test "${enable_unittests}" = "yes"; then
2462 AC_DEFINE([CAPTURE_OFFLOAD], [1],[Building flow capture bypass code])
2463fi
2464
0ffa1c24
WM
2465AC_SUBST(CFLAGS)
2466AC_SUBST(LDFLAGS)
2467AC_SUBST(CPPFLAGS)
2468
25804f5a
EL
2469define([EXPAND_VARIABLE],
2470[$2=[$]$1
2471if test $prefix = 'NONE'; then
2472 prefix="/usr/local"
2473fi
2474while true; do
2475 case "[$]$2" in
2476 *\[$]* ) eval "$2=[$]$2" ;;
2477 *) break ;;
2478 esac
2479done
2480eval "$2=[$]$2$3"
2481])dnl EXPAND_VARIABLE
2482
2483# suricata log dir
2484if test "$WINDOWS_PATH" = "yes"; then
6b751621
VJ
2485 case $host in
2486 x86_64-w64-mingw32)
2487 e_winbase="C:\\\\Program Files\\\\Suricata"
2488 ;;
2489 *)
2490 systemtype="`systeminfo | grep \"based PC\"`"
2491 case "$systemtype" in
2492 *x64*)
2493 e_winbase="C:\\\\Program Files (x86)\\\\Suricata"
2494 ;;
2495 *)
2496 e_winbase="C:\\\\Program Files\\\\Suricata"
2497 ;;
2498 esac
2499 esac
d8356c5e 2500
6b751621
VJ
2501 e_sysconfdir="${e_winbase}\\\\"
2502 e_sysconfrulesdir="$e_winbase\\\\rules\\\\"
e048a74e 2503 e_defaultruledir="$e_winbase\\\\rules\\\\"
6b751621
VJ
2504 e_magic_file="$e_winbase\\\\magic.mgc"
2505 e_logdir="$e_winbase\\\\log"
2506 e_logfilesdir="$e_logdir\\\\files"
2507 e_logcertsdir="$e_logdir\\\\certs"
7bf49006 2508 e_datarulesdir="$e_winbase\\\\rules\\\\"
24d6a164
VJ
2509 if test "$HAVE_CYGPATH" != "no"; then
2510 # turn srcdir into abs path and convert to the
2511 # mixed output (/c/Users/dev into c:/Users/dev)
2512 e_rustdir="$(cygpath -a -t mixed ${srcdir})/rust"
2513 else
2514 e_abs_srcdir=$(cd $srcdir && pwd)
2515 e_rustdir="$e_abs_srcdir/rust"
2516 fi
25804f5a 2517else
6b751621
VJ
2518 EXPAND_VARIABLE(localstatedir, e_logdir, "/log/suricata/")
2519 EXPAND_VARIABLE(localstatedir, e_rundir, "/run/")
2520 EXPAND_VARIABLE(localstatedir, e_logfilesdir, "/log/suricata/files")
2521 EXPAND_VARIABLE(localstatedir, e_logcertsdir, "/log/suricata/certs")
2522 EXPAND_VARIABLE(sysconfdir, e_sysconfdir, "/suricata/")
2523 EXPAND_VARIABLE(sysconfdir, e_sysconfrulesdir, "/suricata/rules")
2524 EXPAND_VARIABLE(localstatedir, e_localstatedir, "/run/suricata")
7bf49006 2525 EXPAND_VARIABLE(datadir, e_datarulesdir, "/suricata/rules")
e048a74e 2526 EXPAND_VARIABLE(ruledirprefix, e_defaultruledir, "/suricata/rules")
24d6a164
VJ
2527
2528 e_abs_srcdir=$(cd $srcdir && pwd)
2529 EXPAND_VARIABLE(e_abs_srcdir, e_rustdir, "/rust")
25804f5a
EL
2530fi
2531AC_SUBST(e_logdir)
1c3546fe 2532AC_SUBST(e_rundir)
d8356c5e 2533AC_SUBST(e_logfilesdir)
55625d73 2534AC_SUBST(e_logcertsdir)
25804f5a 2535AC_SUBST(e_sysconfdir)
d8356c5e 2536AC_SUBST(e_sysconfrulesdir)
20a8b9db 2537AC_SUBST(e_localstatedir)
d8356c5e 2538AC_DEFINE_UNQUOTED([CONFIG_DIR],["$e_sysconfdir"],[Our CONFIG_DIR])
25804f5a 2539AC_SUBST(e_magic_file)
15c98c60 2540AC_SUBST(e_magic_file_comment)
f55dbca5 2541AC_SUBST(e_enable_evelog)
7bf49006 2542AC_SUBST(e_datarulesdir)
e048a74e 2543AC_SUBST(e_defaultruledir)
24d6a164 2544AC_SUBST(e_rustdir)
64b6ff73
JI
2545AC_SUBST(has_suricata_update_comment)
2546AC_SUBST(no_suricata_update_comment)
25804f5a 2547
ba81c4d2
VJ
2548EXPAND_VARIABLE(prefix, CONFIGURE_PREFIX)
2549EXPAND_VARIABLE(sysconfdir, CONFIGURE_SYSCONDIR)
2550EXPAND_VARIABLE(localstatedir, CONFIGURE_LOCALSTATEDIR)
5eb7f0f7 2551EXPAND_VARIABLE(datadir, CONFIGURE_DATAROOTDIR)
ba81c4d2
VJ
2552AC_SUBST(CONFIGURE_PREFIX)
2553AC_SUBST(CONFIGURE_SYSCONDIR)
2554AC_SUBST(CONFIGURE_LOCALSTATEDIR)
5eb7f0f7 2555AC_SUBST(CONFIGURE_DATAROOTDIR)
8f81792d 2556AC_SUBST(PACKAGE_VERSION)
ba81c4d2 2557
0795dc1e
AH
2558AC_CONFIG_FILES(Makefile src/Makefile rust/Makefile rust/Cargo.toml rust/.cargo/config)
2559AC_CONFIG_FILES(qa/Makefile qa/coccinelle/Makefile)
2560AC_CONFIG_FILES(rules/Makefile doc/Makefile doc/userguide/Makefile)
2561AC_CONFIG_FILES(contrib/Makefile contrib/file_processor/Makefile contrib/file_processor/Action/Makefile contrib/file_processor/Processor/Makefile)
2562AC_CONFIG_FILES(suricata.yaml etc/Makefile etc/suricata.logrotate etc/suricata.service)
2563AC_CONFIG_FILES(python/Makefile python/suricata/config/defaults.py)
2564AC_CONFIG_FILES(ebpf/Makefile)
2565AC_OUTPUT
a098e39b 2566
668113af 2567SURICATA_BUILD_CONF="Suricata Configuration:
73a1b972 2568 AF_PACKET support: ${enable_af_packet}
91e1256b 2569 eBPF support: ${enable_ebpf}
8c880879 2570 XDP support: ${have_xdp}
73a1b972 2571 PF_RING support: ${enable_pfring}
ef463457 2572 NFQueue support: ${enable_nfqueue}
4851568a 2573 NFLOG support: ${enable_nflog}
ef463457 2574 IPFW support: ${enable_ipfw}
517b45ea 2575 Netmap support: ${enable_netmap} ${have_netmap_version}
73a1b972 2576 DAG enabled: ${enable_dag}
37e3de84 2577 Napatech enabled: ${enable_napatech}
ec77632e 2578 WinDivert enabled: ${enable_windivert}
ba81c4d2 2579
20a8b9db 2580 Unix socket enabled: ${enable_unixsocket}
f4872a2f 2581 Detection enabled: ${enable_detection}
73a1b972 2582
810e43f3 2583 Libmagic support: ${enable_magic}
89cee0ad
VJ
2584 libnss support: ${enable_nss}
2585 libnspr support: ${enable_nspr}
20a8b9db 2586 libjansson support: ${enable_jansson}
b60065ca 2587 liblzma support: ${enable_liblzma}
eef5678e 2588 hiredis support: ${enable_hiredis}
a64e5e77 2589 hiredis async with libevent: ${enable_hiredis_async}
ef463457 2590 Prelude support: ${enable_prelude}
73a1b972 2591 PCRE jit: ${pcre_jit_available}
e366c62c 2592 LUA support: ${enable_lua}
5b2fbfb1 2593 libluajit: ${enable_luajit}
a291209e 2594 GeoIP2 support: ${enable_geoip}
73a1b972
VJ
2595 Non-bundled htp: ${enable_non_bundled_htp}
2596 Old barnyard2 support: ${enable_old_barnyard2}
13b87f5a 2597 Hyperscan support: ${enable_hyperscan}
439b62fe 2598 Libnet support: ${enable_libnet}
58e92392 2599 liblz4 support: ${enable_liblz4}
73a1b972 2600
ed712768 2601 Rust support: ${enable_rust}
6a4cefb7 2602 Rust strict mode: ${enable_rust_strict}
ed712768
VJ
2603 Rust compiler: ${rust_compiler_version}
2604 Rust cargo: ${rust_cargo_version}
8f81792d 2605
a228986c
JI
2606 Python support: ${enable_python}
2607 Python path: ${python_path}
2608 Python version: ${python_version}
a69afd5c
JI
2609 Python distutils ${have_python_distutils}
2610 Python yaml ${have_python_yaml}
2611 Install suricatactl: ${install_suricatactl}
2612 Install suricatasc: ${install_suricatactl}
345ec58d 2613 Install suricata-update: ${install_suricata_update}
cd305c3a 2614
ef463457 2615 Profiling enabled: ${enable_profiling}
d908e707 2616 Profiling locks enabled: ${enable_profiling_locks}
439b62fe
VJ
2617
2618Development settings:
7fb860ac 2619 Coccinelle / spatch: ${enable_coccinelle}
439b62fe
VJ
2620 Unit tests enabled: ${enable_unittests}
2621 Debug output enabled: ${enable_debug}
2622 Debug validation enabled: ${enable_debug_validation}
ef463457
EL
2623
2624Generic build parameters:
ba81c4d2
VJ
2625 Installation prefix: ${prefix}
2626 Configuration directory: ${e_sysconfdir}
2627 Log directory: ${e_logdir}
2628
2629 --prefix ${CONFIGURE_PREFIX}
2630 --sysconfdir ${CONFIGURE_SYSCONDIR}
2631 --localstatedir ${CONFIGURE_LOCALSTATEDIR}
5eb7f0f7 2632 --datarootdir ${CONFIGURE_DATAROOTDIR}
73a1b972 2633
ef463457 2634 Host: ${host}
ba81c4d2 2635 Compiler: ${CC} (exec name) / ${compiler} (real)
ef463457
EL
2636 GCC Protect enabled: ${enable_gccprotect}
2637 GCC march native enabled: ${enable_gccmarch_native}
ba81c4d2 2638 GCC Profile enabled: ${enable_gccprofile}
437fe406 2639 Position Independent Executable enabled: ${enable_pie}
ba81c4d2
VJ
2640 CFLAGS ${CFLAGS}
2641 PCAP_CFLAGS ${PCAP_CFLAGS}
2642 SECCFLAGS ${SECCFLAGS}"
668113af
EL
2643
2644echo
2645echo "$SURICATA_BUILD_CONF"
4749420f
VJ
2646echo "printf(" >src/build-info.h
2647echo "$SURICATA_BUILD_CONF" | sed -e 's/^/"/' | sed -e 's/$/\\n"/' >>src/build-info.h
2648echo ");" >>src/build-info.h
25804f5a 2649
668113af 2650echo "
25804f5a 2651To build and install run 'make' and 'make install'.
73a1b972 2652
697e9e66
VJ
2653You can run 'make install-conf' if you want to install initial configuration
2654files to ${e_sysconfdir}. Running 'make install-full' will install configuration
2655and rules and provide you a ready-to-run suricata."
73a1b972
VJ
2656echo
2657echo "To install Suricata into /usr/bin/suricata, have the config in
2658/etc/suricata and use /var/log/suricata as log dir, use:
697e9e66
VJ
2659./configure --prefix=/usr/ --sysconfdir=/etc/ --localstatedir=/var/"
2660echo