From bcb2214e9951b271d073314870bf09a6a87435f5 Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Sat, 13 Nov 1999 16:51:33 +0000 Subject: 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". --- sapi/apache/config.m4 | 22 ++++++++++++++++------ sapi/apache/libphp4.module.in | 2 +- 2 files changed, 17 insertions(+), 7 deletions(-) (limited to 'sapi') diff --git a/sapi/apache/config.m4 b/sapi/apache/config.m4 index 1641fa6dec..9aed624498 100644 --- a/sapi/apache/config.m4 +++ b/sapi/apache/config.m4 @@ -16,11 +16,6 @@ AC_ARG_WITH(apxs, 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 @@ AC_ARG_WITH(apache, 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 @@ AC_ARG_WITH(apache, 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_ARG_WITH(mod_charset, 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 diff --git a/sapi/apache/libphp4.module.in b/sapi/apache/libphp4.module.in index 687c1c46ac..8ecf83ebaa 100644 --- a/sapi/apache/libphp4.module.in +++ b/sapi/apache/libphp4.module.in @@ -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@" -- cgit v1.2.1