From ceae3847b8b53c8f22b3dde52834d395c41a2e68 Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Fri, 12 Nov 1999 20:56:30 +0000 Subject: [PATCH] Enable selective regex library compilation. --- acinclude.m4 | 16 +++++++++++++++ configure.in | 45 ++---------------------------------------- ext/standard/config.m4 | 12 +++++++++++ sapi/apache/config.m4 | 6 ++++++ 4 files changed, 36 insertions(+), 43 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index b2d87256fce..65ab8c32635 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -144,6 +144,22 @@ AC_DEFUN(AC_CHECK_CC_OPTION,[ fi ]) +AC_DEFUN(PHP_HSREGEX,[ +AC_MSG_CHECKING(whether to use bundled regex library) +AC_MSG_RESULT($HSREGEX) + +if test "$HSREGEX" = "yes"; then + REGEX_LIB=regex/libregex.la + AC_DEFINE(HSREGEX) + AC_DEFINE(REGEX,1) +else + REGEX_LIB= + AC_DEFINE(REGEX,0) +fi + +AC_SUBST(REGEX_LIB) +AC_SUBST(HSREGEX) +]) dnl dnl See if we have broken header files like SunOS has. diff --git a/configure.in b/configure.in index bd943cbca31..cbf3489673d 100644 --- a/configure.in +++ b/configure.in @@ -386,49 +386,6 @@ AC_ARG_ENABLE(versioning, ]) AC_MSG_RESULT($RESULT) -AC_MSG_CHECKING(whether to use bundled regex library) -AC_ARG_WITH(system-regex, -[ --with-system-regex Do not use the bundled regex library], -[ - if test -n "$APXS"; then - if test -n "`$APXS -q CFLAGS | grep USE_HSREGEX`"; then - HSREGEX=yes - else - HSREGEX=no - fi - else - if test "$withval" = "no"; then - HSREGEX=yes - else - HSREGEX=no - fi - fi -],[ - if test -n "$APXS"; then - if test -n "`$APXS -q CFLAGS | grep USE_HSREGEX`"; then - HSREGEX=yes - else - HSREGEX=no - fi - else - HSREGEX=yes - fi -]) -AC_MSG_RESULT($HSREGEX) - -if test "$HSREGEX" = "yes"; then - REGEX_LIB=regex/libregex.la - AC_DEFINE(HSREGEX) - AC_DEFINE(REGEX,1) -else - REGEX_LIB= - AC_DEFINE(REGEX,0) -fi - -AC_SUBST(REGEX_LIB) -AC_SUBST(HSREGEX) - - AC_MSG_CHECKING(whether to use a configuration file) AC_ARG_WITH(config-file-path, [ --with-config-file-path=PATH @@ -672,6 +629,8 @@ if test "$enable_debug" != "yes"; then AM_SET_LIBTOOL_VARIABLE([--silent]) fi +PHP_HSREGEX + 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" diff --git a/ext/standard/config.m4 b/ext/standard/config.m4 index 9949ffbd943..cde845c2e8e 100644 --- a/ext/standard/config.m4 +++ b/ext/standard/config.m4 @@ -123,6 +123,18 @@ AC_CHECK_FUNCS(getwd) divert(3) +AC_ARG_WITH(system-regex, +[ --with-system-regex Do not use the bundled regex library], +[ + if test "$withval" = "no"; then + HSREGEX=yes + else + HSREGEX=no + fi +],[ + HSREGEX=yes +]) + AC_CRYPT_CAP PHP_EXTENSION(standard) diff --git a/sapi/apache/config.m4 b/sapi/apache/config.m4 index 10a8cc457b5..1641fa6decd 100644 --- a/sapi/apache/config.m4 +++ b/sapi/apache/config.m4 @@ -16,6 +16,11 @@ 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" @@ -173,6 +178,7 @@ AC_ARG_WITH(mod_charset, ]) if test -n "$APACHE_MODULE"; then + HSREGEX=no PHP_EXTENSION(apache) PHP_OUTPUT(sapi/apache/libphp4.module) PHP_BUILD_STATIC