]> granicus.if.org Git - php/commitdiff
Really fix the configuration now so that it's possible to compile both
authorAndrey Hristov <andrey@php.net>
Thu, 27 May 1999 13:59:39 +0000 (13:59 +0000)
committerAndrey Hristov <andrey@php.net>
Thu, 27 May 1999 13:59:39 +0000 (13:59 +0000)
against the bundled PCRE library and the one external to the source tree.
Crossing my fingers while Zeev compiles this. :)

ext/pcre/config.h.stub
ext/pcre/config.m4
ext/pcre/config0.m4
ext/pcre/pcre.c
ext/pcre/php_pcre.h

index 334cff6697e65652e30cdb77634dd4dc48f1fba8..f504f057dd77a6dd2b86648ddd47f4f7657c2ea1 100644 (file)
@@ -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
+
index ebeb82e2b0a4d47b6423e6d5271c18f4fa9293d6..ab1d7dc309c1c7e68f09b474d9fde9bb9335d855 100644 (file)
@@ -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)
 ]) 
index ebeb82e2b0a4d47b6423e6d5271c18f4fa9293d6..ab1d7dc309c1c7e68f09b474d9fde9bb9335d855 100644 (file)
@@ -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)
 ]) 
index d9dd6c1457eb9acbb14dda4afa7221715c91819d..791a913545a6550c09189f6c1339960cc80a546e 100644 (file)
 
 /* $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"
 
index a717cdbf8ec43886d1a8b229e8081160f8b81bf0..d4a8e12b300fd0c54d1d85e5e319e8709f686d38 100644 (file)
 #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