]> git.ipfire.org Git - people/ms/suricata.git/blob - configure.ac
Add one shot run option to suri-graphite.
[people/ms/suricata.git] / configure.ac
1 #TODO A better place for default CFLAGS?
2
3 AC_INIT(configure.ac)
4
5 AC_CONFIG_HEADERS([config.h])
6 AM_INIT_AUTOMAKE(suricata, 2.0dev)
7
8 AC_LANG_C
9 AC_PROG_CC_C99
10 AC_PROG_LIBTOOL
11
12 AC_DEFUN([FAIL_MESSAGE],[
13 echo
14 echo
15 echo "**********************************************"
16 echo " ERROR: unable to find" $1
17 echo " checked in the following places"
18 for i in `echo $2`; do
19 echo " $i"
20 done
21 echo "**********************************************"
22 echo
23 exit 1
24 ])
25
26 AC_DEFUN([LIBNET_FAIL_WARN],[
27 echo
28 echo "*************************************************************************"
29 echo " Warning! libnet version 1.1.x could not be found in " $1
30 echo " Reject keywords will not be supported."
31 echo " If you require reject support plese install libnet 1.1.x. "
32 echo " If libnet is not installed in a non-standard location please use the"
33 echo " --with-libnet-includes and --with-libnet-libraries configure options"
34 echo "*************************************************************************"
35 echo
36 ])
37
38 if test `basename $CC` = "clang"; then
39 CFLAGS="$CFLAGS -Wextra -Werror-implicit-function-declaration"
40 AC_MSG_CHECKING([clang __sync_bool_compare_and_swap])
41 AC_TRY_COMPILE([#include <stdio.h>],
42 [ unsigned int i = 0; (void)__sync_bool_compare_and_swap(&i, 1, 1);],
43 [
44 AC_DEFINE([__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1], [1], [Fake GCC atomic support])
45 AC_DEFINE([__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2], [1], [Fake GCC atomic support])
46 AC_DEFINE([__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], [1], [Fake GCC atomic support])
47 AC_DEFINE([__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8], [1], [Fake GCC atomic support])
48 AC_MSG_RESULT([yes]) ],
49 [AC_MSG_RESULT([no])])
50 fi
51 if test `basename $CC` = "gcc"; then
52 dnl get gcc version
53 AC_MSG_CHECKING([gcc version])
54 gccver=$($CC -dumpversion)
55 gccvermajor=$(echo $gccver | cut -d . -f1)
56 gccverminor=$(echo $gccver | cut -d . -f2)
57 gccvernum=$(expr $gccvermajor "*" 100 + $gccverminor)
58 AC_MSG_RESULT($gccver)
59
60 if test "$gccvernum" -ge "400"; then
61 dnl gcc 4.0 or later
62 CFLAGS="$CFLAGS -Wextra -Werror-implicit-function-declaration"
63 # remove optimization options that break our code
64 # VJ 2010/06/27: no-tree-pre added. It breaks ringbuffers code.
65 CFLAGS="$CFLAGS -fno-tree-pre"
66 else
67 CFLAGS="$CFLAGS -W"
68 fi
69 fi
70 CFLAGS="$CFLAGS -Wall -fno-strict-aliasing"
71 CFLAGS="$CFLAGS -Wno-unused-parameter"
72 CFLAGS="$CFLAGS -std=gnu99"
73
74 # Checks for programs.
75 AC_PROG_AWK
76 AC_PROG_CC
77 AC_PROG_CPP
78 AC_PROG_INSTALL
79 AC_PROG_LN_S
80 AC_PROG_MAKE_SET
81
82 AC_PATH_PROG(HAVE_PKG_CONFIG, pkg-config, "no")
83 if test "$HAVE_PKG_CONFIG" = "no"; then
84 echo
85 echo " ERROR! pkg-config not found, go get it "
86 echo " http://pkg-config.freedesktop.org/wiki/ "
87 echo " or install from your distribution "
88 echo
89 exit 1
90 fi
91
92 AC_PATH_PROG(HAVE_COCCINELLE_CONFIG, spatch, "no")
93 if test "$HAVE_COCCINELLE_CONFIG" = "no"; then
94 echo
95 echo " Warning! spatch not found, you will not be "
96 echo " able to run code checking with coccinelle "
97 echo " get it from http://coccinelle.lip6.fr "
98 echo " or install from your distribution "
99 echo
100 fi
101 AM_CONDITIONAL([HAVE_COCCINELLE], [test "$HAVE_COCCINELLE_CONFIG" != "no"])
102
103 AC_PATH_PROG(HAVE_PYTHON_CONFIG, python, "no")
104 if test "$HAVE_PYTHON_CONFIG" = "no"; then
105 echo
106 echo " Warning! python not found, you will not be "
107 echo " able to install surictasc unix socket client "
108 echo
109 enable_python="no"
110 else
111 enable_python="yes"
112 fi
113 AM_CONDITIONAL([HAVE_PYTHON], [test "$HAVE_PYTHON_CONFIG" != "no"])
114
115
116
117 # Checks for libraries.
118
119 # Checks for header files.
120 AC_CHECK_HEADERS([arpa/inet.h assert.h ctype.h errno.h fcntl.h inttypes.h])
121 AC_CHECK_HEADERS([getopt.h])
122 AC_CHECK_HEADERS([limits.h netdb.h netinet/in.h poll.h sched.h signal.h])
123 AC_CHECK_HEADERS([stdarg.h stdint.h stdio.h stdlib.h string.h sys/ioctl.h])
124 AC_CHECK_HEADERS([syslog.h sys/prctl.h sys/socket.h sys/stat.h sys/syscall.h])
125 AC_CHECK_HEADERS([sys/time.h time.h unistd.h])
126 AC_CHECK_HEADERS([sys/ioctl.h linux/if_ether.h linux/if_packet.h linux/filter.h])
127
128 AC_CHECK_HEADERS([sys/socket.h net/if.h sys/mman.h linux/if_arp.h], [], [],
129 [[#ifdef HAVE_SYS_SOCKET_H
130 #include <sys/types.h>
131 #include <sys/socket.h>
132 #endif
133 ]])
134
135 AC_CHECK_HEADERS([windows.h winsock2.h ws2tcpip.h], [], [],
136 [[#define _X86_
137 ]])
138 AC_CHECK_HEADERS([w32api/winbase.h], [], [],
139 [[#define _X86_
140 #include <windows.h>
141 ]])
142
143 # Checks for typedefs, structures, and compiler characteristics.
144 AC_C_INLINE
145 AC_TYPE_PID_T
146 AC_TYPE_SIZE_T
147 AC_TYPE_INT32_T
148 AC_TYPE_UINT16_T
149 AC_TYPE_UINT32_T
150 AC_TYPE_UINT64_T
151 AC_TYPE_UINT8_T
152 AC_HEADER_STDBOOL
153
154 # Checks for library functions.
155 AC_FUNC_MALLOC
156 AC_FUNC_REALLOC
157 AC_CHECK_FUNCS([gettimeofday memset strcasecmp strchr strdup strerror strncasecmp strtol strtoul memchr])
158
159 # Add large file support
160 AC_SYS_LARGEFILE
161
162 #check for os
163 AC_MSG_CHECKING([host os])
164
165 # If no host os was detected, try with uname
166 if test -z "$host" ; then
167 host="`uname`"
168 fi
169 echo -n "installation for $host OS... "
170
171 e_magic_file="/usr/share/file/magic"
172 case "$host" in
173 *-*-*freebsd*)
174 CFLAGS="${CFLAGS} -DOS_FREEBSD"
175 CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/local/include/libnet11"
176 LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/usr/local/lib/libnet11"
177 e_magic_file="/usr/share/misc/magic"
178 ;;
179 *-*-openbsd5.1)
180 CFLAGS="${CFLAGS} -D__OpenBSD__ -fgnu89-inline"
181 CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/local/include/libnet-1.1"
182 LDFLAGS="${LDFLAGS} -L/usr/local/lib -I/usr/local/lib/libnet-1.1"
183 e_magic_file="/usr/local/share/misc/magic.mgc"
184 ;;
185 *-*-openbsd5.2)
186 CFLAGS="${CFLAGS} -D__OpenBSD__"
187 CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/local/include/libnet-1.1"
188 LDFLAGS="${LDFLAGS} -L/usr/local/lib -I/usr/local/lib/libnet-1.1"
189 e_magic_file="/usr/local/share/misc/magic.mgc"
190 ;;
191 *-*-openbsd*)
192 CFLAGS="${CFLAGS} -D__OpenBSD__ -fgnu89-inline"
193 CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/local/include/libnet-1.1"
194 LDFLAGS="${LDFLAGS} -L/usr/local/lib -I/usr/local/lib/libnet-1.1"
195 e_magic_file="/usr/local/share/file/magic.mgc"
196 ;;
197 *darwin*|*Darwin*)
198 CFLAGS="${CFLAGS} -DOS_DARWIN"
199 CPPFLAGS="${CPPFLAGS} -I/opt/local/include"
200 LDFLAGS="${LDFLAGS} -L/opt/local/lib"
201 ;;
202 *-*-linux*)
203 #for now do nothing
204 ;;
205 *-*-mingw32*)
206 CFLAGS="${CFLAGS} -DOS_WIN32"
207 LDFLAGS="${LDFLAGS} -lws2_32"
208 WINDOWS_PATH="yes"
209 ;;
210 *-*-cygwin)
211 WINDOWS_PATH="yes"
212 ;;
213 *)
214 AC_MSG_WARN([unsupported OS this may or may not work])
215 ;;
216 esac
217 AC_MSG_RESULT(ok)
218
219 #Enable support for gcc compile time security options. There is no great way to do detection of valid cflags that I have found
220 #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.
221 #These flags seem to be supported on CentOS 5+, Ubuntu 8.04+, and FedoreCore 11+
222 #Options are taken from https://wiki.ubuntu.com/CompilerFlags
223 AC_ARG_ENABLE(gccprotect,
224 AS_HELP_STRING([--enable-gccprotect], [Detect and use gcc hardening options]),,[enable_gccprotect=no])
225
226 AS_IF([test "x$enable_gccprotect" = "xyes"], [
227 #buffer overflow protection
228 AC_MSG_CHECKING(for -fstack-protector)
229 TMPCFLAGS="${CFLAGS}"
230 CFLAGS="${CFLAGS} -fstack-protector"
231 AC_TRY_LINK(,,SECCFLAGS="${SECCFLAGS} -fstack-protector"
232 AC_MSG_RESULT(yes),
233 AC_MSG_RESULT(no))
234 CFLAGS="${TMPCFLAGS}"
235
236 #compile-time best-practices errors for certain libc functions, provides checks of buffer lengths and memory regions
237 AC_MSG_CHECKING(for -D_FORTIFY_SOURCE=2)
238 TMPCFLAGS="${CFLAGS}"
239 CFLAGS="${CFLAGS} -D_FORTIFY_SOURCE=2"
240 AC_TRY_COMPILE(,,SECCFLAGS="${SECCFLAGS} -D_FORTIFY_SOURCE=2"
241 AC_MSG_RESULT(yes),
242 AC_MSG_RESULT(no))
243 CFLAGS="${TMPCFLAGS}"
244
245 #compile-time warnings about misuse of format strings
246 AC_MSG_CHECKING(for -Wformat -Wformat-security)
247 TMPCFLAGS="${CFLAGS}"
248 CFLAGS="${CFLAGS} -Wformat -Wformat-security"
249 AC_TRY_COMPILE(,,SECCFLAGS="${SECCFLAGS} -Wformat -Wformat-security"
250 AC_MSG_RESULT(yes),
251 AC_MSG_RESULT(no))
252 CFLAGS="${TMPCFLAGS}"
253
254 #provides a read-only relocation table area in the final ELF
255 AC_MSG_CHECKING(for -z relro)
256 TMPLDFLAGS="${LDFLAGS}"
257 LDFLAGS="${LDFLAGS} -z relro"
258 AC_TRY_LINK(,,SECLDFLAGS="${SECLDFLAGS} -z relro"
259 AC_MSG_RESULT(yes),
260 AC_MSG_RESULT(no))
261 LDFLAGS="${TMPLDFLAGS}"
262
263 #forces all relocations to be resolved at run-time
264 AC_MSG_CHECKING(for -z now)
265 TMPLDFLAGS="${LDFLAGS}"
266 LDFLAGS="${LDFLAGS} -z now"
267 AC_TRY_LINK(,,SECLDFLAGS="${SECLDFLAGS} -z now"
268 AC_MSG_RESULT(yes),
269 AC_MSG_RESULT(no))
270 LDFLAGS="${TMPLDFLAGS}"
271
272 CFLAGS="${CFLAGS} ${SECCFLAGS}"
273 LDFLAGS="${LDFLAGS} ${SECLDFLAGS}"
274 ])
275
276 #enable profile generation
277 AC_ARG_ENABLE(gccprofile,
278 AS_HELP_STRING([--enable-gccprofile], [Enable gcc profile info i.e -pg flag is set]),,[enable_gccprofile=no])
279 AS_IF([test "x$enable_gccprofile" = "xyes"], [
280 CFLAGS="${CFLAGS} -pg"
281 ])
282
283 #enable gcc march=native gcc 4.2 or later
284 AC_ARG_ENABLE(gccmarch_native,
285 AS_HELP_STRING([--enable-gccmarch-native], [Enable gcc march=native gcc 4.2 and later only]),,[enable_gccmarch_native=yes])
286 AS_IF([test "x$enable_gccmarch_native" = "xyes"], [
287 if test `basename $CC` = "clang"; then
288 OFLAGS="$CFLAGS"
289 CFLAGS="$CFLAGS -march=native"
290 AC_MSG_CHECKING([checking if $CC supports -march=native])
291 AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include <stdlib.h>]])],
292 [
293 AC_MSG_RESULT([yes])
294 CFLAGS="$OFLAGS -march=native"
295 ],
296 [
297 AC_MSG_RESULT([no])
298 CFLAGS="$OFLAGS"
299 enable_gccmarch_native=no
300 ]
301 )
302 fi
303 if test `basename $CC` = "gcc"; then
304 case $host in
305 *darwin*|*Darwin*)
306 if test "$gccvernum" -ge "403"; then
307 dnl gcc 4.3 or later
308 CFLAGS="$CFLAGS -march=native"
309 else
310 enable_gccmarch_native=no
311 fi
312 ;;
313 *)
314 if test "$gccvernum" -ge "402"; then
315 dnl gcc 4.2 or later
316 CFLAGS="$CFLAGS -march=native"
317 fi
318 ;;
319 esac
320 fi
321 ])
322
323 # options
324
325 # enable the running of unit tests
326 AC_ARG_ENABLE(unittests,
327 AS_HELP_STRING([--enable-unittests], [Enable compilation of the unit tests]),,[enable_unittests=no])
328 AS_IF([test "x$enable_unittests" = "xyes"], [
329 UT_ENABLED="yes"
330 CFLAGS="${CFLAGS} -DUNITTESTS"
331 ])
332
333 AM_CONDITIONAL([BUILD_UNITTESTS], [test "x$enable_unittests" = "xyes"])
334
335 # enable workaround for old barnyard2 for unified alert output
336 AC_ARG_ENABLE(old-barnyard2,
337 AS_HELP_STRING([--enable-old-barnyard2], [Use workaround for old barnyard2 in unified2 output]),,[enable_old_barnyard2=no])
338 AS_IF([test "x$enable_old_barnyard2" = "xyes"], [
339 CFLAGS="${CFLAGS} -DHAVE_OLD_BARNYARD2"
340 ])
341
342 # enable debug output
343 AC_ARG_ENABLE(debug,
344 AS_HELP_STRING([--enable-debug], [Enable debug output]),,[enable_debug=no])
345 AS_IF([test "x$enable_debug" = "xyes"], [
346 CFLAGS="${CFLAGS} -DDEBUG"
347 ])
348
349 # enable debug validation functions & macro's output
350 AC_ARG_ENABLE(debug-validation,
351 AS_HELP_STRING([--enable-debug-validation], [Enable (debug) validation code output]),,[enable_debug_validation=no])
352 AS_IF([test "x$enable_debug_validation" = "xyes"], [
353 CFLAGS="${CFLAGS} -DDEBUG_VALIDATION"
354 ])
355
356 # profiling support
357 AC_ARG_ENABLE(profiling,
358 AS_HELP_STRING([--enable-profiling], [Enable performance profiling]),,[enable_profiling=no])
359 AS_IF([test "x$enable_profiling" = "xyes"], [
360
361 case "$host" in
362 *-*-openbsd*)
363 AC_MSG_ERROR([profiling is not supported on OpenBSD])
364 ;;
365 *)
366 CFLAGS="${CFLAGS} -DPROFILING"
367 ;;
368 esac
369 ])
370
371 # profiling support, locking
372 AC_ARG_ENABLE(profiling-locks,
373 AS_HELP_STRING([--enable-profiling-locks], [Enable performance profiling for locks]),,[enable_profiling_locks=no])
374 AS_IF([test "x$enable_profiling_locks" = "xyes"], [
375 CFLAGS="${CFLAGS} -DPROFILING -DPROFILE_LOCKING"
376 ])
377
378 # enable support for IPFW
379 AC_ARG_ENABLE(ipfw,
380 AS_HELP_STRING([--enable-ipfw], [Enable FreeBSD IPFW support for inline IDP]),,[enable_ipfw=no])
381 AS_IF([test "x$enable_ipfw" = "xyes"], [
382 CFLAGS="$CFLAGS -DIPFW"
383 ])
384
385 # libraries
386
387 AC_MSG_CHECKING([for Mpipe])
388 AC_COMPILE_IFELSE(
389 [AC_LANG_PROGRAM([[#include <gxio/mpipe.h>]])],
390 [
391 AC_MSG_RESULT([yes])
392 AC_DEFINE([HAVE_MPIPE],[1],[mPIPE support is available])
393 LDFLAGS="$LDFLAGS -lgxio -ltmc"
394 ],
395 [AC_MSG_RESULT([no])])
396
397 #libpcre
398 AC_ARG_WITH(libpcre_includes,
399 [ --with-libpcre-includes=DIR libpcre include directory],
400 [with_libpcre_includes="$withval"],[with_libpcre_includes=no])
401 AC_ARG_WITH(libpcre_libraries,
402 [ --with-libpcre-libraries=DIR libpcre library directory],
403 [with_libpcre_libraries="$withval"],[with_libpcre_libraries="no"])
404
405 if test "$with_libpcre_includes" != "no"; then
406 CPPFLAGS="${CPPFLAGS} -I${with_libpcre_includes}"
407 fi
408 AC_CHECK_HEADER(pcre.h,,[AC_ERROR(pcre.h not found ...)])
409
410 if test "$with_libpcre_libraries" != "no"; then
411 LDFLAGS="${LDFLAGS} -L${with_libpcre_libraries}"
412 fi
413 PCRE=""
414 AC_CHECK_LIB(pcre, pcre_get_substring,, PCRE="no")
415 if test "$PCRE" = "no"; then
416 echo
417 echo " ERROR! pcre library not found, go get it"
418 echo " from www.pcre.org."
419 echo
420 exit 1
421 fi
422
423 # To prevent duping the lib link we reset LIBS after this check. Setting action-if-found to NULL doesn't seem to work
424 # see: http://blog.flameeyes.eu/2008/04/29/i-consider-ac_check_lib-harmful
425 PCRE=""
426 TMPLIBS="${LIBS}"
427 AC_CHECK_LIB(pcre, pcre_dfa_exec,, PCRE="no")
428 if test "$PCRE" = "no"; then
429 echo
430 echo " ERROR! pcre library was found but version was < 6.0"
431 echo " please upgrade to a newer version of pcre which you can get from"
432 echo " www.pcre.org."
433 echo
434 exit 1
435 fi
436 LIBS="${TMPLIBS}"
437
438 AC_TRY_COMPILE([ #include <pcre.h> ],
439 [ int eo = 0; eo |= PCRE_EXTRA_MATCH_LIMIT_RECURSION; ],
440 [ pcre_match_limit_recursion_available=yes ], [:]
441 )
442 if test "$pcre_match_limit_recursion_available" != "yes"; then
443 CFLAGS="${CFLAGS} -DNO_PCRE_MATCH_RLIMIT"
444 echo
445 echo " Warning! pcre extra opt PCRE_EXTRA_MATCH_LIMIT_RECURSION not found"
446 echo " This could lead to potential DoS please upgrade to pcre >= 6.5"
447 echo " Continuing for now...."
448 echo " from www.pcre.org."
449 echo
450 fi
451
452 #enable support for PCRE-jit available since pcre-8.20
453 AC_MSG_CHECKING(for PCRE JIT support)
454 AC_TRY_COMPILE([ #include <pcre.h> ],
455 [
456 int jit = 0;
457 pcre_config(PCRE_CONFIG_JIT, &jit);
458 ],
459 [ pcre_jit_available=yes ], [ pcre_jit_available=no ]
460 )
461
462 if test "x$pcre_jit_available" = "xyes"; then
463 AC_MSG_RESULT(yes)
464 AC_DEFINE([PCRE_HAVE_JIT], [1], [Pcre with JIT compiler support enabled])
465
466 AC_MSG_CHECKING(for PCRE JIT support usability)
467 AC_TRY_COMPILE([ #include <pcre.h> ],
468 [
469 const char* regexstr = "(a|b|c|d)";
470 pcre *re;
471 const char *error;
472 pcre_extra *extra;
473 int err_offset;
474 re = pcre_compile(regexstr,0, &error, &err_offset,NULL);
475 extra = pcre_study(re, PCRE_STUDY_JIT_COMPILE, &error);
476 if (extra == NULL)
477 exit(EXIT_FAILURE);
478 int jit = 0;
479 int ret = pcre_fullinfo(re, extra, PCRE_INFO_JIT, &jit);
480 if (ret != 0 || jit != 1)
481 exit(EXIT_FAILURE);
482 exit(EXIT_SUCCESS);
483 ],
484 [ pcre_jit_works=yes ], [:]
485 )
486 if test "x$pcre_jit_works" != "xyes"; then
487 AC_MSG_RESULT(no)
488 echo
489 echo " PCRE JIT support detection worked but testing it failed"
490 echo " something odd is going on, please file a bug report."
491 echo
492 exit 1
493 else
494 AC_MSG_RESULT(yes)
495 fi
496 else
497 AC_MSG_RESULT(no)
498 fi
499
500 # libyaml
501 AC_ARG_WITH(libyaml_includes,
502 [ --with-libyaml-includes=DIR libyaml include directory],
503 [with_libyaml_includes="$withval"],[with_libyaml_includes=no])
504 AC_ARG_WITH(libyaml_libraries,
505 [ --with-libyaml-libraries=DIR libyaml library directory],
506 [with_libyaml_libraries="$withval"],[with_libyaml_libraries="no"])
507
508 if test "$with_libyaml_includes" != "no"; then
509 CPPFLAGS="${CPPFLAGS} -I${with_libyaml_includes}"
510 fi
511
512 AC_CHECK_HEADER(yaml.h,,LIBYAML="no")
513
514 if test "$with_libyaml_libraries" != "no"; then
515 LDFLAGS="${LDFLAGS} -L${with_libyaml_libraries}"
516 fi
517
518 LIBYAML=""
519 AC_CHECK_LIB(yaml,yaml_parser_initialize,,LIBYAML="no")
520
521 if test "$LIBYAML" = "no"; then
522 echo
523 echo " ERROR! libyaml library not found, go get it"
524 echo " from http://pyyaml.org/wiki/LibYAML "
525 echo " or your distribution:"
526 echo
527 echo " Ubuntu: apt-get install libyaml-dev"
528 echo " Fedora: yum install libyaml-devel"
529 echo
530 exit 1
531 fi
532
533 # libpthread
534 AC_ARG_WITH(libpthread_includes,
535 [ --with-libpthread-includes=DIR libpthread include directory],
536 [with_libpthread_includes="$withval"],[with_libpthread_includes=no])
537 AC_ARG_WITH(libpthread_libraries,
538 [ --with-libpthread-libraries=DIR libpthread library directory],
539 [with_libpthread_libraries="$withval"],[with_libpthread_libraries="no"])
540
541 if test "$with_libpthread_includes" != "no"; then
542 CPPFLAGS="${CPPFLAGS} -I${with_libpthread_includes}"
543 fi
544
545 dnl AC_CHECK_HEADER(pthread.h,,[AC_ERROR(pthread.h not found ...)])
546
547 if test "$with_libpthread_libraries" != "no"; then
548 LDFLAGS="${LDFLAGS} -L${with_libpthread_libraries}"
549 fi
550
551 PTHREAD=""
552 AC_CHECK_LIB(pthread, pthread_create,, PTHREAD="no")
553
554 if test "$PTHREAD" = "no"; then
555 echo
556 echo " ERROR! libpthread library not found, glibc problem?"
557 echo
558 exit 1
559 fi
560
561 # libjansson
562 enable_jansson="no"
563 AC_ARG_WITH(libjansson_includes,
564 [ --with-libjansson-includes=DIR libjansson include directory],
565 [with_libjansson_includes="$withval"],[with_libjansson_includes=no])
566 AC_ARG_WITH(libjansson_libraries,
567 [ --with-libjansson-libraries=DIR libjansson library directory],
568 [with_libjansson_libraries="$withval"],[with_libjansson_libraries="no"])
569
570 if test "$with_libjansson_includes" != "no"; then
571 CPPFLAGS="${CPPFLAGS} -I${with_libjansson_includes}"
572 fi
573
574 enable_jansson="no"
575 enable_unixsocket="no"
576
577 AC_ARG_ENABLE(unix-socket,
578 AS_HELP_STRING([--enable-unix-socket], [Enable unix socket [default=test]]),[enable_unixsocket="$enableval"],[enable_unixsocket=test])
579
580 AC_CHECK_HEADER(jansson.h,JANSSON="yes",JANSSON="no")
581 if test "$JANSSON" = "yes"; then
582 if test "$with_libjansson_libraries" != "no"; then
583 LDFLAGS="${LDFLAGS} -L${with_libjansson_libraries}"
584 fi
585
586 AC_CHECK_LIB(jansson, json_dump_callback,, JANSSON="no")
587 enable_jansson="yes"
588 if test "$JANSSON" = "no"; then
589 echo
590 echo " Jansson >= 2.2 is required for features like unix socket"
591 echo " Go get it from your distribution of from:"
592 echo " http://www.digip.org/jansson/"
593 echo
594 if test "x$enable_unixsocket" = "xyes"; then
595 exit 1
596 fi
597 enable_unixsocket="no"
598 enable_jansson="no"
599 else
600 case $host in
601 *-*-mingw32*)
602 ;;
603 *-*-cygwin)
604 ;;
605 *)
606 if test "x$enable_unixsocket" = "xtest"; then
607 enable_unixsocket="yes"
608 fi
609 ;;
610 esac
611 fi
612 else
613 if test "x$enable_unixsocket" = "xyes"; then
614 echo
615 echo " Jansson >= 2.2 is required for features like unix socket"
616 echo " Go get it from your distribution of from:"
617 echo " http://www.digip.org/jansson/"
618 echo
619 exit 1
620 fi
621 enable_unixsocket="no"
622 fi
623
624 AS_IF([test "x$enable_unixsocket" = "xyes"], [AC_DEFINE([BUILD_UNIX_SOCKET], [1], [Unix socket support enabled])])
625
626 #enable support for NFQUEUE
627 AC_ARG_ENABLE(nfqueue,
628 AS_HELP_STRING([--enable-nfqueue], [Enable NFQUEUE support for inline IDP]),,[enable_nfqueue=no])
629 AS_IF([test "x$enable_nfqueue" = "xyes"], [
630 CFLAGS="$CFLAGS -DNFQ"
631
632 # libnfnetlink
633 case $host in
634 *-*-mingw32*)
635 ;;
636 *)
637 AC_ARG_WITH(libnfnetlink_includes,
638 [ --with-libnfnetlink-includes=DIR libnfnetlink include directory],
639 [with_libnfnetlink_includes="$withval"],[with_libnfnetlink_includes=no])
640 AC_ARG_WITH(libnfnetlink_libraries,
641 [ --with-libnfnetlink-libraries=DIR libnfnetlink library directory],
642 [with_libnfnetlink_libraries="$withval"],[with_libnfnetlink_libraries="no"])
643
644 if test "$with_libnfnetlink_includes" != "no"; then
645 CPPFLAGS="${CPPFLAGS} -I${with_libnfnetlink_includes}"
646 fi
647
648 AC_CHECK_HEADER(libnfnetlink/libnfnetlink.h,,[AC_ERROR(libnfnetlink.h not found ...)])
649
650 if test "$with_libnfnetlink_libraries" != "no"; then
651 LDFLAGS="${LDFLAGS} -L${with_libnfnetlink_libraries}"
652 fi
653
654 NFNL=""
655 AC_CHECK_LIB(nfnetlink, nfnl_fd,, NFNL="no")
656
657 if test "$NFNL" = "no"; then
658 echo
659 echo " ERROR! nfnetlink library not found, go get it"
660 echo " from www.netfilter.org."
661 echo " we automatically append libnetfilter_queue/ when searching"
662 echo " for headers etc. when the --with-libnfnetlink-inlcudes directive"
663 echo " is used"
664 echo
665 exit 1
666 fi
667 ;;
668 esac
669
670 #libnetfilter_queue
671 AC_ARG_WITH(libnetfilter_queue_includes,
672 [ --with-libnetfilter_queue-includes=DIR libnetfilter_queue include directory],
673 [with_libnetfilter_queue_includes="$withval"],[with_libnetfilter_queue_includes=no])
674 AC_ARG_WITH(libnetfilter_queue_libraries,
675 [ --with-libnetfilter_queue-libraries=DIR libnetfilter_queue library directory],
676 [with_libnetfilter_queue_libraries="$withval"],[with_libnetfilter_queue_libraries="no"])
677
678 if test "$with_libnetfilter_queue_includes" != "no"; then
679 CPPFLAGS="${CPPFLAGS} -I${with_libnetfilter_queue_includes}"
680 fi
681
682 AC_CHECK_HEADER(libnetfilter_queue/libnetfilter_queue.h,,[AC_ERROR(libnetfilter_queue/libnetfilter_queue.h not found ...)])
683
684 if test "$with_libnetfilter_queue_libraries" != "no"; then
685 LDFLAGS="${LDFLAGS} -L${with_libnetfilter_queue_libraries}"
686 fi
687
688 #LDFLAGS="${LDFLAGS} -lnetfilter_queue"
689
690 NFQ=""
691 case $host in
692 *-*-mingw32*)
693 AC_CHECK_LIB(netfilter_queue, nfq_open,, NFQ="no",-lws2_32)
694
695 AC_ARG_WITH(netfilterforwin_includes,
696 [ --with-netfilterforwin-includes=DIR netfilterforwin include directory],
697 [with_netfilterforwin_includes="$withval"],[with_netfilterforwin_includes=no])
698
699 if test "$with_netfilterforwin_includes" != "no"; then
700 CPPFLAGS="${CPPFLAGS} -I${with_netfilterforwin_includes}"
701 else
702 CPPFLAGS="${CPPFLAGS} -I../../netfilterforwin"
703 fi
704 ;;
705 *)
706 AC_CHECK_LIB(netfilter_queue, nfq_open,, NFQ="no",)
707 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])
708 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])
709 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])
710 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])
711
712 # check if the argument to nfq_get_payload is signed or unsigned
713 AC_MSG_CHECKING([for signed nfq_get_payload payload argument])
714 STORECFLAGS="${CFLAGS}"
715 if test `basename $CC` = "clang"; then
716 CFLAGS="${CFLAGS} -Werror=incompatible-pointer-types"
717 else
718 CFLAGS="${CFLAGS} -Werror"
719 fi
720 AC_COMPILE_IFELSE(
721 [AC_LANG_PROGRAM(
722 [
723 #include <stdio.h>
724 #include <libnetfilter_queue/libnetfilter_queue.h>
725 ],
726 [
727 char *pktdata;
728 nfq_get_payload(NULL, &pktdata);
729 ])],
730 [libnetfilter_queue_nfq_get_payload_signed="yes"],
731 [libnetfilter_queue_nfq_get_payload_signed="no"])
732 AC_MSG_RESULT($libnetfilter_queue_nfq_get_payload_signed)
733 if test "x$libnetfilter_queue_nfq_get_payload_signed" = "xyes"; then
734 AC_DEFINE([NFQ_GET_PAYLOAD_SIGNED], [1], [For signed version of nfq_get_payload])
735 fi
736 CFLAGS="${STORECFLAGS}"
737 ;;
738 esac
739
740 if test "$NFQ" = "no"; then
741 echo
742 echo " ERROR! libnetfilter_queue library not found, go get it"
743 echo " from www.netfilter.org."
744 echo " we automatically append libnetfilter_queue/ when searching"
745 echo " for headers etc. when the --with-libnfq-includes directive"
746 echo " is used"
747 echo
748 exit 1
749 fi
750 ])
751
752 # prelude
753 AC_ARG_ENABLE(prelude,
754 AS_HELP_STRING([--enable-prelude], [Enable Prelude support for alerts]),,[enable_prelude=no])
755 AS_IF([test "x$enable_prelude" = "xyes"], [
756 CFLAGS="$CFLAGS -DPRELUDE"
757 AM_PATH_LIBPRELUDE(0.9.9, , AC_MSG_ERROR(Cannot find libprelude: Is libprelude-config in the path?), no)
758 if test "x${LIBPRELUDE_CFLAGS}" != "x"; then
759 CPPFLAGS="${CPPFLAGS} ${LIBPRELUDE_CFLAGS}"
760 fi
761
762 if test "x${LIBPRELUDE_LDFLAGS}" != "x"; then
763 LDFLAGS="${LDFLAGS} ${LIBPRELUDE_LDFLAGS}"
764 fi
765
766 if test "x${LIBPRELUDE_LIBS}" != "x"; then
767 LDFLAGS="${LDFLAGS} ${LIBPRELUDE_LIBS}"
768 fi
769 ])
770
771 # libnet
772 AC_ARG_WITH(libnet_includes,
773 [ --with-libnet-includes=DIR libnet include directory],
774 [with_libnet_includes="$withval"],[with_libnet_includes="no"])
775
776 AC_ARG_WITH(libnet_libraries,
777 [ --with-libnet-libraries=DIR libnet library directory],
778 [with_libnet_libraries="$withval"],[with_libnet_libraries="no"])
779
780 if test "x$with_libnet_includes" != "xno"; then
781 CPPFLAGS="${CPPFLAGS} -I${with_libnet_includes}"
782 libnet_dir="${with_libnet_includes}"
783 else
784 libnet_dir="/usr/include /usr/local/include /usr/local/include/libnet11 /opt/local/include /usr/local/include/libnet-1.1"
785 fi
786
787 if test "x$with_libnet_libraries" != "xno"; then
788 LDFLAGS="${LDFLAGS} -L${with_libnet_libraries}"
789 fi
790
791 LIBNET_DETECT_FAIL="no"
792 LIBNET_INC_DIR=""
793
794 for i in $libnet_dir; do
795 if test -r "$i/libnet.h"; then
796 LIBNET_INC_DIR="$i"
797 fi
798 done
799
800 AC_MSG_CHECKING(for libnet.h version 1.1.x)
801 if test "$LIBNET_INC_DIR" != ""; then
802 if eval "grep LIBNET_VERSION $LIBNET_INC_DIR/libnet.h | grep -v 1.1 >/dev/null"; then
803 AC_MSG_RESULT(no)
804 LIBNET_DETECT_FAIL="yes"
805 LIBNET_FAIL_WARN($libnet_dir)
806 else
807 AC_MSG_RESULT(yes)
808 fi
809
810 #CentOS, Fedora, Ubuntu-LTS, Ubuntu all set defines to the same values. libnet-config seems
811 #to have been depreciated but all distro's seem to include it as part of the package.
812 if test "$LIBNET_DETECT_FAIL" = "no"; then
813 LLIBNET=""
814 AC_CHECK_LIB(net, libnet_write,, LLIBNET="no")
815 if test "$LLIBNET" != "no"; then
816 CFLAGS="${CFLAGS} -DHAVE_LIBNET11 -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H"
817 else
818 #if we displayed a warning already no reason to do it again.
819 if test "$LIBNET_DETECT_FAIL" = "no"; then
820 LIBNET_DETECT_FAIL="yes"
821 LIBNET_FAIL_WARN($libnet_dir)
822 fi
823 fi
824
825 # see if we have the patched libnet 1.1
826 # http://www.inliniac.net/blog/2007/10/16/libnet-11-ipv6-fixes-and-additions.html
827 #
828 # To prevent duping the lib link we reset LIBS after this check. Setting action-if-found to NULL doesn't seem to work
829 # see: http://blog.flameeyes.eu/2008/04/29/i-consider-ac_check_lib-harmful
830 if test "$LIBNET_DETECT_FAIL" = "no"; then
831 LLIBNET=""
832 TMPLIBS="${LIBS}"
833 AC_CHECK_LIB(net, libnet_build_icmpv6_unreach,, LLIBNET="no")
834 if test "$LLIBNET" != "no"; then
835 CFLAGS="$CFLAGS -DHAVE_LIBNET_ICMPV6_UNREACH"
836 fi
837 LIBS="${TMPLIBS}"
838 fi
839 fi
840 else
841 LIBNET_DETECT_FAIL="yes"
842 LIBNET_FAIL_WARN($libnet_dir)
843 fi
844 # libpfring (currently only supported for libpcap enabled pfring)
845 # Error on the side of caution. If libpfring enabled pcap is being used and we don't link against -lpfring compilation will fail.
846 AC_ARG_ENABLE(pfring,
847 AS_HELP_STRING([--enable-pfring], [Enable Native PF_RING support]),,[enable_pfring=no])
848 AS_IF([test "x$enable_pfring" = "xyes"], [
849 CFLAGS="$CFLAGS -DHAVE_PFRING"
850
851 #We have to set CFLAGS for AC_TRY_COMPILE as it doesn't pay attention to CPPFLAGS
852 AC_ARG_WITH(libpfring_includes,
853 [ --with-libpfring-includes=DIR libpfring include directory],
854 [with_libpfring_includes="$withval"],[with_libpfring_includes=no])
855 AC_ARG_WITH(libpfring_libraries,
856 [ --with-libpfring-libraries=DIR libpfring library directory],
857 [with_libpfring_libraries="$withval"],[with_libpfring_libraries="no"])
858
859 if test "$with_libpfring_includes" != "no"; then
860 CPPFLAGS="${CPPFLAGS} -I${with_libpfring_includes}"
861 fi
862
863 if test "$with_libpfring_libraries" != "no"; then
864 LDFLAGS="${LDFLAGS} -L${with_libpfring_libraries}"
865 fi
866
867 LIBPFRING=""
868 AC_CHECK_LIB(pfring, pfring_open,, LIBPFRING="no", [-lpcap])
869 if test "$LIBPFRING" = "no"; then
870 if test "x$enable_pfring" = "xyes"; then
871 echo
872 echo " ERROR! --enable-pfring was passed but the library was not found or version is >4, go get it"
873 echo " from http://www.ntop.org/PF_RING.html"
874 echo
875 exit 1
876 fi
877 fi
878
879 LIBPFRING_ENABLE_RING=""
880 AC_CHECK_LIB(pfring, pfring_enable_ring,, LIBPFRING_ENABLE_RING="no", [-lpcap])
881 if test "$LIBPFRING_ENABLE_RING" != "no"; then
882 AC_DEFINE([HAVE_PFRING_ENABLE],[1],[PF_RING pfring_enable_ring is available])
883 fi
884
885 LIBPFRING_CLUSTER_TYPE=""
886 AC_CHECK_LIB(pfring, pfring_set_cluster,
887 , LIBPFRING_CLUSTER_TYPE="no", [-lpcap])
888 if test "$LIBPFRING_CLUSTER_TYPE" != "no"; then
889 AC_DEFINE([HAVE_PFRING_CLUSTER_TYPE],[1],[PF_RING pfring_set_cluster is available])
890 fi
891
892 LIBPFRING_BPF_FILTER=""
893 AC_CHECK_LIB(pfring, pfring_set_bpf_filter,
894 , LIBPFRING_BPF_FILTER="no", [-lpcap])
895 LIBPFRING_REMOVE_BPF_FILTER=""
896 AC_CHECK_LIB(pfring, pfring_remove_bpf_filter,
897 , LIBPFRING_REMOVE_BPF_FILTER="no", [-lpcap])
898 if test "$LIBPFRING_BPF_FILTER" != "no" -a "$LIBPFRING_REMOVE_BPF_FILTER" != "no"; then
899 AC_DEFINE([HAVE_PFRING_SET_BPF_FILTER],[1],[PF_RING pfring_set_bpf_filter is available])
900 fi
901
902 STORE_CFLAGS="${CFLAGS}"
903 CFLAGS="${CFLAGS} -Werror"
904 AC_MSG_CHECKING([if pfring_recv expects u_char**])
905 AC_TRY_COMPILE([
906 #include <pfring.h>
907 ],
908 [
909 u_char *buffer;
910 pfring_recv(NULL, &buffer, 0, NULL, 1);
911 ],
912 [ pfring_recv_uchar_buff=yes ], [:])
913
914 CFLAGS="${STORE_CFLAGS}"
915
916 if test "$pfring_recv_uchar_buff" = "yes"; then
917 AC_DEFINE([HAVE_PFRING_RECV_UCHAR],[1],[PF_RING pfring_recv buffer is u_char**])
918 AC_MSG_RESULT(yes)
919 else
920 AC_MSG_RESULT(no)
921 fi
922
923 # check if the argument to nfq_get_payload is signed or unsigned
924 AC_MSG_CHECKING([for post 5.4.0 pfring_open function])
925 STORECFLAGS="${CFLAGS}"
926 CFLAGS="${CFLAGS} -Werror"
927 AC_COMPILE_IFELSE(
928 [AC_LANG_PROGRAM(
929 [
930 #include <pfring.h>
931 ],
932 [
933 pfring_open(NULL, 0, 0);
934 ])],
935 [pfring_new_open="yes"],
936 [pfring_new_open="no"])
937 AC_MSG_RESULT($pfring_new_open)
938 if test "x$pfring_new_open" = "xyes"; then
939 AC_DEFINE([HAVE_PFRING_OPEN_NEW], [1], [For post 5.4.0 version of pfring_open])
940 fi
941 CFLAGS="${STORECFLAGS}"
942
943 ])
944
945
946 # libpcap
947 AC_ARG_WITH(libpcap_includes,
948 [ --with-libpcap-includes=DIR libpcap include directory],
949 [with_libpcap_includes="$withval"],[with_libpcap_includes=no])
950 AC_ARG_WITH(libpcap_libraries,
951 [ --with-libpcap-libraries=DIR libpcap library directory],
952 [with_libpcap_libraries="$withval"],[with_libpcap_libraries="no"])
953
954 if test "$with_libpcap_includes" != "no"; then
955 CPPFLAGS="${CPPFLAGS} -I${with_libpcap_includes}"
956 fi
957
958 AC_CHECK_HEADER(pcap.h,,[AC_ERROR(pcap.h not found ...)])
959
960 if test "$with_libpcap_libraries" != "no"; then
961 LDFLAGS="${LDFLAGS} -L${with_libpcap_libraries}"
962 fi
963 AC_CHECK_HEADERS([pcap.h pcap/pcap.h pcap/bpf.h])
964
965 LIBPCAP=""
966 AC_CHECK_LIB(pcap, pcap_open_live,, LIBPCAP="no", [-lpthread])
967 if test "$LIBPCAP" = "no"; then
968 echo
969 echo " ERROR! libpcap library not found, go get it"
970 echo " from http://www.tcpdump.org or your distribution:"
971 echo
972 echo " Ubuntu: apt-get install libpcap-dev"
973 echo " Fedora: yum install libpcap-devel"
974 echo
975 exit 1
976 fi
977
978 # pcap_activate and pcap_create only exists in libpcap >= 1.0
979 LIBPCAPVTEST=""
980 #To prevent duping the lib link we reset LIBS after this check. Setting action-if-found to NULL doesn't seem to work
981 #see: http://blog.flameeyes.eu/2008/04/29/i-consider-ac_check_lib-harmful
982 TMPLIBS="${LIBS}"
983 AC_CHECK_LIB(pcap, pcap_activate,, LPCAPVTEST="no")
984 if test "$LPCAPVTEST" != "no"; then
985 AC_PATH_PROG(HAVE_PCAP_CONFIG, pcap-config, "no")
986 if test "$HAVE_PCAP_CONFIG" = "no"; then
987 CFLAGS="${CFLAGS} -DLIBPCAP_VERSION_MAJOR=1"
988 else
989 CFLAGS="${CFLAGS} `pcap-config --defines` `pcap-config --cflags` -DLIBPCAP_VERSION_MAJOR=1"
990 fi
991 else
992 CFLAGS="${CFLAGS} -DLIBPCAP_VERSION_MAJOR=0"
993 fi
994 LIBS="${TMPLIBS}"
995
996 #Appears as if pcap_set_buffer_size is linux only?
997 LIBPCAPSBUFF=""
998 #To prevent duping the lib link we reset LIBS after this check. Setting action-if-found to NULL doesn't seem to work
999 #see: http://blog.flameeyes.eu/2008/04/29/i-consider-ac_check_lib-harmful
1000 TMPLIBS="${LIBS}"
1001 AC_CHECK_LIB(pcap, pcap_set_buffer_size,, LPCAPSBUFF="no")
1002 if test "$LPCAPSBUFF" != "no"; then
1003 CFLAGS="${CFLAGS} -DHAVE_PCAP_SET_BUFF"
1004 fi
1005 LIBS="${TMPLIBS}"
1006
1007 # AF_PACKET support
1008 AC_ARG_ENABLE(af-packet,
1009 AS_HELP_STRING([--enable-af-packet], [Enable AF_PACKET support [default=yes]]),
1010 ,[enable_af_packet=yes])
1011 AS_IF([test "x$enable_af_packet" = "xyes"], [
1012 AC_CHECK_DECL([TPACKET_V2],
1013 AC_DEFINE([HAVE_AF_PACKET],[1],[AF_PACKET support is available]),
1014 [enable_af_packet="no"],
1015 [[#include <sys/socket.h>
1016 #include <linux/if_packet.h>]])
1017 AC_CHECK_DECL([PACKET_FANOUT],
1018 AC_DEFINE([HAVE_PACKET_FANOUT],[1],[Packet fanout support is available]),
1019 [],
1020 [[#include <linux/if_packet.h>]])
1021 ])
1022
1023
1024 # libhtp
1025 AC_ARG_ENABLE(non-bundled-htp,
1026 AS_HELP_STRING([--enable-non-bundled-htp], [Enable the use of an already installed version of htp]),,[enable_non_bundled_htp=no])
1027 AS_IF([test "x$enable_non_bundled_htp" = "xyes"], [
1028 AC_ARG_WITH(libhtp_includes,
1029 [ --with-libhtp-includes=DIR libhtp include directory],
1030 [with_libhtp_includes="$withval"],[with_libhtp_includes=no])
1031 AC_ARG_WITH(libhtp_libraries,
1032 [ --with-libhtp-libraries=DIR libhtp library directory],
1033 [with_libhtp_libraries="$withval"],[with_libhtp_libraries="no"])
1034
1035 if test "$with_libhtp_includes" != "no"; then
1036 CPPFLAGS="${CPPFLAGS} -I${with_libhtp_includes}"
1037 fi
1038
1039 if test "$with_libhtp_libraries" != "no"; then
1040 LDFLAGS="${LDFLAGS} -L${with_libhtp_libraries}"
1041 fi
1042
1043 AC_CHECK_HEADER(htp/htp.h,,[AC_ERROR(htp/htp.h not found ...)])
1044
1045 LIBHTP=""
1046 AC_CHECK_LIB(htp, htp_conn_create,, LIBHTP="no")
1047 if test "$LIBHTP" = "no"; then
1048 echo
1049 echo " ERROR! libhtp library not found"
1050 echo
1051 exit 1
1052 fi
1053 PKG_CHECK_MODULES(LIBHTPMINVERSION, htp >= 0.2.3,[libhtp_minver_found="yes"],[libhtp_minver_found="no"])
1054 if test "$libhtp_minver_found" = "no"; then
1055 echo
1056 echo " ERROR! libhtp was found but is not the minimum version required >=0.2.3"
1057 echo
1058 exit 1
1059 fi
1060 PKG_CHECK_MODULES(LIBHTPMAXVERSION, htp <= 0.3.0,[libhtp_maxver_found="yes"],[libhtp_maxver_found="no"])
1061 if test "$libhtp_maxver_found" = "no"; then
1062 echo
1063 echo " ERROR! libhtp 0.3.x was found but only 0.2.x is supported"
1064 echo
1065 exit 1
1066 fi
1067
1068 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])
1069 # check for htp_tx_get_response_headers_raw
1070 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])
1071 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])
1072 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]) )
1073 ])
1074
1075 # even if we are using an installed htp lib we still need to gen Makefiles inside of htp
1076 AC_CONFIG_SUBDIRS([libhtp])
1077 AM_CONDITIONAL([BUILD_LIBHTP], [test "x$enable_non_bundled_htp" = "xno"])
1078 AS_IF([test "x$enable_non_bundled_htp" = "xno"], [
1079 AC_DEFINE_UNQUOTED([HAVE_HTP_URI_NORMALIZE_HOOK],[1],[Assuming htp_config_register_request_uri_normalize function in bundled libhtp])
1080 AC_DEFINE_UNQUOTED([HAVE_HTP_TX_GET_RESPONSE_HEADERS_RAW],[1],[Assuming htp_tx_get_response_headers_raw function in bundled libhtp])
1081 AC_DEFINE_UNQUOTED([HAVE_HTP_DECODE_QUERY_INPLACE],[1],[Assuming htp_decode_query_inplace function in bundled libhtp])
1082 ])
1083
1084
1085 # enable CUDA output
1086 AC_ARG_ENABLE(cuda,
1087 AS_HELP_STRING([--enable-cuda], [Enable experimental CUDA pattern matching]),,[enable_cuda=no])
1088 AS_IF([test "x$enable_cuda" = "xyes"], [
1089 AC_ARG_WITH(cuda_includes,
1090 [ --with-cuda-includes=DIR cuda include directory],
1091 [with_cuda_includes="$withval"],[with_cuda_includes=no])
1092 AC_ARG_WITH(cuda_libraries,
1093 [ --with-cuda-libraries=DIR cuda library directory],
1094 [with_cuda_libraries="$withval"],[with_cuda_libraries="no"])
1095 AC_ARG_WITH(cuda_nvcc,
1096 [ --with-cuda-nvcc=DIR cuda nvcc compiler directory],
1097 [with_cuda_nvcc="$withval"],[with_cuda_nvcc=no])
1098
1099 CFLAGS="${CFLAGS} -D__SC_CUDA_SUPPORT__"
1100
1101 if test "$with_cuda_includes" != "no"; then
1102 CPPFLAGS="${CPPFLAGS} -I${with_cuda_includes}"
1103 else
1104 CPPFLAGS="${CPPFLAGS} -I/usr/local/cuda/include"
1105 fi
1106
1107 if test "$with_cuda_libraries" != "no"; then
1108 LDFLAGS="${LDFLAGS} -L${with_cuda_libraries}"
1109 fi
1110
1111 if test "$with_cuda_nvcc" != "no"; then
1112 NVCC_DIR="${with_cuda_nvcc}"
1113 else
1114 NVCC_DIR="/usr/local/cuda/bin"
1115 fi
1116
1117 AC_CHECK_HEADER(cuda.h,,[AC_ERROR(cuda.h not found ...)])
1118
1119 LIBCUDA=""
1120 AC_CHECK_LIB(cuda, cuArray3DCreate,, LIBCUDA="no")
1121 if test "$LIBCUDA" = "no"; then
1122 echo
1123 echo " ERROR! libcuda library not found"
1124 echo
1125 exit 1
1126 fi
1127
1128 AC_PATH_PROG([NVCC], [nvcc], no, [$PATH:$NVCC_DIR])
1129 if test "x$NVCC" = "xno"; then
1130 echo
1131 echo " ERROR! CUDA nvcc compiler not found: use --with-cuda-nvcc=DIR"
1132 echo
1133 exit 1
1134 fi
1135
1136 AC_MSG_CHECKING(for nvcc version)
1137 NVCCVER=`$NVCC --version | grep "release" | sed 's/.*release \(@<:@0-9@:>@\)\.\(@<:@0-9@:>@\).*/\1\2/'`
1138 AC_MSG_RESULT($NVCCVER)
1139 if test "$NVCCVER" -lt 31; then
1140 echo
1141 echo " Warning! Your CUDA nvcc version might be outdated."
1142 echo " If compilation fails try the latest CUDA toolkit from"
1143 echo " www.nvidia.com/object/cuda_develop.html"
1144 echo
1145 fi
1146
1147 AM_PATH_PYTHON(,, no)
1148 if test "x$PYTHON" = "xno"; then
1149 echo
1150 echo " ERROR! Compiling CUDA kernels requires python."
1151 echo
1152 exit 1
1153 fi
1154 ])
1155 AM_CONDITIONAL([BUILD_CUDA], [test "x$enable_cuda" = "xyes"])
1156
1157
1158 # Check for libcap-ng
1159 case $host in
1160 *-*-linux*)
1161 AC_ARG_WITH(libcap_ng_includes,
1162 [ --with-libcap_ng-includes=DIR libcap_ng include directory],
1163 [with_libcap-ng_includes="$withval"],[with_libcap_ng_includes=no])
1164 AC_ARG_WITH(libcap_ng_libraries,
1165 [ --with-libcap_ng-libraries=DIR libcap_ng library directory],
1166 [with_libcap_ng_libraries="$withval"],[with_libcap_ng_libraries="no"])
1167
1168 if test "$with_libcap_ng_includes" != "no"; then
1169 CPPFLAGS="${CPPFLAGS} -I${with_libcap_ng_includes}"
1170 fi
1171
1172 if test "$with_libcap_ng_libraries" != "no"; then
1173 LDFLAGS="${LDFLAGS} -L${with_libcap_ng_libraries}"
1174 fi
1175
1176 AC_CHECK_HEADER(cap-ng.h,,LIBCAP_NG="no")
1177 if test "$LIBCAP_NG" != "no"; then
1178 LIBCAP_NG=""
1179 AC_CHECK_LIB(cap-ng,capng_clear,,LIBCAP_NG="no")
1180 fi
1181
1182 if test "$LIBCAP_NG" != "no"; then
1183 CFLAGS="${CFLAGS} -DHAVE_LIBCAP_NG"
1184 fi
1185
1186 if test "$LIBCAP_NG" = "no"; then
1187 echo
1188 echo " WARNING! libcap-ng library not found, go get it"
1189 echo " from http://people.redhat.com/sgrubb/libcap-ng/"
1190 echo " or your distribution:"
1191 echo
1192 echo " Ubuntu: apt-get install libcap-ng-dev"
1193 echo " Fedora: yum install libcap-ng-devel"
1194 echo
1195 echo " Suricata will be built without support for dropping privs."
1196 echo
1197 fi
1198 ;;
1199 esac
1200
1201 # Check for DAG support.
1202 AC_ARG_ENABLE(dag,
1203 AS_HELP_STRING([--enable-dag],[Enable DAG capture]),
1204 [ enable_dag=yes ],
1205 [ enable_dag=no])
1206 AC_ARG_WITH(dag_includes,
1207 [ --with-dag-includes=DIR dagapi include directory],
1208 [with_dag_includes="$withval"],[with_dag_includes="no"])
1209 AC_ARG_WITH(dag_libraries,
1210 [ --with-dag-libraries=DIR dagapi library directory],
1211 [with_dag_libraries="$withval"],[with_dag_libraries="no"])
1212
1213 if test "$enable_dag" = "yes"; then
1214
1215 if test "$with_dag_includes" != "no"; then
1216 CPPFLAGS="${CPPFLAGS} -I${with_dag_includes}"
1217 fi
1218
1219 if test "$with_dag_libraries" != "no"; then
1220 LDFLAGS="${LDFLAGS} -L${with_dag_libraries}"
1221 fi
1222
1223 AC_CHECK_HEADER(dagapi.h,DAG="yes",DAG="no")
1224 if test "$DAG" != "no"; then
1225 DAG=""
1226 AC_CHECK_LIB(dag,dag_open,,DAG="no",)
1227 fi
1228
1229 if test "$DAG" != "no"; then
1230 CFLAGS="${CFLAGS} -DHAVE_DAG"
1231 fi
1232
1233 if test "$DAG" = "no"; then
1234 echo
1235 echo " ERROR! libdag library not found"
1236 echo
1237 exit 1
1238 fi
1239 fi
1240
1241 # libnspr
1242 enable_nspr="no"
1243
1244 # Try pkg-config first:
1245 PKG_CHECK_MODULES([libnspr], nspr,, [with_pkgconfig_nspr=no])
1246 if test "$with_pkgconfig_nspr" != "no"; then
1247 CPPFLAGS="${CPPFLAGS} ${libnspr_CFLAGS}"
1248 LIBS="${LIBS} ${libnspr_LIBS}"
1249 fi
1250
1251 AC_ARG_WITH(libnspr_includes,
1252 [ --with-libnspr-includes=DIR libnspr include directory],
1253 [with_libnspr_includes="$withval"],[with_libnspr_includes=no])
1254 AC_ARG_WITH(libnspr_libraries,
1255 [ --with-libnspr-libraries=DIR libnspr library directory],
1256 [with_libnspr_libraries="$withval"],[with_libnspr_libraries="no"])
1257
1258 if test "$with_libnspr_includes" != "no"; then
1259 CPPFLAGS="${CPPFLAGS} -I${with_libnspr_includes}"
1260 fi
1261
1262 AC_CHECK_HEADER(nspr.h,NSPR="yes",NSPR="no")
1263 if test "$NSPR" = "yes"; then
1264 if test "$with_libnspr_libraries" != "no"; then
1265 LDFLAGS="${LDFLAGS} -L${with_libnspr_libraries}"
1266 fi
1267
1268 AC_CHECK_LIB(nspr4, PR_GetCurrentThread,, NSPR="no")
1269
1270 if test "$NSPR" = "no"; then
1271 echo
1272 echo " ERROR! libnspr library not found, go get it"
1273 echo " from Mozilla or your distribution:"
1274 echo
1275 echo " Ubuntu: apt-get install libnspr4-dev"
1276 echo " Fedora: yum install nspr-devel"
1277 echo
1278 exit 1
1279 fi
1280 enable_nspr="yes"
1281 fi
1282
1283 # libnss
1284 enable_nss="no"
1285
1286 # Try pkg-config first:
1287 PKG_CHECK_MODULES([libnss], nss,, [with_pkgconfig_nss=no])
1288 if test "$with_pkgconfig_nss" != "no"; then
1289 CPPFLAGS="${CPPFLAGS} ${libnss_CFLAGS}"
1290 LIBS="${LIBS} ${libnss_LIBS}"
1291 fi
1292
1293 AC_ARG_WITH(libnss_includes,
1294 [ --with-libnss-includes=DIR libnss include directory],
1295 [with_libnss_includes="$withval"],[with_libnss_includes=no])
1296 AC_ARG_WITH(libnss_libraries,
1297 [ --with-libnss-libraries=DIR libnss library directory],
1298 [with_libnss_libraries="$withval"],[with_libnss_libraries="no"])
1299
1300 if test "$with_libnss_includes" != "no"; then
1301 CPPFLAGS="${CPPFLAGS} -I${with_libnss_includes}"
1302 fi
1303
1304 AC_CHECK_HEADER(sechash.h,NSS="yes",NSS="no")
1305 if test "$NSS" = "yes"; then
1306 if test "$with_libnss_libraries" != "no"; then
1307 LDFLAGS="${LDFLAGS} -L${with_libnss_libraries}"
1308 fi
1309
1310 AC_CHECK_LIB(nss3, HASH_Begin,, NSS="no")
1311
1312 if test "$NSS" = "no"; then
1313 echo
1314 echo " ERROR! libnss library not found, go get it"
1315 echo " from Mozilla or your distribution:"
1316 echo
1317 echo " Ubuntu: apt-get install libnss3-dev"
1318 echo " Fedora: yum install nss-devel"
1319 echo
1320 exit 1
1321 fi
1322
1323 AC_DEFINE([HAVE_NSS],[1],[libnss available for md5])
1324 enable_nss="yes"
1325 fi
1326
1327 # libmagic
1328 AC_ARG_WITH(libmagic_includes,
1329 [ --with-libmagic-includes=DIR libmagic include directory],
1330 [with_libmagic_includes="$withval"],[with_libmagic_includes=no])
1331 AC_ARG_WITH(libmagic_libraries,
1332 [ --with-libmagic-libraries=DIR libmagic library directory],
1333 [with_libmagic_libraries="$withval"],[with_libmagic_libraries="no"])
1334
1335 if test "$with_libmagic_includes" != "no"; then
1336 CPPFLAGS="${CPPFLAGS} -I${with_libmagic_includes}"
1337 fi
1338
1339 AC_CHECK_HEADER(magic.h,,[AC_ERROR(magic.h not found ...)])
1340
1341 if test "$with_libmagic_libraries" != "no"; then
1342 LDFLAGS="${LDFLAGS} -L${with_libmagic_libraries}"
1343 fi
1344
1345 MAGIC=""
1346 AC_CHECK_LIB(magic, magic_open,, MAGIC="no")
1347
1348 if test "$MAGIC" = "no"; then
1349 echo
1350 echo " ERROR! magic library not found, go get it"
1351 echo " from http://www.darwinsys.com/file/ or your distribution:"
1352 echo
1353 echo " Ubuntu: apt-get install libmagic-dev"
1354 echo " Fedora: yum install file-devel"
1355 echo
1356 exit 1
1357 fi
1358
1359 # Napatech - Using the 3GD API
1360 AC_ARG_ENABLE(napatech,
1361 AS_HELP_STRING([--enable-napatech],[Enabled Napatech Devices]),
1362 [ enable_napatech=yes ],
1363 [ enable_napatech=no])
1364 AC_ARG_WITH(napatech_includes,
1365 [ --with-napatech-includes=DIR napatech include directory],
1366 [with_napatech_includes="$withval"],[with_napatech_includes="/opt/napatech3/include"])
1367 AC_ARG_WITH(napatech_libraries,
1368 [ --with-napatech-libraries=DIR napatech library directory],
1369 [with_napatech_libraries="$withval"],[with_napatech_libraries="/opt/napatech3/lib"])
1370
1371 if test "$enable_napatech" = "yes"; then
1372 CPPFLAGS="${CPPFLAGS} -I${with_napatech_includes}"
1373 LDFLAGS="${LDFLAGS} -L${with_napatech_libraries} -lntapi"
1374 AC_CHECK_HEADER(nt.h,NAPATECH="yes",NAPATECH="no")
1375 if test "$NAPATECH" != "no"; then
1376 NAPATECH=""
1377 AC_CHECK_LIB(ntapi, NT_Init,NAPATECH="yes",NAPATECH="no")
1378 fi
1379
1380 if test "$NAPATECH" != "no"; then
1381 CFLAGS="${CFLAGS} -DHAVE_NAPATECH"
1382 fi
1383
1384 if test "$NAPATECH" = "no"; then
1385 echo
1386 echo " ERROR! libntapi library not found"
1387 echo
1388 exit 1
1389 fi
1390 fi
1391
1392 # libluajit
1393 AC_ARG_ENABLE(luajit,
1394 AS_HELP_STRING([--enable-luajit],[Enable Luajit support]),
1395 [ enable_luajit="yes"],
1396 [ enable_luajit="no"])
1397 AC_ARG_WITH(libluajit_includes,
1398 [ --with-libluajit-includes=DIR libluajit include directory],
1399 [with_libluajit_includes="$withval"],[with_libluajit_includes="no"])
1400 AC_ARG_WITH(libluajit_libraries,
1401 [ --with-libluajit-libraries=DIR libluajit library directory],
1402 [with_libluajit_libraries="$withval"],[with_libluajit_libraries="no"])
1403
1404 if test "$enable_luajit" = "yes"; then
1405 if test "$with_libluajit_includes" != "no"; then
1406 CPPFLAGS="${CPPFLAGS} -I${with_libluajit_includes}"
1407 else
1408 PKG_CHECK_MODULES([LUAJIT], [luajit], , LUAJIT="no")
1409 CPPFLAGS="${CPPFLAGS} ${LUAJIT_CFLAGS}"
1410 fi
1411
1412 AC_CHECK_HEADER(lualib.h,LUAJIT="yes",LUAJIT="no")
1413 if test "$LUAJIT" = "yes"; then
1414 if test "$with_libluajit_libraries" != "no"; then
1415 LDFLAGS="${LDFLAGS} -L${with_libluajit_libraries}"
1416 else
1417 PKG_CHECK_MODULES([LUAJIT], [luajit])
1418 LDFLAGS="${LDFLAGS} ${LUAJIT_LIBS}"
1419 fi
1420
1421 AC_CHECK_LIB(luajit-5.1, luaL_openlibs,, LUAJIT="no")
1422
1423 if test "$LUAJIT" = "no"; then
1424 echo
1425 echo " ERROR! libluajit library not found, go get it"
1426 echo " from http://luajit.org/index.html or your distribution:"
1427 echo
1428 echo " Ubuntu: apt-get install libluajit-5.1-dev"
1429 echo
1430 echo " If you installed software in a non-standard prefix"
1431 echo " consider adjusting the PKG_CONFIG_PATH environment variable"
1432 echo " or use --with-libluajit-libraries configure option."
1433 echo
1434 exit 1
1435 fi
1436
1437 AC_DEFINE([HAVE_LUAJIT],[1],[libluajit available])
1438 enable_luajit="yes"
1439 else
1440 echo
1441 echo " ERROR! libluajit headers not found, go get them"
1442 echo " from http://luajit.org/index.html or your distribution:"
1443 echo
1444 echo " Ubuntu: apt-get install libluajit-5.1-dev"
1445 echo
1446 echo " If you installed software in a non-standard prefix"
1447 echo " consider adjusting the PKG_CONFIG_PATH environment variable"
1448 echo " or use --with-libluajit-includes and --with-libluajit-libraries"
1449 echo " configure option."
1450 echo
1451 exit 1
1452 fi
1453 fi
1454
1455 # libgeoip
1456 AC_ARG_ENABLE(geoip,
1457 AS_HELP_STRING([--enable-geoip],[Enable GeoIP support]),
1458 [ enable_geoip="yes"],
1459 [ enable_geoip="no"])
1460 AC_ARG_WITH(libgeoip_includes,
1461 [ --with-libgeoip-includes=DIR libgeoip include directory],
1462 [with_libgeoip_includes="$withval"],[with_libgeoip_includes="no"])
1463 AC_ARG_WITH(libgeoip_libraries,
1464 [ --with-libgeoip-libraries=DIR libgeoip library directory],
1465 [with_libgeoip_libraries="$withval"],[with_libgeoip_libraries="no"])
1466
1467 if test "$enable_geoip" = "yes"; then
1468 if test "$with_libgeoip_includes" != "no"; then
1469 CPPFLAGS="${CPPFLAGS} -I${with_libgeoip_includes}"
1470 fi
1471
1472 AC_CHECK_HEADER(GeoIP.h,GEOIP="yes",GEOIP="no")
1473 if test "$GEOIP" = "yes"; then
1474 if test "$with_libgeoip_libraries" != "no"; then
1475 LDFLAGS="${LDFLAGS} -L${with_libgeoip_libraries}"
1476 fi
1477 AC_CHECK_LIB(GeoIP, GeoIP_country_code_by_ipnum,, GEOIP="no")
1478 fi
1479 if test "$GEOIP" = "no"; then
1480 echo
1481 echo " ERROR! libgeoip library not found, go get it"
1482 echo " from http://www.maxmind.com/en/geolite or your distribution:"
1483 echo
1484 echo " Ubuntu: apt-get install libgeoip-dev"
1485 echo " Fedora: yum install GeoIP-devel"
1486 echo
1487 exit 1
1488 fi
1489 if test "$GEOIP" = "yes"; then
1490 AC_DEFINE([HAVE_GEOIP],[1],[libgeoip available])
1491 enable_geoip="yes"
1492 fi
1493 fi
1494
1495 # get cache line size
1496 AC_PATH_PROG(HAVE_GETCONF_CMD, getconf, "no")
1497 if test "$HAVE_GETCONF_CMD" != "no"; then
1498 CLS=$(getconf LEVEL1_DCACHE_LINESIZE)
1499 if test "$CLS" != ""; then
1500 AC_DEFINE_UNQUOTED([CLS],[${CLS}],[L1 cache line size])
1501 else
1502 AC_DEFINE_UNQUOTED([CLS],[64],[L1 cache line size])
1503 fi
1504 else
1505 AC_DEFINE_UNQUOTED([CLS],[64],[L1 cache line size])
1506 fi
1507
1508 # get revision
1509 if test -f ./revision; then
1510 REVISION=`cat ./revision`
1511 CFLAGS="${CFLAGS} -DREVISION=\"${REVISION}\""
1512 else
1513 AC_PATH_PROG(HAVE_GIT_CMD, git, "no")
1514 if test "$HAVE_GIT_CMD" != "no"; then
1515 if [ test -d .git ]; then
1516 REVISION=`git rev-parse --short HEAD`
1517 CFLAGS="${CFLAGS} -DREVISION=\"${REVISION}\""
1518 fi
1519 fi
1520 fi
1521
1522 AC_SUBST(CFLAGS)
1523 AC_SUBST(LDFLAGS)
1524 AC_SUBST(CPPFLAGS)
1525
1526 define([EXPAND_VARIABLE],
1527 [$2=[$]$1
1528 if test $prefix = 'NONE'; then
1529 prefix="/usr/local"
1530 fi
1531 while true; do
1532 case "[$]$2" in
1533 *\[$]* ) eval "$2=[$]$2" ;;
1534 *) break ;;
1535 esac
1536 done
1537 eval "$2=[$]$2$3"
1538 ])dnl EXPAND_VARIABLE
1539
1540 # suricata log dir
1541 if test "$WINDOWS_PATH" = "yes"; then
1542 systemtype="`systeminfo | grep \"based PC\"`"
1543 case "$systemtype" in
1544 *x64*)
1545 e_winbase="C:\\\\Program Files (x86)\\\\Suricata"
1546 ;;
1547 *)
1548 e_winbase="C:\\\\Program Files\\\\Suricata"
1549 ;;
1550 esac
1551
1552 e_sysconfdir="$e_winbase\\\\"
1553 e_sysconfrulesdir="$e_winbase\\\\rules\\\\"
1554 e_magic_file="$e_winbase\\\\magic.mgc"
1555 e_logdir="$e_winbase\\\\log"
1556 e_logfilesdir="$e_logdir\\\\files"
1557 else
1558 EXPAND_VARIABLE(localstatedir, e_logdir, "/log/suricata/")
1559 EXPAND_VARIABLE(localstatedir, e_rundir, "/run/")
1560 EXPAND_VARIABLE(localstatedir, e_logfilesdir, "/log/suricata/files")
1561 EXPAND_VARIABLE(sysconfdir, e_sysconfdir, "/suricata/")
1562 EXPAND_VARIABLE(sysconfdir, e_sysconfrulesdir, "/suricata/rules")
1563 EXPAND_VARIABLE(localstatedir, e_localstatedir, "/run/suricata")
1564 fi
1565 AC_SUBST(e_logdir)
1566 AC_SUBST(e_rundir)
1567 AC_SUBST(e_logfilesdir)
1568 AC_SUBST(e_sysconfdir)
1569 AC_SUBST(e_sysconfrulesdir)
1570 AC_SUBST(e_localstatedir)
1571 AC_DEFINE_UNQUOTED([CONFIG_DIR],["$e_sysconfdir"],[Our CONFIG_DIR])
1572 AC_SUBST(e_magic_file)
1573
1574 AC_OUTPUT(Makefile src/Makefile qa/Makefile qa/coccinelle/Makefile rules/Makefile doc/Makefile contrib/Makefile contrib/file_processor/Makefile contrib/file_processor/Action/Makefile contrib/file_processor/Processor/Makefile suricata.yaml scripts/Makefile scripts/suricatasc/Makefile scripts/suricatasc/suricatasc)
1575
1576 SURICATA_BUILD_CONF="Suricata Configuration:
1577 AF_PACKET support: ${enable_af_packet}
1578 PF_RING support: ${enable_pfring}
1579 NFQueue support: ${enable_nfqueue}
1580 IPFW support: ${enable_ipfw}
1581 DAG enabled: ${enable_dag}
1582 Napatech enabled: ${enable_napatech}
1583 Unix socket enabled: ${enable_unixsocket}
1584
1585 libnss support: ${enable_nss}
1586 libnspr support: ${enable_nspr}
1587 libjansson support: ${enable_jansson}
1588 Prelude support: ${enable_prelude}
1589 PCRE jit: ${pcre_jit_available}
1590 libluajit: ${enable_luajit}
1591 libgeoip: ${enable_geoip}
1592 Non-bundled htp: ${enable_non_bundled_htp}
1593 Old barnyard2 support: ${enable_old_barnyard2}
1594 CUDA enabled: ${enable_cuda}
1595
1596 Suricatasc install: ${enable_python}
1597
1598 Unit tests enabled: ${enable_unittests}
1599 Debug output enabled: ${enable_debug}
1600 Debug validation enabled: ${enable_debug_validation}
1601 Profiling enabled: ${enable_profiling}
1602 Profiling locks enabled: ${enable_profiling_locks}
1603
1604 Generic build parameters:
1605 Installation prefix (--prefix): ${prefix}
1606 Configuration directory (--sysconfdir): ${e_sysconfdir}
1607 Log directory (--localstatedir) : ${e_logdir}
1608
1609 Host: ${host}
1610 GCC binary: ${CC}
1611 GCC Protect enabled: ${enable_gccprotect}
1612 GCC march native enabled: ${enable_gccmarch_native}
1613 GCC Profile enabled: ${enable_gccprofile}"
1614
1615 echo
1616 echo "$SURICATA_BUILD_CONF"
1617 echo "printf(" >${ac_builddir}/src/build-info.h
1618 echo "$SURICATA_BUILD_CONF" | sed -e 's/^/"/' | sed -e 's/$/\\n"/' >>${ac_builddir}/src/build-info.h
1619 echo ");" >>${ac_builddir}/src/build-info.h
1620
1621 echo "
1622 To build and install run 'make' and 'make install'.
1623
1624 You can run 'make install-conf' if you want to install initial configuration
1625 files to ${e_sysconfdir}. Running 'make install-full' will install configuration
1626 and rules and provide you a ready-to-run suricata."
1627 echo
1628 echo "To install Suricata into /usr/bin/suricata, have the config in
1629 /etc/suricata and use /var/log/suricata as log dir, use:
1630 ./configure --prefix=/usr/ --sysconfdir=/etc/ --localstatedir=/var/"
1631 echo