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

Loading…
Cancel
Save