[master] 2d4565b Check pcre_study() is working in configure

Federico G. Schwindt fgsch at lodoss.net
Mon May 30 19:19:06 CEST 2016


commit 2d4565b6bf10b4a2f68865fe0902b2299f2d08e5
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Mon May 30 18:03:27 2016 +0100

    Check pcre_study() is working in configure

diff --git a/autogen.des b/autogen.des
index 717c5cf..42b1508 100755
--- a/autogen.des
+++ b/autogen.des
@@ -6,8 +6,6 @@ set -ex
 
 make -k distclean > /dev/null 2>&1 || true
 
-OPTS=""
-
 # Prefer CLANG if we have it, and have not given preferences
 if [ -f /usr/bin/clang -a "x${CC}" = "x" ] ; then
 	CC=clang
@@ -20,14 +18,9 @@ else
 	DST="--prefix=/opt/varnish --mandir=/opt/varnish/man"
 fi
 
-if [ "x`uname -po`" = "xFreeBSD armv6" ] ; then
-	OPTS="${OPTS} --disable-pcre-jit"
-fi
-
 rm -f configure
 . ./autogen.sh 2>&1 | egrep -v "(subdir-objects|is in a subdirectory)"
 
-
 # autoconf prior to 2.62 has issues with zsh 4.2 and newer
 export CONFIG_SHELL=/bin/sh
 
@@ -39,5 +32,4 @@ export CONFIG_SHELL=/bin/sh
     --enable-developer-warnings \
     --enable-debugging-symbols \
     --enable-dependency-tracking \
-    $OPTS \
     "$@"
diff --git a/configure.ac b/configure.ac
index ad83ab7..2ae3f99 100644
--- a/configure.ac
+++ b/configure.ac
@@ -161,17 +161,29 @@ if test "$enable_pcre_jit" = yes; then
   AC_MSG_CHECKING(for PCRE JIT usability)
   save_CFLAGS="${CFLAGS}"
   CFLAGS="${PCRE_CFLAGS}"
-  AC_COMPILE_IFELSE(
-    [AC_LANG_PROGRAM([[#include "pcre.h"
-                       #if PCRE_MAJOR != 8 || PCRE_MINOR < 32
-                       #error no jit
-                       #endif]])],
+  save_LIBS="${CFLAGS}"
+  LIBS="${PCRE_LIBS}"
+  AC_RUN_IFELSE(
+    [AC_LANG_PROGRAM([[
+#include <pcre.h>
+#if PCRE_MAJOR != 8 || PCRE_MINOR < 32
+#error no jit
+#endif
+    ]],[[
+const char *error;
+pcre *re;
+int erroroffset;
+re = pcre_compile(".", 0, &error, &erroroffset, NULL);
+if (!pcre_study(re, PCRE_STUDY_JIT_COMPILE, &error))
+  return (1);
+    ]])],
     [AC_MSG_RESULT(yes)
      AC_DEFINE([USE_PCRE_JIT], [1], [Use the PCRE JIT compiler])
     ],
     [AC_MSG_RESULT(no)]
   )
   CFLAGS="${save_CFLAGS}"
+  LIBS="${save_LIBS}"
 fi
 
 



More information about the varnish-commit mailing list