]> jfr.im git - solanum.git/commitdiff
Fix build when hyperscan is missing
authorEd Kellett <redacted>
Sat, 5 Oct 2019 23:17:49 +0000 (00:17 +0100)
committerEd Kellett <redacted>
Sun, 6 Oct 2019 18:24:34 +0000 (19:24 +0100)
configure.ac
extensions/Makefile.am

index d8c9e82d6ad30d3a4c4aad5331b6cb28d7b0f74b..1281422cd884f9377b9dcc7c53ae8306c8fea4cc 100644 (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])
+])
+
+AS_IF([test "$hyperscan" = no], [
+       CPPFLAGS="$save_CPPFLAGS"
+       LIBS="$save_LIBS"
+])
+
+AM_CONDITIONAL([HAVE_HYPERSCAN], [test "$hyperscan" = "yes"])
 
-CPPFLAGS="$CPPFLAGS $(pkg-config --cflags libhs)"
-LIBS="$LIBS $(pkg-config --libs libhs)"
-AC_CHECK_HEADER(hs_common.h)
-
-fi
 
 AC_ARG_WITH(zlib-path,
 AC_HELP_STRING([--with-zlib-path=DIR],[Path to libz.so for ziplinks support.]),
index bed208e3417948427a9b3ba2f25b25dbaa162277..ab10383f537070bd34d511332e3efa864c4e2a62 100644 (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