Skip to content

Commit

Permalink
Move the pcre jit check to configure
Browse files Browse the repository at this point in the history
Output whether pcre jit is usable at configure time.
  • Loading branch information
fgsch committed Nov 11, 2015
1 parent 3b0b877 commit 383c449
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
32 changes: 21 additions & 11 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/libvarnish/vre.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 383c449

Please sign in to comment.