wez             Tue Nov 29 23:47:30 2005 EDT

  Modified files:              (Branch: PHP_5_1)
    /php-src    acinclude.m4 
  Log:
  Fix bugs #35379 and #35432 by erroring out when the user configures PHP
  extensions with conflicting options.
  
  Jani, feel free to refine the way that extensions are detected as shared :)
  
  For this to be foolproof, we either need to guarantee that the extensions have
  their PHP_NEW_EXTENSION invoked in the right sequence.  Eg: PDO should be
  handled in the configure script before any of the extensions that depend on it
  are handled... tricky.
  
  By happy coincidence, the alphabet ensures that pdo is configured before all
  the pdo_ extensions, and also before sqlite, so this works for now.
  
  
  
http://cvs.php.net/diff.php/php-src/acinclude.m4?r1=1.332.2.7&r2=1.332.2.8&ty=u
Index: php-src/acinclude.m4
diff -u php-src/acinclude.m4:1.332.2.7 php-src/acinclude.m4:1.332.2.8
--- php-src/acinclude.m4:1.332.2.7      Mon Nov 21 18:08:01 2005
+++ php-src/acinclude.m4        Tue Nov 29 23:47:24 2005
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: acinclude.m4,v 1.332.2.7 2005/11/21 23:08:01 sniper Exp $
+dnl $Id: acinclude.m4,v 1.332.2.8 2005/11/30 04:47:24 wez Exp $
 dnl
 dnl This file contains local autoconf functions.
 dnl
@@ -940,7 +940,7 @@
 
   if test "$3" != "shared" && test "$3" != "yes" && test "$4" != "cli"; then
 dnl ---------------------------------------------- Static module
-
+    [PHP_]translit($1,a-z_-,A-Z__)[_SHARED]=no
     PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,)
     EXT_STATIC="$EXT_STATIC $1"
     if test "$3" != "nocli"; then
@@ -949,6 +949,7 @@
   else
     if test "$3" = "shared" || test "$3" = "yes"; then
 dnl ---------------------------------------------- Shared module
+      [PHP_]translit($1,a-z_-,A-Z__)[_SHARED]=yes
       PHP_ADD_SOURCES_X(PHP_EXT_DIR($1),$2,$ac_extra,shared_objects_$1,yes)
       case $host_alias in
         *netware*[)]
@@ -964,6 +965,7 @@
 
   if test "$3" != "shared" && test "$3" != "yes" && test "$4" = "cli"; then
 dnl ---------------------------------------------- CLI static module
+    [PHP_]translit($1,a-z_-,A-Z__)[_SHARED]=no
     if test "$PHP_SAPI" = "cgi"; then
       PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,)
       EXT_STATIC="$EXT_STATIC $1"
@@ -1004,9 +1006,29 @@
 dnl $1 = name of extension, $2 = extension upon which it depends
 dnl $3 = optional: if true, it's ok for $2 to have not been configured
 dnl default is false and should halt the build.
+dnl To be effective, this macro must be invoked *after* PHP_NEW_EXTENSION.
+dnl The extension on which it depends must also have been configured.
 dnl See ADD_EXTENSION_DEP in win32 build 
 dnl
-AC_DEFUN([PHP_ADD_EXTENSION_DEP], [])
+AC_DEFUN([PHP_ADD_EXTENSION_DEP], [
+  am_i_shared=$[PHP_]translit($1,a-z_-,A-Z__)[_SHARED]
+  is_it_shared=$[PHP_]translit($2,a-z_-,A-Z__)[_SHARED]
+  if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then
+    AC_MSG_ERROR([
+You've configured extension $1 to build statically, but it
+depends on extension $2, which you've configured to build shared.
+You either need to build $1 shared or build $2 statically for the
+build to be successful.
+])
+  fi
+  if test "x$is_it_shared" = "x" && test "x$3" != "xtrue"; then
+    AC_MSG_ERROR([
+You've configured extension $1, which depends on extension $2,
+but you've either not enabled $2, or have disabled it.
+])
+  fi
+  dnl Some systems require that we link $2 to $1 when building
+])
 
 dnl -------------------------------------------------------------------------
 dnl Checks for structures, typedefs, broken functions, etc.

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to