pcre: compile jit by default if available.

remotes/origin/master-1.2.x
Eric Leblond 13 years ago committed by Victor Julien
parent 5a769c02ee
commit 3d558bf06f

@ -300,62 +300,50 @@ AC_INIT(configure.in)
fi
#enable support for PCRE-jit available since pcre-8.20
AC_ARG_ENABLE(pcre-jit,
AS_HELP_STRING([--enable-pcre-jit], [Enable experimental support for PCRE-jit]),,[enable_pcre_jit=no])
AS_IF([test "x$enable_pcre_jit" = "xyes"], [
AC_MSG_CHECKING(for PCRE JIT support)
AC_TRY_COMPILE([ #include <pcre.h> ],
[
int jit = 0;
pcre_config(PCRE_CONFIG_JIT, &jit);
],
[ pcre_jit_available=yes ], [:]
)
if test "x$pcre_jit_available" = "xyes"; then
AC_MSG_RESULT(yes)
AC_DEFINE([PCRE_HAVE_JIT], [1], [Pcre with JIT compiler support enabled])
AC_MSG_CHECKING(for PCRE JIT support usability)
AC_TRY_COMPILE([ #include <pcre.h> ],
[
const char* regexstr = "(a|b|c|d)";
pcre *re;
const char *error;
pcre_extra *extra;
int err_offset;
re = pcre_compile(regexstr,0, &error, &err_offset,NULL);
extra = pcre_study(re, PCRE_STUDY_JIT_COMPILE, &error);
if (extra == NULL)
exit(EXIT_FAILURE);
int jit = 0;
int ret = pcre_fullinfo(re, extra, PCRE_INFO_JIT, &jit);
if (ret != 0 || jit != 1)
exit(EXIT_FAILURE);
exit(EXIT_SUCCESS);
],
[ pcre_jit_works=yes ], [:]
)
if test "x$pcre_jit_works" != "xyes"; then
AC_MSG_RESULT(no)
echo
echo " PCRE JIT support detection worked but testing it failed"
echo " something odd is going on, please file a bug report."
echo
exit 1
else
AC_MSG_RESULT(yes)
fi
else
AC_MSG_RESULT(no)
echo
echo " Error! --enable-pcre-jit set but PCRE_CONFIG_JIT not found"
echo " Make sure your PCRE supports JIT. Version 8.20+ with"
echo " --enable-jit passed to it's configure script."
echo
exit 1
fi
])
AC_MSG_CHECKING(for PCRE JIT support)
AC_TRY_COMPILE([ #include <pcre.h> ],
[
int jit = 0;
pcre_config(PCRE_CONFIG_JIT, &jit);
],
[ pcre_jit_available=yes ], [ pcre_jit_available=no ]
)
if test "x$pcre_jit_available" = "xyes"; then
AC_MSG_RESULT(yes)
AC_DEFINE([PCRE_HAVE_JIT], [1], [Pcre with JIT compiler support enabled])
AC_MSG_CHECKING(for PCRE JIT support usability)
AC_TRY_COMPILE([ #include <pcre.h> ],
[
const char* regexstr = "(a|b|c|d)";
pcre *re;
const char *error;
pcre_extra *extra;
int err_offset;
re = pcre_compile(regexstr,0, &error, &err_offset,NULL);
extra = pcre_study(re, PCRE_STUDY_JIT_COMPILE, &error);
if (extra == NULL)
exit(EXIT_FAILURE);
int jit = 0;
int ret = pcre_fullinfo(re, extra, PCRE_INFO_JIT, &jit);
if (ret != 0 || jit != 1)
exit(EXIT_FAILURE);
exit(EXIT_SUCCESS);
],
[ pcre_jit_works=yes ], [:]
)
if test "x$pcre_jit_works" != "xyes"; then
AC_MSG_RESULT(no)
echo
echo " PCRE JIT support detection worked but testing it failed"
echo " something odd is going on, please file a bug report."
echo
exit 1
else
AC_MSG_RESULT(yes)
fi
fi
#libyaml
AC_ARG_WITH(libyaml_includes,
@ -1086,5 +1074,5 @@ Suricata Configuration:
GCC Profile enabled: ${enable_gccprofile}
Old barnyard2 support: ${enable_old_barnyard2}
Non-bundled htp: ${enable_non_bundled_htp}
PCRE jit: ${enable_pcre_jit}
PCRE jit: ${pcre_jit_available}
"

Loading…
Cancel
Save