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
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*[)]
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"
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.