"Fossies" - the Fresh Open Source Software Archive

Member "snort-2.9.17/configure.in" (16 Oct 2020, 54887 Bytes) of package /linux/misc/snort-2.9.17.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "configure.in": 2.9.16.1_vs_2.9.17.

    1 # $Id$
    2 AC_INIT([snort], [m4_esyscmd_s([cat ./VERSION])])
    3 AC_CONFIG_SRCDIR([src/snort.c])
    4 AC_PREREQ(2.50)
    5 AM_CONFIG_HEADER(config.h)
    6 # When changing the snort version, please also update the VERSION
    7 # definition in "src/win32/WIN32-Includes/config.h"
    8 AM_INIT_AUTOMAKE(snort,2.9.17)
    9 
   10 NO_OPTIMIZE="no"
   11 
   12 AC_PROG_CC_STDC
   13 AC_PROG_CC
   14 AC_PROG_LIBTOOL
   15 AC_PROG_RANLIB
   16 AC_C_BIGENDIAN
   17 # AC_C_BIGENDIAN implicitly defines WORDS_BIGENDIAN, but the CCONFIGFLAGS also needs to be affected.
   18 if test "x$ac_cv_c_bigendian" = "xyes"; then
   19     CCONFIGFLAGS="${CCONFIGFLAGS} -DSF_BIGENDIAN"
   20 fi
   21 AC_C_INLINE
   22 
   23 #AC_CANONICAL_HOST
   24 linux="no"
   25 sunos4="no"
   26 macos="no"
   27 so_with_static_lib="yes"
   28 
   29 case "$host" in
   30   *-openbsd2.6|*-openbsd2.5|*-openbsd2.4|*-openbsd2.3*)
   31     AC_DEFINE([OPENBSD],[1],[Define if OpenBSD])
   32     AC_DEFINE([BROKEN_SIOCGIFMTU],[1],[Define if BROKEN_SIOCGIFMTU])
   33     so_with_static_lib="no"
   34 
   35     ;;
   36   *-openbsd*)
   37     AC_DEFINE([OPENBSD],[1],[Define if OpenBSD < 2.3])
   38     so_with_static_lib="no"
   39 
   40     ;;
   41   *-sgi-irix5*)
   42     AC_DEFINE([IRIX],[1],[Define if Irix 5])
   43     no_libsocket="yes"
   44     no_libnsl="yes"
   45     if test -z "$GCC"; then
   46       sgi_cc="yes"
   47     fi
   48     LDFLAGS="${LDFLAGS} -L/usr/local/lib"
   49     extra_incl="-I/usr/local/include"
   50     ;;
   51   *-sgi-irix6*)
   52     AC_DEFINE([IRIX],[1],[Define if Irix 6])
   53     no_libsocket="yes"
   54     no_libnsl="yes"
   55     if test -z "$GCC"; then
   56       sgi_cc="yes"
   57     fi
   58     LDFLAGS="${LDFLAGS} -L/usr/local/lib"
   59     extra_incl="-I/usr/local/include"
   60     ;;
   61   *-solaris*)
   62     AC_DEFINE([SOLARIS],[1],[Define if Solaris])
   63     CONFIGFLAGS="${CONFIGFLAGS} -DBSD_COMP -D_REENTRANT"
   64     rt_nanosleep="yes"
   65     ;;
   66   *-sunos*)
   67     AC_DEFINE([SUNOS],[1],[Define if SunOS])
   68     sunos4="yes"
   69     ;;
   70   *-linux*)
   71     linux="yes"
   72     AC_DEFINE([LINUX],[1],[Define if Linux])
   73     AC_SUBST(extra_incl)
   74     extra_incl="-I/usr/include/pcap"
   75     ;;
   76   *-hpux10*|*-hpux11*)
   77     AC_DEFINE([HPUX],[1],[Define if HP-UX 10 or 11])
   78     if test "x$ac_cv_c_bigendian" = "xno"; then
   79         # exception to AC_C_BIGENDIAN and test "x$ac_cv_c_bigendian" = "xyes" above 
   80         # causes the need for next three lines.
   81         AC_MSG_NOTICE([bigendian byte-order not detected but asserted for $host])
   82         AC_DEFINE([WORDS_BIGENDIAN],[1],[Define if words are big endian])
   83         CCONFIGFLAGS="${CCONFIGFLAGS} -DSF_BIGENDIAN"
   84     fi
   85     AC_SUBST(extra_incl)
   86     extra_incl="-I/usr/local/include"
   87     ;;
   88   *-freebsd*)
   89     AC_DEFINE([FREEBSD],[1],[Define if FreeBSD])
   90     ;;
   91   *-bsdi*)
   92     AC_DEFINE([BSDI],[1],[Define if BSDi])
   93     ;;
   94   *-aix*)
   95     AC_DEFINE([AIX],[1],[Define if AIX])
   96     ;;
   97   *-osf4*)
   98     AC_DEFINE([OSF1],[1],[Define if OSF-4])
   99     CONFIGFLAGS="${CONFIGFLAGS} -DOSF1"
  100     ;;
  101   *-osf5.1*)
  102     AC_DEFINE([OSF1],[1],[Define if OSF-5.1])
  103     CONFIGFLAGS="${CONFIGFLAGS} -DOSF1"
  104     ;;
  105   *-tru64*)
  106     AC_DEFINE([OSF1],[1],[Define if Tru64])
  107     CONFIGFLAGS="${CONFIGFLAGS} -DOSF1"
  108     ;;
  109 # it is actually <platform>-apple-darwin1.2 or <platform>-apple-rhapsody5.x but lets stick with this for the moment
  110   *-apple*)
  111     macos="yes"
  112     AC_DEFINE([MACOS],[1],[Define if MacOS])
  113     AC_DEFINE([BROKEN_SIOCGIFMTU],[1],[Define if broken SIOCGIFMTU])
  114 esac
  115 
  116 AC_HEADER_STDBOOL
  117 
  118 # ICC stuff
  119 ICC=no
  120 if eval "echo $CC | grep icc > /dev/null" ; then
  121     if eval "$CC -help | grep libcxa > /dev/null" ; then
  122         CFLAGS="$CFLAGS -static-libcxa"
  123         LDFLAGS="$LDFLAGS -static-libcxa"
  124         XCCFLAGS="-XCClinker -static-libcxa"
  125     else
  126         CFLAGS="$CFLAGS -static-intel"
  127         LDFLAGS="$LDFLAGS -static-intel"
  128         XCCFLAGS="-XCClinker -static-intel"
  129     fi
  130     #CFLAGS=`echo $CFLAGS | sed 's/-O2/-O3/'`
  131     CFLAGS="$CFLAGS -O3 -ip -w1"
  132     ICC=yes
  133 fi
  134 AC_SUBST(XCCFLAGS)
  135 
  136 # This is really meant for Solaris Sparc v9 where it has 32bit and 64bit
  137 # capability but builds 32bit by default
  138 AC_ARG_ENABLE(64bit-gcc,
  139 [  --enable-64bit-gcc       Try to compile 64bit (only tested on Sparc Solaris 9 and 10).],
  140        enable_64bit_gcc="$enableval", enable_64bit_gcc="no")
  141 if test "x$enable_64bit_gcc" = "xyes"; then
  142     CFLAGS="$CFLAGS -m64"
  143 fi
  144 
  145 # AC_PROG_YACC defaults to "yacc" when not found
  146 # this check defaults to "none"
  147 AC_CHECK_PROGS(YACC,bison yacc,none)
  148 # AC_PROG_YACC includes the -y arg if bison is found
  149 if test "x$YACC" = "xbison"; then
  150     YACC="$YACC -y"
  151 fi
  152 
  153 # AC_PROG_LEX defaults to ":" when not found
  154 # this check defaults to "none"
  155 # We're using flex specific options so we don't support lex
  156 AC_CHECK_PROGS(LEX,flex,none)
  157 
  158 #
  159 
  160 dnl checking headers
  161 AC_CHECK_HEADERS([ \
  162     inttypes.h \
  163     math.h \
  164     paths.h \
  165     stdlib.h \
  166     string.h \
  167     strings.h \
  168     unistd.h \
  169     wchar.h \
  170     sys/sockio.h \
  171 ])
  172 
  173 if test "x$ac_cv_header_wchar_h" = "xyes"; then
  174     CONFIGFLAGS="${CONFIGFLAGS} -DSF_WCHAR"
  175 fi
  176 AC_CHECK_LIB([m],[floor])
  177 AC_CHECK_LIB([m],[ceil])
  178 
  179 AC_CHECK_HEADERS(uuid/uuid.h, [AC_CHECK_LIB(uuid,uuid_parse)])
  180 
  181 if test "x$rt_nanosleep" = "xyes"; then
  182 AC_CHECK_LIB([rt],[nanosleep])
  183 fi
  184 
  185 dnl make sure we've got all our libraries
  186 if test -z "$no_libnsl"; then
  187 AC_CHECK_LIB(nsl, inet_ntoa)
  188 fi
  189 
  190 if test -z "$no_libsocket"; then
  191 AC_CHECK_LIB(socket, socket)
  192 fi
  193 
  194 # SunOS4 has several things `broken'
  195 if test  "$sunos4" != "no"; then
  196 AC_CHECK_FUNCS(vsnprintf,, LIBS="$LIBS -ldb")
  197 AC_CHECK_FUNCS(strtoul,, LIBS="$LIBS -l44bsd")
  198 fi
  199 
  200 # some funky macro to be backwards compatible with earlier autoconfs
  201 # in current they have AC_CHECK_DECLS
  202 
  203 AC_DEFUN([SN_CHECK_DECL],[
  204 AC_MSG_CHECKING([whether $1 must be declared])
  205 AC_CACHE_VAL(sn_cv_decl_needed_$1,
  206 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  207 #include <stdio.h>
  208 #ifdef HAVE_STRING_H
  209 #include <string.h>
  210 #endif
  211 #ifdef HAVE_STRINGS_H
  212 #include <strings.h>
  213 #endif
  214 #ifdef HAVE_STDLIB_H
  215 #include <stdlib.h>
  216 #endif
  217 #ifdef HAVE_UNISTD_H
  218 #include <unistd.h>
  219 #endif
  220 #include <sys/types.h>
  221 #include <sys/socket.h>
  222 #include <syslog.h>
  223 ]], [[char *(*pfn); pfn = (char *(*)) $1;]])],[eval "sn_cv_decl_needed_$1=no"],[eval "sn_cv_decl_needed_$1=yes"]) ])
  224 
  225 if eval "test \"`echo '$sn_cv_decl_needed_'$1`\" != no"; then
  226  AC_MSG_RESULT(yes)
  227  ifelse([$2], , :, [$2])
  228 else
  229  AC_MSG_RESULT(no)
  230  ifelse([$3], , ,[$3])
  231 fi
  232 ])dnl
  233 
  234 AC_DEFUN([SN_CHECK_DECLS],
  235 [for sn_decl in $1
  236 do
  237 sn_def_decl=`echo $sn_decl | tr [a-z] [A-Z]`
  238 SN_CHECK_DECL($sn_decl,
  239 [
  240 AC_DEFINE_UNQUOTED(NEED_DECL_$sn_def_decl, 1,
  241                   [you have this cuz autoheader is dumb])
  242 $2], $3)dnl
  243 done
  244 ])
  245 
  246 # some stuff for declarations which were missed on sunos4 platform too.
  247 #
  248 # add `#undef NEED_DECL_FUNCTIONAME to acconfig.h` because autoheader
  249 # fails to work properly with custom macroses.
  250 # you will see also #undef for each SN_CHECK_DECLS macros invocation
  251 # because autoheader doesn't execute shell script commands.
  252 # it is possible to make loops using m4 but the code would look even
  253 # more confusing..
  254 SN_CHECK_DECLS(printf fprintf syslog puts fputs fputc fopen  \
  255            fclose fwrite fflush getopt bzero bcopy memset strtol  \
  256            strcasecmp strncasecmp strerror perror socket sendto   \
  257            vsnprintf snprintf strtoul)
  258 
  259 AC_CHECK_FUNCS([sigaction strlcpy strlcat strerror vswprintf wprintf memrchr inet_ntop gettid])
  260 
  261 AC_CHECK_FUNC([snprintf],[have_snprintf="yes"],[have_snprintf="no"])
  262 AM_CONDITIONAL(BUILD_SNPRINTF, test "x$have_snprintf" != "xyes")
  263 if test "x$have_snprintf" = "xyes"; then
  264     AC_DEFINE([HAVE_SNPRINTF], [], [snprintf function is available])
  265 fi
  266 
  267 AC_CHECK_FUNCS([malloc_trim mallinfo])
  268 
  269 AC_CHECK_SIZEOF([char])
  270 AC_CHECK_SIZEOF([short])
  271 AC_CHECK_SIZEOF([int])
  272 AC_CHECK_SIZEOF([long int])
  273 AC_CHECK_SIZEOF([long long int])
  274 AC_CHECK_SIZEOF([unsigned int])
  275 AC_CHECK_SIZEOF([unsigned long int])
  276 AC_CHECK_SIZEOF([unsigned long long int])
  277 
  278 # Check for int types
  279 AC_CHECK_TYPES([u_int8_t,u_int16_t,u_int32_t,u_int64_t,uint8_t,uint16_t,uint32_t,uint64_t])
  280 AC_CHECK_TYPES([int8_t,int16_t,int32_t,int64_t])
  281 
  282 AC_CHECK_TYPES([boolean])
  283 
  284 # In case INADDR_NONE is not defined (like on Solaris)
  285 have_inaddr_none="no"
  286 AC_MSG_CHECKING([for INADDR_NONE])
  287 AC_RUN_IFELSE(
  288 [AC_LANG_PROGRAM(
  289 [[
  290 #include <sys/types.h>
  291 #include <netinet/in.h>
  292 #include <arpa/inet.h>
  293 ]],
  294 [[
  295 	if (inet_addr("10,5,2") == INADDR_NONE);
  296     return 0;
  297 ]])],
  298 [have_inaddr_none="yes"],
  299 [have_inaddr_none="no"])
  300 AC_MSG_RESULT($have_inaddr_none)
  301 if test "x$have_inaddr_none" = "xno"; then
  302 	AC_DEFINE([INADDR_NONE],[-1],[For INADDR_NONE definition])
  303 fi
  304 
  305 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  306 #include <stdio.h>
  307 ]], [[const char *foo; foo = sys_errlist[0];]])],[AC_DEFINE(ERRLIST_PREDEFINED,1,Define if errlist is predefined)],[])
  308 
  309 AC_MSG_CHECKING(for __FUNCTION__)
  310 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  311 #include <stdio.h>
  312 ]], [[printf ("%s", __FUNCTION__);]])],[sn_cv_have___FUNCTION__=yes],[sn_cv__have___FUNCTION__=no])
  313 if test "x$sn_cv_have___FUNCTION__" = "xyes"; then
  314    AC_MSG_RESULT(yes)
  315    AC_DEFINE([HAVE___FUNCTION__],[1],[Define if the compiler understands __FUNCTION__.])
  316 else
  317    AC_MSG_RESULT(no)
  318    AC_MSG_CHECKING(for __func__)
  319    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  320 #include <stdio.h>
  321 ]], [[printf ("%s", __func__);]])],[sn_cv_have___func__=yes],[sn_cv__have___func__=no])
  322    if test "x$sn_cv_have___func__" = "xyes"; then
  323       AC_MSG_RESULT(yes)
  324       AC_DEFINE([HAVE___func__],[1],[Define if the compiler understands __func__.])
  325       AC_DEFINE([__FUNCTION__],[__func__],[Define __FUNCTION__ as required.])
  326    else
  327       AC_MSG_RESULT(no)
  328       AC_DEFINE([__FUNCTION__],["mystery function"])
  329    fi
  330 fi
  331 
  332 AC_ARG_WITH(libpcap_includes,
  333 	[  --with-libpcap-includes=DIR    libpcap include directory],
  334 	[with_libpcap_includes="$withval"],[with_libpcap_includes="no"])
  335 
  336 AC_ARG_WITH(libpcap_libraries,
  337 	[  --with-libpcap-libraries=DIR   libpcap library directory],
  338 	[with_libpcap_libraries="$withval"],[with_libpcap_libraries="no"])
  339 
  340 
  341 if test "x$with_libpcap_includes" != "xno"; then
  342    CPPFLAGS="${CPPFLAGS} -I${with_libpcap_includes}"
  343 fi
  344 
  345 if test "x$with_libpcap_libraries" != "xno"; then
  346    LDFLAGS="${LDFLAGS} -L${with_libpcap_libraries}"
  347 fi
  348 
  349 # --with-libpfring-* options
  350 AC_ARG_WITH(libpfring_includes,
  351        [  --with-libpfring-includes=DIR  libpfring include directory],
  352        [with_libpfring_includes="$withval"],[with_libpfring_includes="no"])
  353 
  354 AC_ARG_WITH(libpfring_libraries,
  355        [  --with-libpfring-libraries=DIR libpfring library directory],
  356        [with_libpfring_libraries="$withval"],[with_libpfring_libraries="no"])
  357 
  358 if test "x$with_libpfring_includes" != "xno"; then
  359    CPPFLAGS="${CPPFLAGS} -I${with_libpfring_includes}"
  360 fi
  361 
  362 if test "x$with_libpfring_libraries" != "xno"; then
  363    LDFLAGS="${LDFLAGS} -L${with_libpfring_libraries}"
  364 fi
  365 
  366 AC_ARG_WITH(daq_includes,
  367 	[  --with-daq-includes=DIR        DAQ include directory],
  368 	[with_daq_includes="$withval"],[with_daq_includes="no"])
  369 
  370 AC_ARG_WITH(daq_libraries,
  371 	[  --with-daq-libraries=DIR       DAQ library directory],
  372 	[with_daq_libraries="$withval"],[with_daq_libraries="no"])
  373 
  374 if test "x$with_daq_includes" != "xno"; then
  375    CPPFLAGS="${CPPFLAGS} -I${with_daq_includes}"
  376 fi
  377 
  378 if test "x$with_daq_libraries" != "xno"; then
  379    LDFLAGS="${LDFLAGS} -L${with_daq_libraries}"
  380 fi
  381 
  382 if test "x$enable_control_socket" = "xyes"; then
  383     LSFBPF=""
  384     AC_CHECK_LIB([sfbpf], [sfbpf_compile],
  385         [LIBS="${LIBS} -lsfbpf"], [LSFBPF="no"], [ ])
  386 
  387     if test "x$LSFBPF" = "xno"; then
  388         echo
  389         echo "   ERROR!  sfbpf library not found, go get it from"
  390         echo "   http://www.snort.org/."
  391         #AC_MSG_ERROR("Fatal!")
  392         exit 1
  393     fi
  394 fi
  395 
  396 LPCAP=""
  397 AC_CHECK_LIB(pcap, pcap_datalink,, LPCAP="no")
  398 
  399 # If the normal AC_CHECK_LIB for pcap fails then check to see if we are
  400 # using a pfring-enabled pcap.
  401 if test "x$LPCAP" = "xno"; then
  402   PFRING_H=""
  403   AC_CHECK_HEADERS(pfring.h,, PFRING_H="no")
  404 
  405 # It is important to have the AC_CHECK_LIB for the pfring library BEFORE
  406 # the one for pfring-enabled pcap. When the Makefile is created, all the
  407 # libraries used during linking are added to the LIBS variable in the
  408 # Makefile in the opposite order that their AC_CHECK_LIB macros appear
  409 # in configure.in. Durring linking, the pfring library (-lpfring) MUST come
  410 # _after_ the libpcap library (-lpcap) or linking will fail.
  411   PFRING_L=""
  412   AC_CHECK_LIB(pfring, pfring_open,, PFRING_L="no")
  413 
  414   LPFRING_PCAP=""
  415   AC_CHECK_LIB(pcap, pfring_open,, LPFRING_PCAP="no",-lpfring)
  416 fi
  417 
  418 # If both the AC_CHECK_LIB for normal pcap and pfring-enabled pcap fail then exit.
  419 if test "x$LPCAP" = "xno"; then
  420   if test "x$LPFRING_PCAP" = "xno"; then
  421     echo
  422     echo "   ERROR!  Libpcap library/headers (libpcap.a (or .so)/pcap.h)"
  423     echo "   not found, go get it from http://www.tcpdump.org"
  424     echo "   or use the --with-libpcap-* options, if you have it installed"
  425     echo "   in unusual place.  Also check if your libpcap depends on another"
  426     echo "   shared library that may be installed in an unusual place"
  427     exit 1
  428   fi
  429 fi
  430 
  431 AC_MSG_CHECKING([for pcap_lex_destroy])
  432 AC_RUN_IFELSE(
  433 [AC_LANG_PROGRAM(
  434 [[
  435 #include <pcap.h>
  436 ]],
  437 [[
  438    pcap_lex_destroy();
  439 ]])],
  440 [have_pcap_lex_destroy="yes"],
  441 [have_pcap_lex_destroy="no"])
  442 AC_MSG_RESULT($have_pcap_lex_destroy)
  443 if test "x$have_pcap_lex_destroy" = "xyes"; then
  444     AC_DEFINE([HAVE_PCAP_LEX_DESTROY],[1],[Can cleanup lex buffer stack created by pcap bpf filter])
  445 fi
  446 
  447 AC_MSG_CHECKING([for pcap_lib_version])
  448 AC_LINK_IFELSE(
  449     [AC_LANG_PROGRAM(
  450         [[#include <pcap.h>]],
  451         [[pcap_lib_version();]]
  452     )],
  453     [have_pcap_lib_version="yes"],
  454     [have_pcap_lib_version="no"]
  455 )
  456 AC_MSG_RESULT($have_pcap_lib_version)
  457 
  458 if test "x$have_pcap_lib_version" = "xyes"; then
  459     AC_DEFINE([HAVE_PCAP_LIB_VERSION],[1],
  460         [Can output the library version.])
  461 fi
  462 
  463 AC_DEFUN([FAIL_MESSAGE],[
  464    echo
  465    echo
  466    echo "**********************************************"
  467    echo "  ERROR: unable to find" $1
  468    echo "  checked in the following places"
  469    for i in `echo $2`; do
  470      echo "        $i"
  471    done
  472    echo "**********************************************"
  473    echo
  474    exit 1
  475 ])
  476 
  477 AC_ARG_WITH(libpcre_includes,
  478        [  --with-libpcre-includes=DIR    libpcre include directory],
  479        [with_libpcre_includes="$withval"],[with_libpcre_includes="no"])
  480 
  481 AC_ARG_WITH(libpcre_libraries,
  482        [  --with-libpcre-libraries=DIR   libpcre library directory],
  483        [with_libpcre_libraries="$withval"],[with_libpcre_libraries="no"])
  484 
  485 if test "x$with_libpcre_includes" != "xno"; then
  486     CPPFLAGS="${CPPFLAGS} -I${with_libpcre_includes}"
  487     ICONFIGFLAGS="${ICONFIGFLAGS} -I${with_libpcre_includes}"
  488 else
  489     CPPFLAGS="${CPPFLAGS} `pcre-config --cflags`"
  490 fi
  491 
  492 if test "x$with_libpcre_libraries" != "xno"; then
  493     LDFLAGS="${LDFLAGS}  -L${with_libpcre_libraries}"
  494 else
  495     LDFLAGS="${LDFLAGS} `pcre-config --libs`"
  496 fi
  497 
  498 # PCRE configuration (required)
  499 # Verify that we have the headers
  500 PCRE_H=""
  501 AC_CHECK_HEADERS(pcre.h,, PCRE_H="no")
  502 if test "x$PCRE_H" = "xno"; then
  503   echo
  504   echo "   ERROR!  Libpcre header not found."
  505   echo "   Get it from http://www.pcre.org"
  506   exit 1
  507 fi
  508 
  509 # Verify that we have the library
  510 PCRE_L=""
  511 pcre_version_six=""
  512 AC_CHECK_LIB(pcre, pcre_compile, ,PCRE_L="no")
  513 if test "x$PCRE_L" = "xno"; then
  514     echo
  515     echo "   ERROR!  Libpcre library not found."
  516     echo "   Get it from http://www.pcre.org"
  517     echo
  518     exit 1
  519 else
  520     AC_MSG_CHECKING(for libpcre version 6.0 or greater)
  521     AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pcre.h>]], [[
  522        #if (PCRE_MAJOR < 6)
  523        #error "Version failure"
  524        #else
  525        int a, b = 0, c = 0, d = 0;
  526        pcre *tmp = NULL;
  527        a = pcre_copy_named_substring(tmp, "", &b, c, "", "", d);
  528        #endif
  529       ]])],[pcre_version_six="yes"],[pcre_version_six="no"])
  530 fi
  531 
  532 if test "x$pcre_version_six" != "xyes"; then
  533     AC_MSG_RESULT(no)
  534     echo
  535     echo "    ERROR!  Libpcre library version >= 6.0 not found."
  536     echo "    Get it from http://www.pcre.org"
  537     echo
  538     exit 1
  539 else
  540     AC_MSG_RESULT(yes)
  541 fi
  542 
  543 # OPENSSL SHA configuration (optional)
  544 AC_ARG_WITH(openssl_includes,
  545        [  --with-openssl-includes=DIR    openssl include directory],
  546        [with_openssl_includes="$withval"],[with_openssl_includes="no"])
  547 
  548 AC_ARG_WITH(openssl_libraries,
  549        [  --with-openssl-libraries=DIR   openssl library directory],
  550        [with_openssl_libraries="$withval"],[with_openssl_libraries="no"])
  551 
  552 if test "x$with_openssl_includes" != "xno"; then
  553     CPPFLAGS="${CPPFLAGS} -I${with_openssl_includes}"
  554     ICONFIGFLAGS="${ICONFIGFLAGS} -I${with_openssl_includes}"
  555 fi
  556 
  557 if test "x$with_openssl_libraries" != "xno"; then
  558     LDFLAGS="${LDFLAGS}  -L${with_openssl_libraries}"
  559 fi
  560 # Verify that we have the headers
  561 AC_CHECK_LIB([crypto],[SHA256_Init],AC_DEFINE([HAVE_OPENSSL_SHA],[1],openssl SHA available),)
  562 AC_CHECK_LIB([crypto],[MD5_Init],AC_DEFINE([HAVE_OPENSSL_MD5],[1],openssl MD5 available),)
  563 AM_CONDITIONAL([BUILD_OPENSSL_MD5], test "$ac_cv_lib_crypto_MD5_Init" != "yes" )
  564 AM_CONDITIONAL([BUILD_OPENSSL_SHA], test "$ac_cv_lib_crypto_SHA256_Init" != "yes" )
  565 if test "$ac_cv_lib_crypto_MD5_Init" = "yes"; then
  566     LIBS="${LIBS} -lcrypto"
  567 fi
  568 
  569 AC_ARG_VAR(SIGNAL_SNORT_RELOAD, set the SIGNAL_SNORT_RELOAD value)
  570 if test "x$SIGNAL_SNORT_RELOAD" != "x" ; then
  571    AC_DEFINE_UNQUOTED([SIGNAL_SNORT_RELOAD], [$SIGNAL_SNORT_RELOAD], [Set by user])
  572 fi
  573 
  574 AC_ARG_VAR(SIGNAL_SNORT_DUMP_STATS, set the SIGNAL_SNORT_DUMP_STATS value)
  575 if test "x$SIGNAL_SNORT_DUMP_STATS" != "x" ; then
  576    AC_DEFINE_UNQUOTED([SIGNAL_SNORT_DUMP_STATS], [$SIGNAL_SNORT_DUMP_STATS], [Set by user])
  577 fi
  578 
  579 AC_ARG_VAR(SIGNAL_SNORT_ROTATE_STATS, set the SIGNAL_SNORT_ROTATE_STATS value)
  580 if test "x$SIGNAL_SNORT_ROTATE_STATS" != "x" ; then
  581    AC_DEFINE_UNQUOTED([SIGNAL_SNORT_ROTATE_STATS], [$SIGNAL_SNORT_ROTATE_STATS], [Set by user])
  582 fi
  583 
  584 AC_ARG_VAR(SIGNAL_SNORT_READ_ATTR_TBL, set the SIGNAL_SNORT_READ_ATTR_TBL value)
  585 if test "x$SIGNAL_SNORT_READ_ATTR_TBL" != "x" ; then
  586    AC_DEFINE_UNQUOTED([SIGNAL_SNORT_READ_ATTR_TBL], [$SIGNAL_SNORT_READ_ATTR_TBL], [Set by user])
  587 fi
  588 
  589 AC_ARG_ENABLE(so_with_static_lib,
  590 [  --enable-so-with-static-lib  Enable linking of dynamically loaded preprocessors with a static preprocessor library],
  591        enable_so_with_static_lib="$enableval", enable_so_with_static_lib=$so_with_static_lib)
  592 AM_CONDITIONAL(SO_WITH_STATIC_LIB, test "x$enable_so_with_static_lib" = "xyes")
  593 
  594 AC_ARG_ENABLE(control_socket,
  595 [  --enable-control-socket  Enable the control socket],
  596        enable_control_socket="$enableval", enable_control_socket="no")
  597 os=`(uname -s)`
  598 if test "x$linux" != "xyes"; then
  599     if test "$OSTYPE" != "FreeBSD" && "$os" != "FreeBSD"; then
  600           if test "x$enable_control_socket" = "xyes"; then
  601              AC_MSG_WARN([[The control socket is only supported on Linux or FreeBSD systems.]])
  602              enable_control_socket="no"
  603           fi
  604      fi
  605 fi
  606 AM_CONDITIONAL(BUILD_CONTROL_SOCKET, test "x$enable_control_socket" = "xyes")
  607 if test "x$enable_control_socket" = "xyes"; then
  608     CONFIGFLAGS="$CONFIGFLAGS -DCONTROL_SOCKET"
  609 fi
  610 
  611 AC_ARG_ENABLE(side_channel,
  612 [  --enable-side-channel    Enable the side channel (Experimental)],
  613        enable_side_channel="$enableval", enable_side_channel="no")
  614 if test "x$linux" != "xyes"; then
  615     if test "$OSTYPE" != "FreeBSD" && "$os" != "FreeBSD"; then
  616        if test "x$enable_side_channel" = "xyes"; then
  617            AC_MSG_WARN([[The side channel is only supported on Linux or FreeBSD systems.]])
  618            enable_side_channel="no"
  619        fi
  620     fi
  621 fi
  622 AM_CONDITIONAL(BUILD_SIDE_CHANNEL, test "x$enable_side_channel" = "xyes")
  623 if test "x$enable_side_channel" = "xyes"; then
  624     CONFIGFLAGS="$CONFIGFLAGS -DSIDE_CHANNEL"
  625 fi
  626 
  627 # check for dnet first since some DAQs need it
  628 AC_ARG_WITH(dnet_includes,
  629     [  --with-dnet-includes=DIR       libdnet include directory],
  630     [with_dnet_includes="$withval"],[with_dnet_includes="no"])
  631 
  632 AC_ARG_WITH(dnet_libraries,
  633     [  --with-dnet-libraries=DIR      libdnet library directory],
  634     [with_dnet_libraries="$withval"],[with_dnet_libraries="no"])
  635 
  636 if test "x$with_dnet_includes" != "xno"; then
  637     CPPFLAGS="${CPPFLAGS} -I${with_dnet_includes}"
  638     ICONFIGFLAGS="${ICONFIGFLAGS} -I${with_dnet_includes}"
  639 else
  640     CPPFLAGS="${CPPFLAGS} `dnet-config --cflags 2>/dev/null`"
  641 fi
  642 
  643 if test "x$with_dnet_libraries" != "xno"; then
  644     LDFLAGS="${LDFLAGS} -L${with_dnet_libraries}"
  645 else
  646     LDFLAGS="${LDFLAGS} `dnet-config --libs 2>/dev/null`"
  647 fi
  648 
  649 AC_CHECK_HEADERS(dnet.h,,DNET_H="no")
  650 AC_CHECK_HEADERS(dumbnet.h,,DUMBNET_H="no")
  651 
  652 if test "x$DNET_H" = "xno" -a "x$DUMBNET_H" = "xno"; then
  653     echo
  654     echo "   ERROR!  dnet header not found, go get it from"
  655     echo "   http://code.google.com/p/libdnet/ or use the --with-dnet-*"
  656     echo "   options, if you have it installed in an unusual place"
  657     exit
  658 fi
  659 
  660 AC_CHECK_LIB(dnet, eth_set,,[DNET="no"])
  661 AC_CHECK_LIB(dumbnet, eth_set,,[DUMBNET="no"])
  662 
  663 if test "x$DNET" = "xno" -a "x$DUMBNET" = "xno"; then
  664     echo
  665     echo "   ERROR!  dnet library not found, go get it from"
  666     echo "   http://code.google.com/p/libdnet/ or use the --with-dnet-*"
  667     echo "   options, if you have it installed in an unusual place"
  668     exit
  669 fi
  670 
  671 AC_ARG_ENABLE(static_daq,
  672 [  --disable-static-daq     Link static DAQ modules.],
  673        enable_static_daq="$enableval", enable_static_daq="yes")
  674 
  675 AC_CHECK_LIB(dl, dlsym, DLLIB="yes", DLLIB="no")
  676 
  677 if test "$DLLIB" != "no"; then
  678     LIBS="${LIBS} -ldl"
  679 else
  680     AC_CHECK_LIB(c, dlsym, DLLIB="yes", DLLIB="no")
  681     if test "$DLLIB" = "no"; then
  682        echo
  683        echo "   ERROR!  programmatic interface to dynamic link loader"
  684        echo "   not found.  Cannot build Snort."
  685        echo
  686        exit 1
  687     fi
  688 fi
  689 
  690 if test "x$enable_static_daq" = "xyes"; then
  691     LDAQ=""
  692     LIBS="${LIBS} `daq-modules-config --static --libs`"
  693     AC_CHECK_LIB([daq_static], [daq_load_modules],
  694         [LIBS="-ldaq_static ${LIBS}"], [LDAQ="no"], [ ])
  695 
  696     if test "x$LDAQ" = "xno"; then
  697         echo
  698         echo "   ERROR!  daq_static library not found, go get it from"
  699         echo "   http://www.snort.org/."
  700         #AC_MSG_ERROR("Fatal!")  # FIXTHIS switch over to this macro
  701         exit 1                   # instead of raw exits!
  702     fi
  703 else
  704     LDAQ=""
  705     AC_CHECK_LIB([daq], [daq_load_modules],
  706         [LIBS="${LIBS} -ldaq"], [LDAQ="no"], [ ])
  707 
  708     if test "x$LDAQ" = "xno"; then
  709         echo
  710         echo "   ERROR!  daq library not found, go get it from"
  711         echo "   http://www.snort.org/."
  712         #AC_MSG_ERROR("Fatal!")
  713         exit 1
  714     fi
  715 fi
  716 
  717 AC_CHECK_FUNCS([daq_hup_apply] [daq_acquire_with_meta] [daq_dp_add_dc])
  718 
  719 AC_MSG_CHECKING([for daq real addresses])
  720 AC_RUN_IFELSE(
  721 [AC_LANG_PROGRAM(
  722 [[
  723 #include <daq.h>
  724 ]],
  725 [[
  726    DAQ_PktHdr_t hdr;
  727    hdr.n_real_dPort = 0;
  728 ]])],
  729 [have_daq_real_addresses="yes"],
  730 [have_daq_real_addresses="no"])
  731 AC_MSG_RESULT($have_daq_real_addresses)
  732 if test "x$have_daq_real_addresses" = "xyes"; then
  733     AC_DEFINE([HAVE_DAQ_REAL_ADDRESSES],[1],
  734         [DAQ version supports real addresses in header.])
  735 fi
  736 
  737 AC_CHECK_DECL([DAQ_PKT_FLAG_DECRYPTED_SSL], [have_daq_decrypted_ssl="yes"],
  738 [have_daq_decrypted_ssl="no"], [#include <daq_common.h>])
  739 if test "x$have_daq_decrypted_ssl" = "xyes"; then
  740     AC_DEFINE([HAVE_DAQ_DECRYPTED_SSL],[1],
  741         [DAQ version supports decrypted ssl])
  742 fi
  743 
  744 AC_CHECK_DECL([DAQ_PKT_FLAG_LOCALLY_ORIGINATED],
  745 [have_daq_locally_originated="yes"],
  746 [have_daq_locally_originated="no"], [#include <daq_common.h>])
  747 if test "x$have_daq_locally_originated" = "xyes"; then
  748     AC_DEFINE([HAVE_DAQ_LOCALLY_ORIGINATED],[1],
  749         [DAQ version defines flags for locally originated traffic])
  750 fi
  751 
  752 AC_CHECK_DECL([DAQ_PKT_FLAG_LOCALLY_DESTINED],
  753 [have_daq_locally_destined="yes"],
  754 [have_daq_locally_destined="no"], [#include <daq_common.h>])
  755 if test "x$have_daq_locally_destined" = "xyes"; then
  756     AC_DEFINE([HAVE_DAQ_LOCALLY_DESTINED],[1],
  757         [DAQ version defines flags for locally destined traffic])
  758 fi
  759 
  760 if test "x$ac_cv_func_daq_dp_add_dc" = "xyes"; then
  761 
  762     AC_CHECK_MEMBER([struct _DAQ_DP_key_t.sa.src_ip4],[],[DAQ_C99_STRUCT="no"],[#include <daq_common.h>])
  763     
  764     if test "x$DAQ_C99_STRUCT" = "xno" ; then
  765         echo
  766         echo "   ERROR!  daq library missing C99 patch, upgrade to >=2.0.4, go get it from"
  767         echo "   http://www.snort.org/."
  768         exit 1
  769     fi
  770 
  771 fi
  772 
  773 AC_MSG_CHECKING([for daq address space ID])
  774 AC_RUN_IFELSE(
  775 [AC_LANG_PROGRAM(
  776 [[
  777 #include <daq.h>
  778 ]],
  779 [[
  780    DAQ_PktHdr_t hdr;
  781    hdr.address_space_id = 0;
  782 ]])],
  783 [have_daq_address_space_id="yes"],
  784 [have_daq_address_space_id="no"])
  785 AC_MSG_RESULT($have_daq_address_space_id)
  786 if test "x$have_daq_address_space_id" = "xyes"; then
  787     AC_DEFINE([HAVE_DAQ_ADDRESS_SPACE_ID],[1],
  788         [DAQ version supports address space ID in header.])
  789 fi
  790 
  791 AC_MSG_CHECKING([for daq flow ID])
  792 AC_RUN_IFELSE(
  793 [AC_LANG_PROGRAM(
  794 [[
  795 #include <daq.h>
  796 ]],
  797 [[
  798    DAQ_PktHdr_t hdr;
  799    hdr.flow_id = 0;
  800 ]])],
  801 [have_daq_flow_id="yes"],
  802 [have_daq_flow_id="no"])
  803 AC_MSG_RESULT($have_daq_flow_id)
  804 if test "x$have_daq_flow_id" = "xyes"; then
  805     AC_DEFINE([HAVE_DAQ_FLOW_ID],[1],
  806         [DAQ version supports flow ID in header.])
  807 fi
  808 
  809 AC_MSG_CHECKING([for daq extended flow modifiers])
  810 AC_RUN_IFELSE(
  811 [AC_LANG_PROGRAM(
  812 [[
  813 #include <daq.h>
  814 ]],
  815 [[
  816    DAQ_ModFlow_t mod;
  817    mod.type = 0;
  818    mod.length = 0;
  819    mod.value = NULL;
  820 ]])],
  821 [have_daq_ext_modflow="yes"],
  822 [have_daq_ext_modflow="no"])
  823 AC_MSG_RESULT($have_daq_ext_modflow)
  824 if test "x$have_daq_ext_modflow" = "xyes"; then
  825     CCONFIGFLAGS="${CCONFIGFLAGS} -DHAVE_DAQ_EXT_MODFLOW"
  826     AC_DEFINE([HAVE_DAQ_EXT_MODFLOW],[1],
  827         [DAQ version supports extended flow modifiers.])
  828 fi
  829 
  830 AC_MSG_CHECKING([for daq query flow])
  831 AC_RUN_IFELSE(
  832 [AC_LANG_PROGRAM(
  833 [[
  834 #include <daq.h>
  835 ]],
  836 [[
  837    DAQ_QueryFlow_t mod;
  838    mod.type = 0;
  839    mod.length = 0;
  840    mod.value = NULL;
  841 ]])],
  842 [have_daq_queryflow="yes"],
  843 [have_daq_queryflow="no"])
  844 AC_MSG_RESULT($have_daq_queryflow)
  845 if test "x$have_daq_queryflow" = "xyes"; then
  846     CCONFIGFLAGS="${CCONFIGFLAGS} -DHAVE_DAQ_QUERYFLOW"
  847     AC_DEFINE([HAVE_DAQ_QUERYFLOW],[1],
  848         [DAQ version supports query flow.])
  849 fi
  850 
  851 AC_MSG_CHECKING([for daq data channel flags])
  852 AC_RUN_IFELSE(
  853 [AC_LANG_PROGRAM(
  854 [[
  855 #include <daq.h>
  856 ]],
  857 [[
  858    DAQ_Data_Channel_Params_t params;
  859 ]])],
  860 [have_daq_data_channel_flags="yes"],
  861 [have_daq_data_channel_flags="no"])
  862 AC_MSG_RESULT($have_daq_data_channel_flags)
  863 if test "x$have_daq_data_channel_flags" = "xyes"; then
  864     CCONFIGFLAGS="${CCONFIGFLAGS} -DHAVE_DAQ_DATA_CHANNEL_PARAMS"
  865     AC_DEFINE([HAVE_DAQ_DATA_CHANNEL_PARAMS],[1],
  866         [DAQ version supports data channel.])
  867 fi
  868 
  869 AC_MSG_CHECKING([for separate IP versions on pinhole endpoints])
  870 AC_RUN_IFELSE(
  871 [AC_LANG_PROGRAM(
  872 [[
  873 #include <daq.h>
  874 ]],
  875 [[
  876    DAQ_DP_key_t dpKey;
  877    dpKey.src_af = 0;
  878 ]])],
  879 [have_daq_data_channel_separate_ip_versions="yes"],
  880 [have_daq_data_channel_separate_ip_versions="no"])
  881 AC_MSG_RESULT($have_daq_data_channel_separate_ip_versions)
  882 if test "x$have_daq_data_channel_separate_ip_versions" = "xyes"; then
  883     CCONFIGFLAGS="${CCONFIGFLAGS} -DHAVE_DAQ_DATA_CHANNEL_SEPARATE_IP_VERSIONS"
  884     AC_DEFINE([HAVE_DAQ_DATA_CHANNEL_SEPARATE_IP_VERSIONS],[1],
  885         [DAQ version supports separate IP versions on pinhole endpoints.])
  886 fi
  887 
  888 AC_MSG_CHECKING([for DAQ_VERDICT_RETRY])
  889 AC_RUN_IFELSE(
  890 [AC_LANG_PROGRAM(
  891 [[
  892 #include <daq.h>
  893 ]],
  894 [[
  895    DAQ_Verdict verdict;
  896    verdict = DAQ_VERDICT_RETRY;
  897 ]])],
  898 [have_daq_verdict_retry="yes"],
  899 [have_daq_verdict_retry="no"])
  900 AC_MSG_RESULT($have_daq_verdict_retry)
  901 if test "x$have_daq_verdict_retry" = "xyes"; then
  902     AC_DEFINE([HAVE_DAQ_VERDICT_RETRY],[1],
  903         [DAQ version supports DAQ_VERDICT_RETRY in DAQ_Verdict.])
  904 fi
  905 
  906 AC_MSG_CHECKING([for daq packet trace])
  907 AC_RUN_IFELSE(
  908 [AC_LANG_PROGRAM(
  909 [[
  910 #include <daq.h>
  911 ]],
  912 [[
  913    DAQ_PktHdr_t hdr;
  914    hdr.flags = DAQ_PKT_FLAG_TRACE_ENABLED;
  915 ]])],
  916 [have_daq_packet_trace="yes"],
  917 [have_daq_packet_trace="no"])
  918 AC_MSG_RESULT($have_daq_packet_trace)
  919 if test "x$have_daq_packet_trace" = "xyes"; then
  920     AC_DEFINE([HAVE_DAQ_PKT_TRACE],[1],
  921         [DAQ version supports packet trace.])
  922 else
  923     echo "DAQ version doesn't support packet trace."
  924 fi
  925 
  926 AC_MSG_CHECKING([for daq verdict reason])
  927 AC_RUN_IFELSE(
  928 [AC_LANG_PROGRAM(
  929 [[
  930 #include <daq.h>
  931 ]],
  932 [[
  933    DAQ_ModFlow_t fl;
  934    fl.type = DAQ_MODFLOW_TYPE_VER_REASON;
  935 ]])],
  936 [have_daq_verdict_reason="yes"],
  937 [have_daq_verdict_reason="no"])
  938 AC_MSG_RESULT($have_daq_verdict_reason)
  939 if test "x$have_daq_verdict_reason" = "xyes"; then
  940     AC_DEFINE([HAVE_DAQ_VERDICT_REASON],[1],
  941         [DAQ version supports tracing verdict reason.])
  942 else
  943     echo "DAQ version doesn't support tracing verdict reason."
  944 fi
  945 
  946 # any sparc platform has to have this one defined.
  947 AC_MSG_CHECKING(for sparc)
  948 if eval "echo $host_cpu|grep -i sparc >/dev/null"; then
  949     AC_DEFINE([WORDS_MUSTALIGN],[1],[Define if words must align])
  950     AC_MSG_RESULT(yes)
  951 
  952     # gcc, sparc and optimization not so good
  953     if test -n "$GCC"; then
  954         NO_OPTIMIZE="yes"
  955     fi
  956 else
  957     AC_MSG_RESULT(no)
  958 fi
  959 
  960 # check for sparc %time register
  961 if eval "echo $host_cpu|grep -i sparc >/dev/null"; then
  962     OLD_CFLAGS="$CFLAGS"
  963     CFLAGS="$CFLAGS -mcpu=v9 "
  964     AC_MSG_CHECKING([for sparc %time register])
  965     AC_RUN_IFELSE(
  966     [AC_LANG_PROGRAM(
  967     [[]],
  968     [[
  969         int val;
  970         __asm__ __volatile__("rd %%tick, %0" : "=r"(val));
  971     ]])],
  972     [sparcv9="yes"],
  973     [sparcv9="no"])
  974     AC_MSG_RESULT($sparcv9)
  975     if test "x$sparcv9" = "xyes"; then
  976         AC_DEFINE([SPARCV9],[1],[For sparc v9 with %time register])
  977     else
  978         CFLAGS="$OLD_CFLAGS"
  979     fi
  980 fi
  981 
  982 # modified from gnulib/m4/visibility.m4
  983 AC_DEFUN([CC_VISIBILITY],
  984 [
  985     AC_REQUIRE([AC_PROG_CC])
  986     AC_MSG_CHECKING([for visibility support])
  987     AC_CACHE_VAL(gl_cv_cc_visibility, [
  988         gl_save_CFLAGS="$CFLAGS"
  989         # Add -Werror flag since some compilers, e.g. icc 7.1, don't support it,
  990         # but only warn about it instead of compilation failing
  991         CFLAGS="$CFLAGS -Werror -fvisibility=hidden"
  992         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  993             extern __attribute__((__visibility__("hidden"))) int hiddenvar;
  994             extern __attribute__((__visibility__("default"))) int exportedvar;
  995             extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
  996             extern __attribute__((__visibility__("default"))) int exportedfunc (void);]],
  997             [[]])],
  998             [gl_cv_cc_visibility="yes"],
  999             [gl_cv_cc_visibility="no"])
 1000     ])
 1001     AC_MSG_RESULT([$gl_cv_cc_visibility])
 1002     CFLAGS="$gl_save_CFLAGS"
 1003     if test "x$gl_cv_cc_visibility" = "xyes"; then
 1004         CFLAGS="${CFLAGS} -DSF_VISIBILITY -fvisibility=hidden"
 1005         AC_DEFINE([HAVE_VISIBILITY],[1],
 1006             [Define if the compiler supports visibility declarations.])
 1007     fi
 1008 ])
 1009 CC_VISIBILITY()
 1010 
 1011 AC_ARG_ENABLE(build-dynamic-examples,
 1012 [  --enable-build-dynamic-examples   Enable building of example dynamically loaded preprocessor and rule (off by default)],
 1013        build_dynamic_examples="$enableval", build_dynamic_examples="no")
 1014 AM_CONDITIONAL(BUILD_DYNAMIC_EXAMPLES, test "x$build_dynamic_examples" = "xyes")
 1015 
 1016 AC_ARG_ENABLE(dlclose,
 1017 [  --disable-dlclose        Only use if you are developing dynamic preprocessors or shared object rules.  Disable (--disable-dlclose) for testing valgrind leaks in dynamic libraries so a usable backtrace is reported.  Enabled by default.],
 1018        enable_dlclose="$enableval", enable_dlclose="yes")
 1019 if test "x$enable_dlclose" = "xno"; then
 1020     AC_DEFINE([DISABLE_DLCLOSE_FOR_VALGRIND_TESTING],[1],[Don't close opened shared objects for valgrind leak testing of dynamic libraries])
 1021 fi
 1022 
 1023 ##################################################
 1024 # Fedora 28+ does not have inbuilt SunRPC support#
 1025 # in glibc and is separately availble in tirpc   #
 1026 # package. Make sure we've got the library and   #
 1027 # link it                                        #
 1028 ##################################################
 1029 
 1030 if test -f /etc/fedora-release ; then
 1031     DISTRO_VERSION=$(awk '{ print $3 }' /etc/fedora-release)
 1032     if test $DISTRO_VERSION -ge 28 ; then
 1033         TIRPC=""
 1034         AC_CHECK_LIB(tirpc,bindresvport,, TIRPC="no")
 1035         echo "$TIRPC"
 1036         if test "x$TIRPC" = "xno"; then
 1037             echo
 1038             echo " ERROR! tirpc not found, get it by running "
 1039             echo " yum install libtirpc-devel "
 1040             exit
 1041         fi
 1042         LIBS="${LIBS} -ltirpc"
 1043         extra_incl="-I/usr/include/tirpc"
 1044     fi
 1045 fi
 1046 
 1047 Z_LIB=""
 1048 AC_CHECK_HEADERS(zlib.h,, Z_LIB="no")
 1049 if test "x$Z_LIB" = "xno"; then
 1050     echo
 1051     echo "   ERROR!  zlib header not found, go get it from"
 1052     echo "   http://www.zlib.net"
 1053     exit
 1054 fi
 1055 
 1056 Z_LIB=""
 1057 AC_CHECK_LIB(z, inflate,, Z_LIB="no")
 1058 if test "x$Z_LIB" = "xno"; then
 1059     echo
 1060     echo "   ERROR!  zlib library not found, go get it from"
 1061     echo "   http://www.zlib.net"
 1062      exit
 1063  fi
 1064 LIBS="$LIBS -lz"
 1065 
 1066 AC_ARG_ENABLE(lzma,
 1067 [  --disable-lzma           Disable LZMA Decompression],
 1068        enable_lzma="$enableval", enable_lzma="yes")
 1069 
 1070 AC_ARG_WITH(lzma_includes,
 1071     [  --with-lzma-includes=DIR       liblzma include directory],
 1072     [with_lzma_includes="$withval"],[with_lzma_includes="no"])
 1073 
 1074 AC_ARG_WITH(lzma_libraries,
 1075     [  --with-lzma-libraries=DIR      liblzma library directory],
 1076     [with_lzma_libraries="$withval"],[with_lzma_libraries="no"])
 1077 
 1078 AM_CONDITIONAL(HAVE_LZMA, test "x$enable_lzma" = "xyes")
 1079 if test "x$enable_lzma" = "xyes"; then
 1080 
 1081     if test "x$with_lzma_includes" != "xno"; then
 1082         CPPFLAGS="${CPPFLAGS} -I${with_lzma_includes}"
 1083         LZMA_HEADERS="yes"
 1084     else
 1085         AC_CHECK_HEADERS(lzma.h, LZMA_HEADERS="yes", LZMA_HEADERS="no")
 1086     fi
 1087 
 1088     if test "x$with_lzma_libraries" != "xno"; then
 1089         LDFLAGS="${LDFLAGS} -L${with_lzma_libraries}"
 1090         LZMA_LIB="yes"
 1091     else
 1092         AC_CHECK_LIB(lzma, lzma_stream_decoder, LZMA_LIB="yes", LZMA_LIB="no")
 1093     fi
 1094 
 1095     if test "x$LZMA_LIB" != "xno"; then
 1096         if test "x$LZMA_HEADERS" != "xno"; then
 1097             CPPFLAGS="$CPPFLAGS -DLZMA"
 1098             LIBS="$LIBS -llzma"
 1099         fi
 1100     fi
 1101 fi
 1102 
 1103 AC_ARG_ENABLE(gre,
 1104 [  --disable-gre            Disable GRE and IP in IP encapsulation support],
 1105        enable_gre="$enableval", enable_gre="yes")
 1106 if test "x$enable_gre" = "xyes"; then
 1107     CPPFLAGS="$CPPFLAGS -DGRE"
 1108 fi
 1109 
 1110 AC_ARG_ENABLE(mpls,
 1111 [  --disable-mpls           Disable MPLS support],
 1112        enable_mpls="$enableval", enable_mpls="yes")
 1113 if test "x$enable_mpls" = "xyes"; then
 1114     CPPFLAGS="$CPPFLAGS -DMPLS"
 1115 fi
 1116 
 1117 AC_ARG_ENABLE(targetbased,
 1118 [  --disable-targetbased    Disable Target-Based Support in Stream, Frag, and Rules (adds pthread support implicitly)],
 1119        enable_targetbased="$enableval", enable_targetbased="yes")
 1120 
 1121 AM_CONDITIONAL(HAVE_TARGET_BASED, test "x$enable_targetbased" = "xyes")
 1122 if test "x$enable_targetbased" = "xyes"; then
 1123     CONFIGFLAGS="$CONFIGFLAGS -DTARGET_BASED"
 1124     LIBS="$LIBS -lpthread"
 1125     if test "$LEX" = "none"; then
 1126       echo
 1127       echo "   ERROR!  flex not found."
 1128       echo "   Get it from http://flex.sourceforge.net/"
 1129       echo "   (You may also try lex instead.)"
 1130       echo
 1131       exit 1
 1132     fi
 1133     if test "$YACC" = "none"; then
 1134       echo
 1135       echo "   ERROR!  bison not found."
 1136       echo "   Get it from http://www.gnu.org/software/bison/"
 1137       echo "   (You may also try byacc or yacc instead.)"
 1138       echo
 1139       exit 1
 1140     fi
 1141 fi
 1142 
 1143 AC_ARG_ENABLE(ppm,
 1144 [  --disable-ppm            Disable packet/rule performance monitor],
 1145        enable_ppm="$enableval", enable_ppm="yes")
 1146 if test "x$enable_ppm" = "xyes"; then
 1147     CPPFLAGS="$CPPFLAGS -DPPM_MGR"
 1148 fi
 1149 
 1150 AC_ARG_ENABLE(perfprofiling,
 1151 [  --disable-perfprofiling  Disable preprocessor and rule performance profiling],
 1152        enable_perfprofiling="$enableval", enable_perfprofiling="yes")
 1153 if test "x$enable_perfprofiling" = "xyes"; then
 1154     CONFIGFLAGS="$CONFIGFLAGS -DPERF_PROFILING"
 1155 fi
 1156 
 1157 AC_ARG_ENABLE(linux-smp-stats,
 1158 [  --enable-linux-smp-stats Enable statistics reporting through proc],
 1159        enable_linux_smp_stats="$enableval", enable_linux_smp_stats="no")
 1160 AM_CONDITIONAL(BUILD_PROCPIDSTATS, test "x$enable_linux_smp_stats" = "xyes")
 1161 if test "x$enable_linux_smp_stats" = "xyes"; then
 1162     CPPFLAGS="$CPPFLAGS -DLINUX_SMP"
 1163 fi
 1164 
 1165 AC_ARG_ENABLE(inline-init-failopen,
 1166 [  --enable-inline-init-failopen  Enable Fail Open during initialization for Inline Mode (adds pthread support implicitly)],
 1167        enable_inline_init_failopen="$enableval", enable_inline_init_failopen="no")
 1168 if test "x$enable_inline_init_failopen" = "xyes"; then
 1169     CPPFLAGS="$CPPFLAGS -DINLINE_FAILOPEN"
 1170     LIBS="$LIBS -lpthread"
 1171 fi
 1172 
 1173 AC_ARG_ENABLE(pthread,
 1174 [  --disable-pthread        Disable pthread support],
 1175        enable_pthread="$enableval", enable_pthread="yes")
 1176 
 1177 if test "x$enable_pthread" = "xyes"; then
 1178     LIBS="$LIBS -lpthread"
 1179     AC_CHECK_FUNCS([pthread_tryjoin_np])
 1180 fi
 1181 
 1182 AC_ARG_ENABLE(debug-msgs,
 1183 [  --enable-debug-msgs      Enable debug printing options (bugreports and developers only)],
 1184        enable_debug_msgs="$enableval", enable_debug_msgs="no")
 1185 if test "x$enable_debug_msgs" = "xyes"; then
 1186     CPPFLAGS="$CPPFLAGS -DDEBUG_MSGS"
 1187 fi
 1188 
 1189 AC_ARG_ENABLE(debug,
 1190 [  --enable-debug           Enable debugging options (bugreports and developers only)],
 1191        enable_debug="$enableval", enable_debug="no")
 1192 
 1193 if test "x$enable_debug" = "xyes"; then
 1194     NO_OPTIMIZE="yes"
 1195 
 1196     # in case user override doesn't include -g
 1197     if echo $CFLAGS | grep -qve -g ; then
 1198         CFLAGS="$CFLAGS -g"
 1199     fi
 1200 
 1201     CPPFLAGS="$CPPFLAGS -DDEBUG"
 1202 else
 1203     # disable assert()ions
 1204     CPPFLAGS="$CPPFLAGS -DNDEBUG"
 1205 fi
 1206 
 1207 AC_ARG_ENABLE(gdb,
 1208 [  --enable-gdb             Enable gdb debugging information],
 1209        enable_gdb="$enableval", enable_gdb="no")
 1210 
 1211 if test "x$enable_gdb" = "xyes"; then
 1212     CFLAGS="$CFLAGS -g -ggdb"
 1213 fi
 1214 
 1215 AC_ARG_ENABLE(profile,
 1216 [  --enable-profile         Enable profiling options (developers only)],
 1217        enable_profile="$enableval", enable_profile="no")
 1218 
 1219 if test "x$enable_profile" = "xyes"; then
 1220     if test -n "$GCC"; then
 1221         CPPFLAGS="$CPPFLAGS -DPROFILE"
 1222         CFLAGS="$CFLAGS -pg"
 1223     else
 1224         CPPFLAGS="$CPPFLAGS -DPROFILE"
 1225     fi
 1226 fi
 1227 
 1228 AC_ARG_ENABLE(test-coverage,
 1229 [  --enable-test-coverage   Enable gcov test coverage tracking (developers only)],
 1230         enable_test_coverage="$enableval", enable_test_coverage="no")
 1231 
 1232 if test "x$enable_test_coverage" = "xyes"; then
 1233     CFLAGS=`echo $CFLAGS | sed 's/-O\d/-O0/g'`
 1234     CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage -O0"
 1235 fi    
 1236 
 1237 AC_ARG_ENABLE(ppm-test,
 1238 [  --disable-ppm-test       Disable packet/rule performance monitor],
 1239        enable_ppm_test="$enableval", enable_ppm_test="no")
 1240 
 1241 if test "x$enable_ppm_test" = "xyes"; then
 1242     CPPFLAGS="$CPPFLAGS -DPPM_TEST"
 1243 fi
 1244 
 1245 AC_ARG_ENABLE(sourcefire,
 1246 [  --enable-sourcefire      Enable Sourcefire specific build options, encompasing --enable-perfprofiling and --enable-ppm],
 1247        enable_sourcefire="$enableval", enable_sourcefire="no")
 1248 
 1249 if test "x$enable_sourcefire" = "xyes"; then
 1250     CPPFLAGS="$CPPFLAGS -DSOURCEFIRE -DPPM_MGR"
 1251     CONFIGFLAGS="$CONFIGFLAGS -DPERF_PROFILING"
 1252 fi
 1253 
 1254 AC_ARG_ENABLE(corefiles,
 1255 [  --disable-corefiles      Prevent Snort from generating core files],
 1256        enable_corefiles="$enableval", enable_corefiles="yes")
 1257 
 1258 if test "x$enable_corefiles" = "xno"; then
 1259     CPPFLAGS="$CPPFLAGS -DNOCOREFILE"
 1260 fi
 1261 
 1262 
 1263 AC_ARG_ENABLE(active-response,
 1264 [  --disable-active-response Disable reject injection],
 1265        enable_active_response="$enableval", enable_active_response="yes")
 1266 
 1267 AC_ARG_ENABLE(normalizer,
 1268 [  --disable-normalizer     Disable packet/stream normalizations],
 1269        enable_normalizer="$enableval", enable_normalizer="yes")
 1270 
 1271 AC_ARG_ENABLE(reload,
 1272 [  --disable-reload         Disable reloading a configuration without restarting],
 1273        enable_reload="$enableval", enable_reload="yes")
 1274 
 1275 AC_ARG_ENABLE(reload-error-restart,
 1276 [  --disable-reload-error-restart   Disable restarting on reload error],
 1277        enable_reload_error_restart="$enableval", enable_reload_error_restart="yes")
 1278 
 1279 AM_CONDITIONAL(BUILD_SNORT_RELOAD, test "x$enable_reload" = "xyes")
 1280 if test "x$enable_reload" = "xyes"; then
 1281     if test "x$enable_reload_error_restart" = "xyes"; then
 1282         CONFIGFLAGS="$CONFIGFLAGS -DSNORT_RELOAD"
 1283     else
 1284         CONFIGFLAGS="$CONFIGFLAGS -DSNORT_RELOAD -DRELOAD_ERROR_FATAL"
 1285     fi
 1286 
 1287     LIBS="$LIBS -lpthread"
 1288 fi
 1289 
 1290 AC_ARG_ENABLE(ha,
 1291 [  --enable-ha              Enable high-availability state sharing (Experimental)],
 1292        enable_ha="$enableval", enable_ha="no")
 1293 
 1294 AM_CONDITIONAL(BUILD_HA, test "x$enable_ha" = "xyes")
 1295 if test "x$enable_ha" = "xyes"; then
 1296     CONFIGFLAGS="$CONFIGFLAGS -DENABLE_HA"
 1297 fi
 1298 
 1299 AC_ARG_ENABLE(buffer-dump,
 1300 [  --enable-buffer-dump    Enable Buffer dump utility to dump packet buffers],
 1301        enable_buffer_dump="$enableval", enable_buffer_dump="no")
 1302 
 1303 AM_CONDITIONAL(BUILD_BUFFER_DUMP, test "x$enable_buffer_dump" = "xyes")
 1304 if test "x$enable_buffer_dump" = "xyes"; then
 1305     CONFIGFLAGS="$CONFIGFLAGS -DDUMP_BUFFER"
 1306 fi
 1307 
 1308 
 1309 # define NO_NON_ETHER_DECODERS by default
 1310 AC_ARG_ENABLE(non-ether-decoders,
 1311 [  --enable-non-ether-decoders  Enable non Ethernet decoders.],
 1312        enable_non_ether_decoders="$enableval", enable_non_ether_decoders="no")
 1313 
 1314 if test "x$enable_non_ether_decoders" = "xno"; then
 1315     CONFIGFLAGS="$CONFIGFLAGS -DNO_NON_ETHER_DECODER"
 1316 fi
 1317 
 1318 AC_ARG_ENABLE(react,
 1319 [  --disable-react          Disable interception and termination of offending HTTP accesses],
 1320        enable_react="$enableval", enable_react="yes")
 1321 
 1322 AC_ARG_ENABLE(flexresp3,
 1323 [  --disable-flexresp3      Disable flexible responses (v3) on hostile connection attempts],
 1324        enable_flexresp3="$enableval", enable_flexresp3="yes")
 1325 
 1326 # test for invalid configurations here after all AC_ARG_ENABLEs
 1327 if test "x$enable_flexresp3" = "xyes"; then
 1328     # flexresp3 options are a union of flexresp (deleted) and flexresp2
 1329     # options so we assume flexresp3 if multiple are enabled.
 1330     if test "x$enable_flexresp2" = "xyes"; then
 1331         echo "WARNING: multiple flexresp versions enabled; using flexresp3."
 1332         enable_flexresp2="no"
 1333     fi
 1334 fi
 1335 
 1336 AM_CONDITIONAL(BUILD_REACT, test "x$enable_react" = "xyes")
 1337 if test "x$enable_react" = "xyes"; then
 1338     CPPFLAGS="${CPPFLAGS} -DENABLE_REACT"
 1339 fi
 1340 
 1341 AM_CONDITIONAL(BUILD_RESPOND3, test "x$enable_flexresp3" = "xyes")
 1342 if test "x$enable_flexresp3" = "xyes"; then
 1343     CPPFLAGS="${CPPFLAGS} -DENABLE_RESPOND -DENABLE_RESPONSE3"
 1344 fi
 1345 
 1346 if test "x$enable_normalizer" = "xyes" \
 1347      -o "x$enable_sourcefire" = "xyes" ; \
 1348 then
 1349     CONFIGFLAGS="${CONFIGFLAGS} -DNORMALIZER"
 1350 fi
 1351 
 1352 if test "x$enable_active_response" = "xyes" \
 1353      -o "x$enable_flexresp3" = "xyes" \
 1354      -o "x$enable_react" = "xyes" \
 1355      -o "x$enable_sourcefire" = "xyes" ; \
 1356 then
 1357     CONFIGFLAGS="${CONFIGFLAGS} -DACTIVE_RESPONSE"
 1358 fi
 1359 
 1360 AC_ARG_ENABLE(intel_soft_cpm,
 1361 [  --enable-intel-soft-cpm  Enable Intel Soft CPM support],
 1362        enable_intel_soft_cpm="$enableval", enable_intel_soft_cpm="no")
 1363 
 1364 AC_ARG_WITH(intel_soft_cpm_includes,
 1365 	[  --with-intel-soft-cpm-includes=DIR      Intel Soft CPM include directory],
 1366 	[with_intel_soft_cpm_includes="$withval"],[with_intel_soft_cpm_includes="no"])
 1367 
 1368 AC_ARG_WITH(intel_soft_cpm_libraries,
 1369 	[  --with-intel-soft-cpm-libraries=DIR     Intel Soft CPM library directory],
 1370 	[with_intel_soft_cpm_libraries="$withval"],[with_intel_soft_cpm_libraries="no"])
 1371 
 1372 if test "x$with_intel_soft_cpm_includes" != "xno"; then
 1373     enable_intel_soft_cpm="yes"
 1374     CPPFLAGS="${CPPFLAGS} -I${with_intel_soft_cpm_includes}"
 1375 fi
 1376 
 1377 if test "x$with_intel_soft_cpm_libraries" != "xno"; then
 1378     enable_intel_soft_cpm="yes"
 1379     LDFLAGS="${LDFLAGS} -L${with_intel_soft_cpm_libraries}"
 1380     LIBS="${LIBS} -lpm"
 1381 fi
 1382 
 1383 AM_CONDITIONAL(HAVE_INTEL_SOFT_CPM, test "x$enable_intel_soft_cpm" = "xyes")
 1384 if test "x$enable_intel_soft_cpm" = "xyes"; then
 1385     CPPFLAGS="${CPPFLAGS} -DINTEL_SOFT_CPM"
 1386 fi
 1387 
 1388 AC_ARG_ENABLE(shared_rep,
 1389     [  --enable-shared-rep      Enable use of Shared Memory for Reputation (Linux only)],
 1390        enable_shared_rep="$enableval", enable_shared_rep="no")
 1391 
 1392 if test "x$enable_shared_rep" = "xyes"; then
 1393     if test "x$linux" = "xyes"; then
 1394         CPPFLAGS="${CPPFLAGS} -DSHARED_REP"
 1395         LIBS="$LIBS -lrt"
 1396     else
 1397         echo "WARNING: shared reputation is only available on linux."
 1398         enable_shared_rep="no"
 1399     fi
 1400 fi
 1401 
 1402 AM_CONDITIONAL(HAVE_SHARED_REP, test "x$enable_shared_rep" = "xyes")
 1403 
 1404 # Define PKG_CHECK_MODULES if it doesnt already exist.
 1405 #file_ This prevents './configure' from erroring on machines that dont have
 1406 # 'pkgconfig' installed.
 1407 #m4_ifdef([PKG_CHECK_MODULES],[], [m4_define([PKG_CHECK_MODULES],
 1408 #     [echo "PKG_CHECK_MODULES not defined"])])
 1409 
 1410 AC_ARG_ENABLE(large-pcap,
 1411 [  --enable-large-pcap      Enable support for pcaps larger than 2 GB],
 1412       enable_large_pcap="$enableval", enable_large_pcap="no")
 1413 
 1414 if test "x$enable_large_pcap" = "xyes"; then
 1415     CPPFLAGS="${CPPFLAGS} -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
 1416 fi
 1417 
 1418 ###################################################
 1419 ##    [!] File Type Inspection (Experimental)    ##
 1420 ###################################################
 1421 
 1422 AC_ARG_ENABLE([file-inspect],
 1423     [AS_HELP_STRING([--enable-file-inspect],[Build with extended file inspection features. (Experimental)])],
 1424     [enable_file_inspect=$enableval],[enable_file_inspect=no])
 1425 
 1426 AS_IF([test x$enable_file_inspect = xyes],
 1427     [AC_DEFINE([FEAT_FILE_INSPECT],[1],[Build with extended file inspection features. (Experimental)]) ])
 1428 AM_CONDITIONAL([FEAT_FILE_INSPECT],[test x$enable_file_inspect = xyes])
 1429 
 1430 export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
 1431 
 1432 ###### Start OpenAppId
 1433 AC_ARG_ENABLE([open-appid],
 1434     [AS_HELP_STRING([--disable-open-appid],[Disable application identification support.])],
 1435     [enable_open_appid="$enableval"],[enable_open_appid="yes"])
 1436 
 1437 AM_CONDITIONAL([FEAT_OPEN_APPID],[test "x$enable_open_appid" = "xyes"])
 1438 
 1439 if test "x$enable_open_appid" = "xyes"; then
 1440     AC_DEFINE([FEAT_OPEN_APPID],[1],[Build with application identification support.])
 1441     CONFIGFLAGS="$CONFIGFLAGS -DFEAT_OPEN_APPID"
 1442 
 1443     PKG_CHECK_MODULES(luajit, luajit,LLUAJIT="yes",LLUAJIT="no")
 1444     if test "x$LLUAJIT" = "xyes"; then
 1445         CONFIGFLAGS="$CONFIGFLAGS -DHAVE_LIBLUAJIT"
 1446         LUA_CFLAGS="$luajit_CFLAGS"
 1447         LUA_LIBS="$luajit_LIBS"
 1448         AC_SUBST(LUA_CFLAGS)
 1449         AC_SUBST(LUA_LIBS)
 1450         if test "x$macos" != "xno"; then
 1451             LDFLAGS="${LDFLAGS} -pagezero_size 10000 -image_base 100000000"
 1452         fi
 1453 
 1454     else
 1455         echo
 1456         echo "   ERROR!  LuaJIT library not found. Go get it from http://www.luajit.org/ (or)"
 1457         echo "   Try compiling without openAppId using '--disable-open-appid'"
 1458         AC_MSG_ERROR("Fatal!")
 1459     fi
 1460 
 1461     AC_CHECK_HEADER(openssl/x509.h, [AC_CHECK_LIB(crypto, d2i_X509, openssl_x509=yes, openssl_x509=no)],openssl_x509=no)
 1462     if test "x$openssl_x509" = "xno"; then
 1463         echo
 1464         echo "   ERROR!  openssl/x509.h or openssl library not found." 
 1465         echo "   Try compiling without openAppId using '--disable-open-appid'"
 1466         AC_MSG_ERROR("Fatal!")
 1467     fi
 1468 fi
 1469 
 1470 ###### End OpenAppId
 1471 
 1472 #include luajit libs
 1473 
 1474 AC_ARG_WITH(libluajit_includes,
 1475        [  --with-libluajit-includes=DIR    libluajit include directory],
 1476        [with_libluajit_includes="$withval"],[with_libluajit_includes="no"])
 1477 
 1478 AC_ARG_WITH(libluajit_libraries,
 1479        [  --with-libluajit-libraries=DIR   libluajit library directory],
 1480        [with_libluajit_libraries="$withval"],[with_libluajit_libraries="no"])
 1481 
 1482 if test "x$with_libluajit_libraries" != "xno"; then
 1483     LDFLAGS="${LDFLAGS}  -L${with_libluajit_libraries}"
 1484 fi
 1485 
 1486 #include nghttp2 libs
 1487 
 1488 AC_ARG_WITH(libnghttp2_includes,
 1489        [  --with-libnghttp2-includes=DIR    libnghttp2 include directory],
 1490        [with_libnghttp2_includes="$withval"],[with_libnghttp2_includes="no"])
 1491 
 1492 AC_ARG_WITH(libnghttp2_libraries,
 1493        [  --with-libnghttp2-libraries=DIR   libnghttp2 library directory],
 1494        [with_libnghttp2_libraries="$withval"],[with_libnghttp2_libraries="no"])
 1495 
 1496 if test "x$with_libnghttp2_includes" != "xno"; then
 1497     CPPFLAGS="${CPPFLAGS} -I${with_libnghttp2_includes}"
 1498     ICONFIGFLAGS="${ICONFIGFLAGS} -I${with_libnghttp2_includes}"
 1499 fi
 1500 
 1501 if test "x$with_libnghttp2_libraries" != "xno"; then
 1502     LDFLAGS="${LDFLAGS}  -L${with_libnghttp2_libraries}"
 1503 fi
 1504 
 1505 # Verify that we have the library
 1506 NGHTTP_L=""
 1507 AC_CHECK_LIB(nghttp2, nghttp2_option_new, ,NGHTTP_L="no")
 1508 if test "x$NGHTTP_L" = "xno"; then
 1509     echo
 1510     echo "   Libnghttp2 library not found."
 1511     echo "   Get it from https://nghttp2.org/"
 1512     echo
 1513 fi
 1514 
 1515 CFLAGS="${CFLAGS} ${CCONFIGFLAGS}"
 1516 CFLAGS=`echo $CFLAGS | sed -e 's/-I\/usr\/include //g'`
 1517 CPPFLAGS="${CPPFLAGS} ${CONFIGFLAGS}"
 1518 CPPFLAGS=`echo $CPPFLAGS | sed -e 's/-I\/usr\/include //g'`
 1519 
 1520 if test "x$GCC" = "xyes" ; then
 1521     echo `$CC -v 2>&1` | grep "version 4" > /dev/null
 1522     if test $? = 0 ; then
 1523         CFLAGS="$CFLAGS -fno-strict-aliasing"
 1524     fi
 1525 fi
 1526 
 1527 if test "x$linux" = "xyes"; then
 1528     AC_MSG_CHECKING(for linuxthreads)
 1529     tstr=`getconf GNU_LIBPTHREAD_VERSION 2>&1`
 1530     if test $? = 0; then  # GNU_LIBPTHREAD_VERSION is a valid system variable
 1531         echo $tstr | grep -i linuxthreads > /dev/null 2>&1
 1532         if test $? = 0; then
 1533             AC_DEFINE([HAVE_LINUXTHREADS],[1],[Define whether linuxthreads is being used])
 1534             AC_MSG_RESULT(yes)
 1535         else
 1536             AC_MSG_RESULT(no)
 1537         fi
 1538     else
 1539         # Use libc.so to see if linuxthreads is being used
 1540         $( ldd `which --skip-alias ls` | grep libc.so | awk '{print $3}' ) | grep -i linuxthreads > /dev/null 2>&1
 1541         if test $? = 0; then
 1542             AC_DEFINE([HAVE_LINUXTHREADS],[1],[Define whether linuxthreads is being used])
 1543             AC_MSG_RESULT(yes)
 1544         else
 1545             AC_MSG_RESULT(no)
 1546         fi
 1547     fi
 1548 fi
 1549 
 1550 if test "$LEX" != "none"; then
 1551     AC_MSG_CHECKING(for yylex_destroy support)
 1552 
 1553     version=`$LEX --version | awk '{print $3}'`
 1554     if test -z $version; then
 1555         version=`$LEX --version | awk '{print $2}'`
 1556     fi
 1557 
 1558     have_yylex_destroy="no"
 1559     if test $version; then
 1560         major=`echo $version | awk -F. '{ print $1 }'`
 1561         minor=`echo $version | awk -F. '{ print $2 }'`
 1562         subminor=`echo $version | awk -F. '{ print $3 }'`
 1563 
 1564         if test $major -a $minor -a $subminor; then
 1565             if test $major -gt 2; then
 1566                 have_yylex_destroy="yes"
 1567             else
 1568                 if test $major -eq 2; then
 1569                     if test $minor -gt 5; then
 1570                         have_yylex_destroy="yes"
 1571                     else
 1572                         if test $minor -eq 5; then
 1573                             if test $subminor -ge 9; then
 1574                                 have_yylex_destroy="yes"
 1575                             fi
 1576                         fi
 1577                     fi
 1578                 fi
 1579             fi
 1580         fi
 1581     fi
 1582 
 1583     if test "x$have_yylex_destroy" = "xyes"; then
 1584         AC_MSG_RESULT(yes)
 1585         AC_DEFINE([HAVE_YYLEX_DESTROY],[1],[Define whether yylex_destroy is supported in flex version])
 1586     else
 1587         AC_MSG_RESULT(no)
 1588     fi
 1589 fi
 1590 
 1591 # Set to no optimization regardless of what user or autostuff set
 1592 if test "x$NO_OPTIMIZE" = "xyes"; then
 1593     CFLAGS=`echo $CFLAGS | sed -e "s/-O./-O0/"`
 1594 
 1595     # in case user override doesn't include -O
 1596     if echo $CFLAGS | grep -qve -O0 ; then
 1597         CFLAGS="$CFLAGS -O0"
 1598     fi
 1599 fi
 1600 
 1601 # Question: Does ICC not support -Wall (VJR - Jan 14, 2015)
 1602 if test "$ICC" = "no"; then
 1603     CFLAGS="$CFLAGS -Wall"
 1604 fi
 1605 
 1606 AC_MSG_CHECKING(for SFLINUX)
 1607 if test -f /etc/os.conf; then
 1608     CFLAGS="${CFLAGS} -DSFLINUX"
 1609     AC_MSG_RESULT(yes)
 1610 else 
 1611     AC_MSG_RESULT(no)
 1612 fi
 1613 
 1614 AC_MSG_CHECKING(for WRLINUX)
 1615 if test -f /etc/os-release && grep -q "wrlinux" /etc/os-release; then
 1616     CFLAGS="${CFLAGS} -DWRLINUX"
 1617     AC_MSG_RESULT(yes)
 1618 else
 1619     AC_MSG_RESULT(no)
 1620 fi
 1621 
 1622 echo $CFLAGS > cflags.out
 1623 echo $CPPFLAGS > cppflags.out
 1624 
 1625 INCLUDES='-I$(top_srcdir) -I$(top_srcdir)/src -I$(top_srcdir)/src/sfutil $(extra_incl) -I$(top_srcdir)/src/output-plugins -I$(top_srcdir)/src/detection-plugins -I$(top_srcdir)/src/dynamic-plugins -I$(top_srcdir)/src/preprocessors -I$(top_srcdir)/src/preprocessors/portscan -I$(top_srcdir)/src/preprocessors/HttpInspect/include -I$(top_srcdir)/src/preprocessors/Session -I$(top_srcdir)/src/preprocessors/Stream6 -I$(top_srcdir)/src/target-based -I$(top_srcdir)/src/control -I$(top_srcdir)/src/file-process -I$(top_srcdir)/src/file-process/libs -I$(top_srcdir)/src/side-channel -I$(top_srcdir)/src/side-channel/plugins -I$(top_srcdir)/src/reload-adjust'
 1626 
 1627 AC_SUBST(INCLUDES)
 1628 AC_SUBST(CONFIGFLAGS)
 1629 AC_SUBST(CCONFIGFLAGS)
 1630 AC_SUBST(ICONFIGFLAGS)
 1631 
 1632 AC_PROG_INSTALL
 1633 AC_CONFIG_FILES([ \
 1634 snort.pc \
 1635 Makefile \
 1636 src/Makefile \
 1637 src/sfutil/Makefile \
 1638 src/control/Makefile \
 1639 src/file-process/Makefile \
 1640 src/file-process/libs/Makefile \
 1641 src/side-channel/Makefile \
 1642 src/side-channel/dynamic-plugins/Makefile \
 1643 src/side-channel/dynamic-plugins/snort_side_channel.pc \
 1644 src/side-channel/plugins/Makefile \
 1645 src/detection-plugins/Makefile \
 1646 src/dynamic-examples/Makefile \
 1647 src/dynamic-examples/dynamic-preprocessor/Makefile \
 1648 src/dynamic-examples/dynamic-rule/Makefile \
 1649 src/dynamic-plugins/Makefile \
 1650 src/dynamic-plugins/sf_engine/Makefile \
 1651 src/dynamic-plugins/sf_engine/examples/Makefile \
 1652 src/dynamic-plugins/sf_preproc_example/Makefile \
 1653 src/dynamic-preprocessors/Makefile \
 1654 src/dynamic-preprocessors/libs/Makefile \
 1655 src/dynamic-preprocessors/libs/snort_preproc.pc \
 1656 src/dynamic-preprocessors/ftptelnet/Makefile \
 1657 src/dynamic-preprocessors/smtp/Makefile \
 1658 src/dynamic-preprocessors/ssh/Makefile \
 1659 src/dynamic-preprocessors/sip/Makefile \
 1660 src/dynamic-preprocessors/reputation/Makefile \
 1661 src/dynamic-preprocessors/gtp/Makefile \
 1662 src/dynamic-preprocessors/dcerpc2/Makefile \
 1663 src/dynamic-preprocessors/pop/Makefile \
 1664 src/dynamic-preprocessors/imap/Makefile \
 1665 src/dynamic-preprocessors/sdf/Makefile \
 1666 src/dynamic-preprocessors/dns/Makefile \
 1667 src/dynamic-preprocessors/ssl/Makefile \
 1668 src/dynamic-preprocessors/modbus/Makefile \
 1669 src/dynamic-preprocessors/dnp3/Makefile \
 1670 src/dynamic-preprocessors/s7commplus/Makefile \
 1671 src/dynamic-preprocessors/file/Makefile \
 1672 src/dynamic-preprocessors/appid/Makefile \
 1673 src/dynamic-output/Makefile \
 1674 src/dynamic-output/plugins/Makefile \
 1675 src/dynamic-output/libs/Makefile \
 1676 src/dynamic-output/libs/snort_output.pc \
 1677 src/output-plugins/Makefile \
 1678 src/preprocessors/Makefile \
 1679 src/preprocessors/HttpInspect/Makefile \
 1680 src/preprocessors/HttpInspect/include/Makefile \
 1681 src/preprocessors/HttpInspect/utils/Makefile \
 1682 src/preprocessors/HttpInspect/anomaly_detection/Makefile \
 1683 src/preprocessors/HttpInspect/client/Makefile \
 1684 src/preprocessors/HttpInspect/files/Makefile \
 1685 src/preprocessors/HttpInspect/event_output/Makefile \
 1686 src/preprocessors/HttpInspect/mode_inspection/Makefile \
 1687 src/preprocessors/HttpInspect/normalization/Makefile \
 1688 src/preprocessors/HttpInspect/server/Makefile \
 1689 src/preprocessors/HttpInspect/session_inspection/Makefile \
 1690 src/preprocessors/HttpInspect/user_interface/Makefile \
 1691 src/preprocessors/Session/Makefile \
 1692 src/preprocessors/Stream6/Makefile \
 1693 src/parser/Makefile \
 1694 src/target-based/Makefile \
 1695 doc/Makefile \
 1696 rpm/Makefile \
 1697 preproc_rules/Makefile \
 1698 m4/Makefile \
 1699 etc/Makefile \
 1700 templates/Makefile \
 1701 tools/Makefile \
 1702 tools/control/Makefile \
 1703 tools/u2boat/Makefile \
 1704 tools/u2spewfoo/Makefile \
 1705 tools/u2openappid/Makefile \
 1706 tools/u2streamer/Makefile \
 1707 tools/file_server/Makefile \
 1708 src/win32/Makefile \
 1709 src/reload-adjust/Makefile])
 1710 
 1711 AC_OUTPUT