diff options
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 52 |
1 files changed, 34 insertions, 18 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 5f168a373f..a97e523ee6 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -159,24 +159,25 @@ AC_DEFUN(AC_BROKEN_SPRINTF,[ ]) dnl -dnl Stuff to do when setting up a new extension. -dnl XXX have to change the hardcoding of ".a" when we want to be able -dnl to make dynamic libraries as well. +dnl PHP_EXTENSION(extname [, shared]) +dnl +dnl Includes an extension in the build. +dnl +dnl "extname" is the name of the ext/ subdir where the extension resides +dnl "shared" can be set to "shared" or "yes" to build the extension as +dnl a dynamically loadable library. dnl AC_DEFUN(PHP_EXTENSION,[ if test -d "$cwd/$srcdir/ext/$1" ; then - EXT_SUBDIRS="$EXT_SUBDIRS $1" - if test "$2" != "shared" -a "$2" != "yes"; then - _extlib="libphpext_$1.a" - EXT_LIBS="$EXT_LIBS $1/$_extlib" - EXTINFO_DEPS="$EXTINFO_DEPS ../ext/$1/extinfo.c.stub" - EXT_STATIC="$EXT_STATIC $1" - else - EXT_SHARED="$EXT_SHARED $1" - fi -dnl EXT_INCLUDE_CODE="\#include \"ext/$1/php3_$1.h\"\\n$EXT_INCLUDE_CODE" -dnl EXT_MODULE_PTRS="phpext_$1_ptr, $EXT_MODULE_PTRS" -dnl " + EXT_SUBDIRS="$EXT_SUBDIRS $1" + if test "$2" != "shared" -a "$2" != "yes"; then + _extlib="libphpext_$1.a" + EXT_LIBS="$EXT_LIBS $1/$_extlib" + EXT_STATIC="$EXT_STATIC $1" + else + EXT_SHARED="$EXT_SHARED $1" + fi + PHP_OUTPUT(ext/$1/Makefile) fi ]) @@ -184,9 +185,6 @@ AC_SUBST(EXT_SUBDIRS) AC_SUBST(EXT_STATIC) AC_SUBST(EXT_SHARED) AC_SUBST(EXT_LIBS) -AC_SUBST(EXTINFO_DEPS) -dnl AC_SUBST(EXT_INCLUDE_CODE) -dnl AC_SUBST(EXT_MODULES_PTRS) dnl dnl Solaris requires main code to be position independent in order @@ -277,3 +275,21 @@ AC_DEFUN(AC_SYS_LFS, done ;; esac ]) + +AC_DEFUN(AC_SOCKADDR_SA_LEN,[ + AC_CACHE_CHECK([for field sa_len in struct sockaddr],ac_cv_sockaddr_sa_len,[ + AC_TRY_COMPILE([#include <sys/types.h> +#include <sys/socket.h>], + [struct sockaddr s; s.sa_len;], + [ac_cv_sockaddr_sa_len=yes + AC_DEFINE(HAVE_SOCKADDR_SA_LEN)], + [ac_cv_sockaddr_sa_len=no]) + ]) +]) + +dnl ## PHP_AC_OUTPUT(file) +dnl ## adds "file" to the list of files generated by AC_OUTPUT +dnl ## This macro can be used several times. +AC_DEFUN(PHP_OUTPUT,[ + PHP_OUTPUT_FILES="$PHP_OUTPUT_FILES $1" +]) |