cvs: /php4/regex regex_extra.h /php4 Makefile.am acinclude.m4 configure.in php.h php_regex.h /php4/ext/standard config.m4 reg.c /php4/regex utils.h
/php4/sapi/apache config.m4 libphp4.module.in

From: Date: Sat, 13 Nov 1999 16:51:33 +0000
Subject: cvs: /php4/regex regex_extra.h /php4 Makefile.am acinclude.m4 configure.in php.h php_regex.h /php4/ext/standard config.m4 reg.c /php4/regex utils.h
/php4/sapi/apache config.m4 libphp4.module.in
Groups: php.version4 
Request: Send a blank email to php-version4+get-6183@lists.php.net to get a copy of this message
sas Sat Nov 13 11:51:33 1999 EDT Added files: /php4/regex regex_extra.h Modified files: /php4 Makefile.am acinclude.m4 configure.in php.h php_regex.h /php4/ext/standard config.m4 reg.c /php4/regex utils.h /php4/sapi/apache config.m4 libphp4.module.in Log: Improve regex library selection. It lets user specify whether they want system, apache, or php's regex library by using the --with-regex option. "php" is the default; if you use --with-apache in combination with Apache 1.3.x, the default is "apache". Index: php4/Makefile.am diff -u php4/Makefile.am:1.11 php4/Makefile.am:1.12 --- php4/Makefile.am:1.11 Sat Nov 13 08:27:48 1999 +++ php4/Makefile.am Sat Nov 13 11:51:30 1999 @@ -1,7 +1,7 @@ AUTOMAKE_OPTIONS = foreign ZEND_DIR = $(srcdir)/libzend -SUBDIRS = libzend ext sapi $(TSRM_DIR) regex +SUBDIRS = libzend ext sapi $(TSRM_DIR) $(REGEX_DIR) BUILDLDFLAGS = $(EXTRA_LDFLAGS) $(LDFLAGS) Index: php4/acinclude.m4 diff -u php4/acinclude.m4:1.38 php4/acinclude.m4:1.39 --- php4/acinclude.m4:1.38 Sat Nov 13 08:27:48 1999 +++ php4/acinclude.m4 Sat Nov 13 11:51:30 1999 @@ -1,4 +1,4 @@ -dnl $Id: acinclude.m4,v 1.38 1999/11/13 13:27:48 sas Exp $ +dnl $Id: acinclude.m4,v 1.39 1999/11/13 16:51:30 sas Exp $ dnl dnl This file contains local autoconf functions. @@ -146,21 +146,23 @@ fi ]) -AC_DEFUN(PHP_HSREGEX,[ +AC_DEFUN(PHP_REGEX,[ -test -z "$HSREGEX" && HSREGEX="$WANT_HSREGEX" -AC_MSG_CHECKING(whether to use bundled regex library) -AC_MSG_RESULT($HSREGEX) - -if test "$HSREGEX" = "yes"; then +if test "$REGEX_TYPE" = "php"; then REGEX_LIB=regex/libregex.la + REGEX_DIR=regex AC_DEFINE(HSREGEX) AC_DEFINE(REGEX,1) -else - REGEX_LIB= +elif test "$REGEX_TYPE" = "system"; then AC_DEFINE(REGEX,0) +elif test "$REGEX_TYPE" = "apache"; then + AC_DEFINE(REGEX,2) fi +AC_MSG_CHECKING(which regex library to use) +AC_MSG_RESULT($REGEX_TYPE) + +AC_SUBST(REGEX_DIR) AC_SUBST(REGEX_LIB) AC_SUBST(HSREGEX) ]) Index: php4/configure.in diff -u php4/configure.in:1.31 php4/configure.in:1.32 --- php4/configure.in:1.31 Sat Nov 13 08:27:48 1999 +++ php4/configure.in Sat Nov 13 11:51:30 1999 @@ -1,4 +1,4 @@ -dnl ## $Id: configure.in,v 1.31 1999/11/13 13:27:48 sas Exp $ -*- sh -*- +dnl ## $Id: configure.in,v 1.32 1999/11/13 16:51:30 sas Exp $ -*- sh -*- dnl ## Process this file with autoconf to produce a configure script. divert(0) @@ -629,7 +629,7 @@ AM_SET_LIBTOOL_VARIABLE([--silent]) fi -PHP_HSREGEX +PHP_REGEX dnl If we are using gcc and the user has not specified CFLAGS, add -O2. test -n "$auto_cflags" && test -n "$GCC" && CFLAGS="$CFLAGS -O2" Index: php4/php.h diff -u php4/php.h:1.42 php4/php.h:1.43 --- php4/php.h:1.42 Mon Nov 8 04:18:57 1999 +++ php4/php.h Sat Nov 13 11:51:30 1999 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php.h,v 1.42 1999/11/08 09:18:57 ssb Exp $ */ +/* $Id: php.h,v 1.43 1999/11/13 16:51:30 sas Exp $ */ #ifndef _PHP_H #define _PHP_H @@ -201,6 +201,10 @@ #include "http_log.h" #define BLOCK_INTERRUPTIONS block_alarms #define UNBLOCK_INTERRUPTIONS unblock_alarms +#endif + +#if REGEX == 1 || REGEX == 0 +#include "regex/regex_extra.h" #endif #if HAVE_PWD_H Index: php4/php_regex.h diff -u php4/php_regex.h:1.6 php4/php_regex.h:1.7 --- php4/php_regex.h:1.6 Sat Oct 30 10:26:42 1999 +++ php4/php_regex.h Sat Nov 13 11:51:30 1999 @@ -1,7 +1,7 @@ #ifndef _PHP_REGEX_H #define _PHP_REGEX_H -#if REGEX +#if REGEX == 1 #include "regex/regex.h" #ifndef _REGEX_H #define _REGEX_H 1 /* this should stop Apache from loading the system version of regex.h */ @@ -18,7 +18,7 @@ #ifndef _H_REGEX #define _H_REGEX 1 /* This one is for AIX */ #endif -#else +#elif REGEX == 0 #include <regex.h> #endif Index: php4/ext/standard/config.m4 diff -u php4/ext/standard/config.m4:1.10 php4/ext/standard/config.m4:1.11 --- php4/ext/standard/config.m4:1.10 Sat Nov 13 08:27:49 1999 +++ php4/ext/standard/config.m4 Sat Nov 13 11:51:31 1999 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.10 1999/11/13 13:27:49 sas Exp $ -*- sh -*- +dnl $Id: config.m4,v 1.11 1999/11/13 16:51:31 sas Exp $ -*- sh -*- divert(1) @@ -123,18 +123,24 @@ divert(3) -AC_ARG_WITH(system-regex, -[ --with-system-regex Do not use the bundled regex library], +AC_ARG_WITH(regex, +[ --with-regex=TYPE regex library type: system, apache, php], [ - if test "$withval" = "no"; then - WANT_HSREGEX=yes - else - WANT_HSREGEX=no - fi + REGEX_TYPE=$withval ],[ - WANT_HSREGEX=yes + REGEX_TYPE=php ]) +AC_ARG_WITH(system-regex, +[ --with-system-regex (deprecated) Use system regex library], +[ + if test "$withval" = "yes"; then + REGEX_TYPE=system + else + REGEX_TYPE=php + fi +]) + AC_CRYPT_CAP PHP_EXTENSION(standard) Index: php4/ext/standard/reg.c diff -u php4/ext/standard/reg.c:1.22 php4/ext/standard/reg.c:1.23 --- php4/ext/standard/reg.c:1.22 Sat Oct 30 10:22:09 1999 +++ php4/ext/standard/reg.c Sat Nov 13 11:51:31 1999 @@ -17,7 +17,7 @@ | Jaakko Hyvätti <jaakko@hyvatti.iki.fi> | +----------------------------------------------------------------------+ */ -/* $Id: reg.c,v 1.22 1999/10/30 14:22:09 rasmus Exp $ */ +/* $Id: reg.c,v 1.23 1999/11/13 16:51:31 sas Exp $ */ #include <stdio.h> #include "php.h" @@ -92,7 +92,9 @@ return 1; } +#undef regfree #define regfree(a); +#undef regcomp #define regcomp(a,b,c) _php_regcomp(a,b,c) static void php_reg_init_globals(php_reg_globals *reg_globals) Index: php4/regex/utils.h diff -u php4/regex/utils.h:1.2 php4/regex/utils.h:1.3 --- php4/regex/utils.h:1.2 Fri Nov 12 15:27:52 1999 +++ php4/regex/utils.h Sat Nov 13 11:51:32 1999 @@ -1,4 +1,7 @@ /* utility definitions */ + +#include "regex_extra.h" + #ifdef _POSIX2_RE_DUP_MAX #define DUPMAX _POSIX2_RE_DUP_MAX #else Index: php4/sapi/apache/config.m4 diff -u php4/sapi/apache/config.m4:1.10 php4/sapi/apache/config.m4:1.11 --- php4/sapi/apache/config.m4:1.10 Fri Nov 12 15:56:30 1999 +++ php4/sapi/apache/config.m4 Sat Nov 13 11:51:33 1999 @@ -16,11 +16,6 @@ XML_INCLUDE="$APXS_INCLUDEDIR/xml" fi AC_ADD_INCLUDE($APXS_INCLUDEDIR) - if test -n "$APXS -q CFLAGS | grep USE_HSREGEX"; then - HSREGEX=yes - else - HSREGEX=no - fi PHP_EXTENSION(apache) PHP_SAPI=apache APACHE_INSTALL="$APXS -i -a -n php4 $SAPI_SHARED" @@ -64,6 +59,7 @@ fi # For Apache 1.3.x elif test -f $withval/src/main/httpd.h; then + APACHE_HAS_REGEX=1 APACHE_INCLUDE="-I$withval/src/main -I$withval/src/os/unix -I$withval/src/ap" APACHE_TARGET=$withval/src/modules/php4 if test ! -d $APACHE_TARGET; then @@ -90,6 +86,7 @@ fi # Also for Apache 1.3.x elif test -f $withval/src/include/httpd.h; then + APACHE_HAS_REGEX=1 APACHE_INCLUDE="-I$withval/src/include -I$withval/src/os/unix" APACHE_TARGET=$withval/src/modules/php4 if test -d $withval/src/lib/expat-lite ; then @@ -177,8 +174,21 @@ AC_MSG_RESULT(no) ]) +if test "$with_regex" = "apache" && test -z "$APACHE_HAS_REGEX"; then + with_regex=php +fi + +if test -z "$with_regex" && test -n "$APACHE_HAS_REGEX"; then + with_regex=apache +fi + if test -n "$APACHE_MODULE"; then - HSREGEX=no + if test "$with_regex" = "apache"; then + APACHE_WANT_HSREGEX=yes + else + APACHE_WANT_HSREGEX=no + fi + AC_SUBST(APACHE_WANT_HSREGEX) PHP_EXTENSION(apache) PHP_OUTPUT(sapi/apache/libphp4.module) PHP_BUILD_STATIC Index: php4/sapi/apache/libphp4.module.in diff -u php4/sapi/apache/libphp4.module.in:1.2 php4/sapi/apache/libphp4.module.in:1.3 --- php4/sapi/apache/libphp4.module.in:1.2 Mon Oct 4 11:18:25 1999 +++ php4/sapi/apache/libphp4.module.in Sat Nov 13 11:51:33 1999 @@ -1,6 +1,6 @@ Name: php4_module ConfigStart - RULE_WANTHSREGEX=@HSREGEX@ + RULE_WANTHSREGEX=@APACHE_WANT_HSREGEX@ LIBS="@NATIVE_RPATHS@ @PHP_LIBS@ @EXTRA_LIBS@ @LIBS@ $LIBS" RULE_HIDE=yes CFLAGS="$CFLAGS -I@abs_srcdir@ -I@abs_srcdir@/libzend -I@abs_builddir@/libzend -I@abs_builddir@"

« previous php.version4 (#6183) next »