]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
pcre: check for pcre_free_study, fall back to pcre_free if it unavailable
authorVictor Julien <victor@inliniac.net>
Wed, 25 Sep 2013 18:06:53 +0000 (20:06 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 25 Sep 2013 18:06:53 +0000 (20:06 +0200)
configure.ac
src/suricata-common.h

index 6f8a3b6bdff0af8e4cf4ce770c5d09ab0999cbce..75f044b8b8853d3d442db8a62f09058b5b674cde 100644 (file)
         echo
     fi
 
+    TMPCFLAGS="${CFLAGS}"
+    CFLAGS="-O0 -g -Werror -Wall"
+    AC_TRY_COMPILE([ #include <pcre.h> ],
+        [ pcre_extra *extra = NULL; pcre_free_study(extra); ],
+        [ AC_DEFINE([HAVE_PCRE_FREE_STUDY], [1], [Pcre pcre_free_study supported])], [:]
+    )
+    CFLAGS="${TMPCFLAGS}"
+
     #enable support for PCRE-jit available since pcre-8.20
     AC_MSG_CHECKING(for PCRE JIT support)
     AC_TRY_COMPILE([ #include <pcre.h> ],
index 9a66ab181203b7eec94e06ee03b7805848b45a02..0d7b691ddd7cae3d00a27efa5d9a3cf90200e204 100644 (file)
 #endif
 #endif
 
+#ifndef HAVE_PCRE_FREE_STUDY
+#define pcre_free_study pcre_free
+#endif
+
 typedef enum PacketProfileDetectId_ {
     PROF_DETECT_MPM,
     PROF_DETECT_MPM_PACKET,         /* PKT MPM */