against the bundled PCRE library and the one external to the source tree.
Crossing my fingers while Zeev compiles this. :)
-/* define if you want to use the pcre extension */
-#define HAVE_LIBPCRE 0
+/* define if you want to use the PCRE extension */
+#define HAVE_PCRE 0
+
+/* define if you want to use the bundled PCRE library */
+#define HAVE_BUNDLED_PCRE 0
+
AC_MSG_RESULT(no) ;;
yes)
EXTRA_LIBS="-Lext/pcre/pcrelib -lpcre $EXTRA_LIBS"
- INCLUDES="-Ipcrelib $INCLUDES"
+ dnl INCLUDES="-Iext/pcre/pcrelib $INCLUDES"
PCRE_SUBDIR="pcrelib"
- AC_DEFINE(HAVE_LIBPCRE, 1)
+ AC_DEFINE(HAVE_PCRE, 1)
+ AC_DEFINE(HAVE_BUNDLED_PCRE, 1)
AC_MSG_RESULT(yes)
- PHP_EXTENSION(pcre) ;;
+ PHP_EXTENSION(pcre) ;;
*)
- test -f $withval/pcre.h && INCLUDES="-I$withval $INCLUDES"
- test -f $withval/libpcre.a && EXTRA_LIBS="-L$withval -lpcre $EXTRA_LIBS"
+ test -f $withval/pcre.h && PCRE_INCLUDE="-I$withval"
+ test -f $withval/libpcre.a && PCRE_LIB="-L$withval -lpcre"
if test -n "$PCRE_INCLUDE" && test -n "$PCRE_LIB" ; then
- AC_DEFINE(HAVE_LIBPCRE, 1)
+ INCLUDES="$PCRE_INCLUDE $INCLUDES"
+ EXTRA_LIBS="$PCRE_LIB $EXTRA_LIBS"
+ AC_DEFINE(HAVE_PCRE, 1)
+ AC_DEFINE(HAVE_BUNDLED_PCRE, 0)
PCRE_SUBDIR=
AC_MSG_RESULT(yes)
PHP_EXTENSION(pcre)
esac
],[
EXTRA_LIBS="-Lext/pcre/pcrelib -lpcre $EXTRA_LIBS"
- INCLUDES="-Ipcrelib $INCLUDES"
+dnl INCLUDES="-Iext/pcre/pcrelib $INCLUDES"
PCRE_SUBDIR="pcrelib"
- AC_DEFINE(HAVE_LIBPCRE, 1)
+ AC_DEFINE(HAVE_PCRE, 1)
+ AC_DEFINE(HAVE_BUNDLED_PCRE, 1)
AC_MSG_RESULT(yes)
PHP_EXTENSION(pcre)
])
AC_MSG_RESULT(no) ;;
yes)
EXTRA_LIBS="-Lext/pcre/pcrelib -lpcre $EXTRA_LIBS"
- INCLUDES="-Ipcrelib $INCLUDES"
+ dnl INCLUDES="-Iext/pcre/pcrelib $INCLUDES"
PCRE_SUBDIR="pcrelib"
- AC_DEFINE(HAVE_LIBPCRE, 1)
+ AC_DEFINE(HAVE_PCRE, 1)
+ AC_DEFINE(HAVE_BUNDLED_PCRE, 1)
AC_MSG_RESULT(yes)
- PHP_EXTENSION(pcre) ;;
+ PHP_EXTENSION(pcre) ;;
*)
- test -f $withval/pcre.h && INCLUDES="-I$withval $INCLUDES"
- test -f $withval/libpcre.a && EXTRA_LIBS="-L$withval -lpcre $EXTRA_LIBS"
+ test -f $withval/pcre.h && PCRE_INCLUDE="-I$withval"
+ test -f $withval/libpcre.a && PCRE_LIB="-L$withval -lpcre"
if test -n "$PCRE_INCLUDE" && test -n "$PCRE_LIB" ; then
- AC_DEFINE(HAVE_LIBPCRE, 1)
+ INCLUDES="$PCRE_INCLUDE $INCLUDES"
+ EXTRA_LIBS="$PCRE_LIB $EXTRA_LIBS"
+ AC_DEFINE(HAVE_PCRE, 1)
+ AC_DEFINE(HAVE_BUNDLED_PCRE, 0)
PCRE_SUBDIR=
AC_MSG_RESULT(yes)
PHP_EXTENSION(pcre)
esac
],[
EXTRA_LIBS="-Lext/pcre/pcrelib -lpcre $EXTRA_LIBS"
- INCLUDES="-Ipcrelib $INCLUDES"
+dnl INCLUDES="-Iext/pcre/pcrelib $INCLUDES"
PCRE_SUBDIR="pcrelib"
- AC_DEFINE(HAVE_LIBPCRE, 1)
+ AC_DEFINE(HAVE_PCRE, 1)
+ AC_DEFINE(HAVE_BUNDLED_PCRE, 1)
AC_MSG_RESULT(yes)
PHP_EXTENSION(pcre)
])
/* $Id$ */
-/* Get PCRE library from ftp://ftp.cus.cam.ac.uk/pub/software/programs/pcre/ */
-
#include "php.h"
-#if HAVE_LIBPCRE
+#if HAVE_PCRE
#include "php_pcre.h"
#ifndef _PHP_PCRE_H
#define _PHP_PCRE_H
-#if HAVE_LIBPCRE
+#if HAVE_PCRE
+#if HAVE_BUNDLED_PCRE
#include "pcrelib/pcre.h"
+#else
+#include "pcre.h"
+#endif
extern void php_info_pcre(ZEND_MODULE_INFO_FUNC_ARGS);
extern int php_minit_pcre(INIT_FUNC_ARGS);
#define pcre_module_ptr &pcre_module_entry
typedef struct {
- pcre *re;
- pcre_extra *extra;
+ pcre *re;
+ pcre_extra *extra;
} pcre_cache_entry;
typedef struct {
#define pcre_module_ptr NULL
-#endif /* HAVE_LIBPCRE */
+#endif /* HAVE_PCRE */
#define phpext_pcre_ptr pcre_module_ptr