diff options
-rw-r--r-- | acinclude.m4 | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 0cc1ac347f..47e9425295 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -940,7 +940,7 @@ AC_DEFUN([PHP_NEW_EXTENSION],[ 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 @@ dnl ---------------------------------------------- Static module 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 @@ dnl ---------------------------------------------- Shared module 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 list, so that modules can be init'd in the correct order 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. |