Fix build when hyperscan is missing

This commit is contained in:
Ed Kellett 2019-10-06 00:17:49 +01:00
parent a8f402e909
commit 9fe8bccba0
No known key found for this signature in database
GPG key ID: CB9986DEF342FABC
2 changed files with 19 additions and 6 deletions

View file

@ -324,13 +324,23 @@ AC_ARG_ENABLE(hyperscan,
AC_HELP_STRING([--disable-hyperscan],[Disable hyperscan support]),
[hyperscan=$enableval],[hyperscan=yes])
if test "$hyperscan" = yes; then
AS_IF([test "$hyperscan" = yes], [
save_CPPFLAGS="$CPPFLAGS"
save_LIBS="$LIBS"
PKG_CHECK_MODULES([HS], [libhs >= 4], [], [hyperscan=no])
CPPFLAGS="$CPPFLAGS $HS_CFLAGS"
LIBS="$LIBS $HS_LIBS"
AC_CHECK_HEADER([hs_common.h], [], [hyperscan=no])
AC_CHECK_FUNC([hs_scan], [], [hyperscan=no])
])
CPPFLAGS="$CPPFLAGS $(pkg-config --cflags libhs)"
LIBS="$LIBS $(pkg-config --libs libhs)"
AC_CHECK_HEADER(hs_common.h)
AS_IF([test "$hyperscan" = no], [
CPPFLAGS="$save_CPPFLAGS"
LIBS="$save_LIBS"
])
AM_CONDITIONAL([HAVE_HYPERSCAN], [test "$hyperscan" = "yes"])
fi
AC_ARG_WITH(zlib-path,
AC_HELP_STRING([--with-zlib-path=DIR],[Path to libz.so for ziplinks support.]),

View file

@ -52,7 +52,6 @@ extension_LTLIBRARIES = \
m_adminwall.la \
m_echotags.la \
m_extendchans.la \
filter.la \
m_findforwards.la \
m_identify.la \
m_locops.la \
@ -78,3 +77,7 @@ extension_LTLIBRARIES = \
spy_trace_notice.la \
drain.la \
example_module.la
if HAVE_HYPERSCAN
extension_LTLIBRARIES += filter.la
endif