]> git.ipfire.org Git - people/ms/suricata.git/commitdiff
configure: check for plugin support
authorJason Ish <jason.ish@oisf.net>
Thu, 23 Apr 2020 22:48:23 +0000 (16:48 -0600)
committerVictor Julien <victor@inliniac.net>
Thu, 6 Aug 2020 15:14:53 +0000 (17:14 +0200)
Currently plugin support requires the dlfcn.h header
file and compiler support for -rdynamic.

configure.ac

index 4fc1b559fcf317bf8004c7018d410b17a3a9ad65..62564b9dbfe9681e446719d12f8591c10650f388 100644 (file)
         AC_SUBST(SECLDFLAGS)
     ])
 
+    #check for plugin support
+    AC_CHECK_HEADERS([dlfcn.h])
+    AC_MSG_CHECKING([for plugin support])
+    TMPLDFLAGS="${LDFLAGS}"
+    LDFLAGS="${LDFLAGS} -rdynamic"
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <dlfcn.h>]], [[]])],
+        [
+            AC_MSG_RESULT(yes)
+            has_rdynamic=yes
+        ],
+        [
+            AC_MSG_RESULT(no)
+            has_rdynamic=no
+        ])
+
+    if test "x$has_rdynamic" = "xyes"; then
+        plugin_support=yes
+        AC_DEFINE([HAVE_PLUGINS], [1], [Plugin support])
+    else
+        plugin_support=no
+        LDFLAGS="${TMPLDFLAGS}"
+    fi
+
     #enable profile generation
     AC_ARG_ENABLE(gccprofile,
            AS_HELP_STRING([--enable-gccprofile], [Enable gcc profile info i.e -pg flag is set]),[enable_gccprofile=$enableval],[enable_gccprofile=no])
@@ -2779,6 +2802,8 @@ SURICATA_BUILD_CONF="Suricata Configuration:
   Profiling enabled:                       ${enable_profiling}
   Profiling locks enabled:                 ${enable_profiling_locks}
 
+  Plugin support (experimental):           ${plugin_support}
+
 Development settings:
   Coccinelle / spatch:                     ${enable_coccinelle}
   Unit tests enabled:                      ${enable_unittests}