[master] 383c449 Move the pcre jit check to configure
Federico G. Schwindt
fgsch at lodoss.net
Thu Nov 12 00:50:38 CET 2015
commit 383c4497c050d496c33cc6e03754000a6cc74254
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date: Wed Nov 11 13:33:07 2015 +0000
Move the pcre jit check to configure
Output whether pcre jit is usable at configure time.
diff --git a/configure.ac b/configure.ac
index 5e46ce6..c8c2064 100644
--- a/configure.ac
+++ b/configure.ac
@@ -151,6 +151,27 @@ fi
AC_SUBST(PCRE_CFLAGS)
AC_SUBST(PCRE_LIBS)
+# --enable-pcre-jit
+AC_ARG_ENABLE(pcre-jit,
+ AS_HELP_STRING([--enable-pcre-jit],
+ [use the PCRE JIT compiler (default is YES)]),
+ [],
+ [enable_pcre_jit=yes])
+if test "$enable_pcre_jit" = yes; then
+ AC_MSG_CHECKING(for PCRE JIT usability)
+ AC_PREPROC_IFELSE(
+ [AC_LANG_PROGRAM([[#include "pcre.h"
+ #if PCRE_MAJOR != 8 || PCRE_MINOR < 32
+ #error no jit
+ #endif]])],
+ [AC_MSG_RESULT(yes)
+ AC_DEFINE([USE_PCRE_JIT], [1], [Use the PCRE JIT compiler])
+ ],
+ [AC_MSG_RESULT(no)]
+ )
+fi
+
+
AC_CHECK_HEADERS([edit/readline/readline.h],
[AC_DEFINE([HAVE_LIBEDIT], [1], [Define if we have libedit])
LIBEDIT_LIBS="-ledit"],
@@ -611,17 +632,6 @@ fi
AC_DEFINE_UNQUOTED([VCC_CC],"$VCC_CC",[C compiler command line for VCL code])
-# --enable-pcre-jit
-AC_ARG_ENABLE(pcre-jit,
- AS_HELP_STRING([--enable-pcre-jit],
- [use the PCRE JIT compiler (default is YES)]),
- ,
- [enable_pcre_jit=yes])
-
-if test "$enable_pcre_jit" = yes; then
- AC_DEFINE([USE_PCRE_JIT],[1],[use the PCRE JIT compiler])
-fi
-
# Stupid automake needs this
VTC_TESTS="$(cd $srcdir/bin/varnishtest && echo tests/*.vtc)"
AC_SUBST(VTC_TESTS)
diff --git a/lib/libvarnish/vre.c b/lib/libvarnish/vre.c
index 0bf89f9..56abccf 100644
--- a/lib/libvarnish/vre.c
+++ b/lib/libvarnish/vre.c
@@ -36,7 +36,7 @@
#include "vre.h"
-#if defined(USE_PCRE_JIT) && PCRE_MAJOR == 8 && PCRE_MINOR >= 32
+#if defined(USE_PCRE_JIT)
#define VRE_STUDY_JIT_COMPILE PCRE_STUDY_JIT_COMPILE
#else
#define VRE_STUDY_JIT_COMPILE 0
More information about the varnish-commit
mailing list