From: Victor Julien Date: Wed, 25 Sep 2013 18:06:53 +0000 (+0200) Subject: pcre: check for pcre_free_study, fall back to pcre_free if it unavailable X-Git-Tag: suricata-2.0beta2~326 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0bfba8352de1c60953e218bc04df3516aedd594c;p=thirdparty%2Fsuricata.git pcre: check for pcre_free_study, fall back to pcre_free if it unavailable --- 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 */