diff options
Diffstat (limited to 'configure.seed')
-rw-r--r-- | configure.seed | 54 |
1 files changed, 42 insertions, 12 deletions
diff --git a/configure.seed b/configure.seed index 9813f54c0..1aa68f17c 100644 --- a/configure.seed +++ b/configure.seed @@ -10,6 +10,7 @@ AC_PROG_CC AM_PROG_CC_C_O AX_PTHREAD +NDPI_VERSION_SHORT="@NDPI_VERSION_SHORT@" NDPI_MAJOR="@NDPI_MAJOR@" NDPI_MINOR="@NDPI_MINOR@" NDPI_PATCH="@NDPI_PATCH@" @@ -39,6 +40,14 @@ AC_CHECK_HEADERS([netinet/in.h stdint.h stdlib.h string.h unistd.h]) PCAP_HOME=$HOME/PF_RING/userland +DPDK_TARGET= +if test -d $HOME/DPDK; then : + echo "Enabling DPDK support in ndpiReader" + DPDK_TARGET=dpdk +else + echo "DPDK support disabled (missing $HOME/DPDK)" +fi + if test -d $PCAP_HOME; then : echo -n "" else @@ -51,19 +60,38 @@ else AC_CHECK_LIB([numa], [numa_available], [LIBNUMA="-lnuma"]) fi - +MACHINE=`uname -m` +SYSTEM=`uname -s` +if test $SYSTEM = "Darwin"; then + CC=clang +fi + +if test $ax_cv_PTHREAD_CLANG = "yes"; then + CC=clang +fi + HS_LIB= HS_INC= -BKP=$LIBS -LIBS="$LIBS -lstdc++ -lm" -AC_CHECK_LIB([hs], [hs_compile_multi], AC_DEFINE_UNQUOTED(HAVE_HYPERSCAN, 1, [Intel Hyperscan is present])) -LIBS=$BKP - -if test "x$ac_cv_lib_hs_hs_compile_multi" = xyes; then : -AC_CHECK_LIB([m], [pow]) -AC_CHECK_LIB([stdc++], [main]) -HS_INC=`pkg-config --cflags libhs` -HS_LIB=`pkg-config --libs libhs` + +AC_ARG_WITH(hyperscan, [ --with-hyperscan Enable nDPI build with Intel Hyperscan]) + +if test "${with_hyperscan+set}" = set; then + BKP=$LIBS + LIBS="$LIBS -lstdc++ -lm" + AC_CHECK_LIB([hs], [hs_compile_multi], AC_DEFINE_UNQUOTED(HAVE_HYPERSCAN, 1, [Intel Hyperscan is present])) + LIBS=$BKP + + if test "x$ac_cv_lib_hs_hs_compile_multi" = xyes; then : + AC_CHECK_LIB([m], [pow]) + AC_CHECK_LIB([stdc++], [main]) + HS_INC=`pkg-config --cflags libhs` + HS_LIB=`pkg-config --libs libhs` + LDFLAGS="$LDFLAGS $HS_LIB" + AC_MSG_RESULT([compiling with Intel Hyperscan]) + else + AC_MSG_RESULT([Intel Hyperscan not found, exiting. See https://github.com/intel/hyperscan/blob/master/doc/dev-reference/getting_started.rst for install/build instructions]) + exit 1 + fi fi if test -f $PCAP_HOME/libpcap/libpcap.a; then : @@ -119,12 +147,13 @@ AC_ARG_ENABLE([debug-messages], AC_CHECK_LIB(pthread, pthread_setaffinity_np, AC_DEFINE_UNQUOTED(HAVE_PTHREAD_SETAFFINITY_NP, 1, [libc has pthread_setaffinity_np])) -AC_CONFIG_FILES([Makefile src/lib/Makefile example/Makefile tests/Makefile libndpi.pc src/include/ndpi_define.h]) +AC_CONFIG_FILES([Makefile example/Makefile example/Makefile.dpdk tests/Makefile libndpi.pc src/include/ndpi_define.h src/lib/Makefile]) AC_CONFIG_HEADERS(src/include/ndpi_config.h) AC_SUBST(GIT_RELEASE) AC_SUBST(NDPI_MAJOR) AC_SUBST(NDPI_MINOR) AC_SUBST(NDPI_PATCH) +AC_SUBST(NDPI_VERSION_SHORT) AC_SUBST(SVN_DATE) AC_SUBST(JSON_C_LIB) AC_SUBST(PCAP_INC) @@ -132,6 +161,7 @@ AC_SUBST(PCAP_LIB) AC_SUBST(DL_LIB) AC_SUBST(HS_LIB) AC_SUBST(HS_INC) +AC_SUBST(DPDK_TARGET) AC_SUBST(HAVE_PTHREAD_SETAFFINITY_NP) AC_OUTPUT |