From 0bfba8352de1c60953e218bc04df3516aedd594c Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 25 Sep 2013 20:06:53 +0200 Subject: [PATCH] pcre: check for pcre_free_study, fall back to pcre_free if it unavailable --- configure.ac | 8 ++++++++ src/suricata-common.h | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/configure.ac b/configure.ac index 6f8a3b6bdf..75f044b8b8 100644 --- a/configure.ac +++ b/configure.ac @@ -469,6 +469,14 @@ echo fi + TMPCFLAGS="${CFLAGS}" + CFLAGS="-O0 -g -Werror -Wall" + AC_TRY_COMPILE([ #include ], + [ 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 ], diff --git a/src/suricata-common.h b/src/suricata-common.h index 9a66ab1812..0d7b691ddd 100644 --- a/src/suricata-common.h +++ b/src/suricata-common.h @@ -270,6 +270,10 @@ #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 */ -- 2.47.3