summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/pcre/config.h.stub8
-rw-r--r--ext/pcre/config.m421
-rw-r--r--ext/pcre/config0.m421
-rw-r--r--ext/pcre/pcre.c4
-rw-r--r--ext/pcre/php_pcre.h12
5 files changed, 41 insertions, 25 deletions
diff --git a/ext/pcre/config.h.stub b/ext/pcre/config.h.stub
index 334cff6697..f504f057dd 100644
--- a/ext/pcre/config.h.stub
+++ b/ext/pcre/config.h.stub
@@ -1,2 +1,6 @@
-/* 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
+
diff --git a/ext/pcre/config.m4 b/ext/pcre/config.m4
index ebeb82e2b0..ab1d7dc309 100644
--- a/ext/pcre/config.m4
+++ b/ext/pcre/config.m4
@@ -12,17 +12,21 @@ AC_ARG_WITH(pcre-regex,
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)
@@ -32,9 +36,10 @@ AC_ARG_WITH(pcre-regex,
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)
])
diff --git a/ext/pcre/config0.m4 b/ext/pcre/config0.m4
index ebeb82e2b0..ab1d7dc309 100644
--- a/ext/pcre/config0.m4
+++ b/ext/pcre/config0.m4
@@ -12,17 +12,21 @@ AC_ARG_WITH(pcre-regex,
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)
@@ -32,9 +36,10 @@ AC_ARG_WITH(pcre-regex,
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)
])
diff --git a/ext/pcre/pcre.c b/ext/pcre/pcre.c
index d9dd6c1457..791a913545 100644
--- a/ext/pcre/pcre.c
+++ b/ext/pcre/pcre.c
@@ -29,11 +29,9 @@
/* $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"
diff --git a/ext/pcre/php_pcre.h b/ext/pcre/php_pcre.h
index a717cdbf8e..d4a8e12b30 100644
--- a/ext/pcre/php_pcre.h
+++ b/ext/pcre/php_pcre.h
@@ -32,9 +32,13 @@
#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);
@@ -50,8 +54,8 @@ extern zend_module_entry pcre_module_entry;
#define pcre_module_ptr &pcre_module_entry
typedef struct {
- pcre *re;
- pcre_extra *extra;
+ pcre *re;
+ pcre_extra *extra;
} pcre_cache_entry;
typedef struct {
@@ -79,7 +83,7 @@ extern ZEND_API php_pcre_globals pcre_globals;
#define pcre_module_ptr NULL
-#endif /* HAVE_LIBPCRE */
+#endif /* HAVE_PCRE */
#define phpext_pcre_ptr pcre_module_ptr