diff options
Diffstat (limited to 'ext/sockets/config.m4')
| -rw-r--r-- | ext/sockets/config.m4 | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/ext/sockets/config.m4 b/ext/sockets/config.m4 index 574548d605..4032621ce6 100644 --- a/ext/sockets/config.m4 +++ b/ext/sockets/config.m4 @@ -18,8 +18,8 @@ if test "$PHP_SOCKETS" != "no"; then AC_DEFINE(HAVE_CMSGHDR,1,[Whether you have struct cmsghdr]) fi - AC_CHECK_FUNCS([hstrerror socketpair]) - AC_CHECK_HEADERS([netdb.h netinet/tcp.h sys/un.h errno.h]) + AC_CHECK_FUNCS([hstrerror socketpair if_nametoindex if_indextoname]) + AC_CHECK_HEADERS([netdb.h netinet/tcp.h sys/un.h sys/sockio.h errno.h]) AC_TRY_COMPILE([ #include <sys/types.h> #include <sys/socket.h> @@ -27,7 +27,22 @@ if test "$PHP_SOCKETS" != "no"; then [AC_DEFINE(MISSING_MSGHDR_MSGFLAGS, 1, [ ])] ) AC_DEFINE([HAVE_SOCKETS], 1, [ ]) + + dnl Check for fied ss_family in sockaddr_storage (missing in AIX until 5.3) + AC_CACHE_CHECK([for field ss_family in struct sockaddr_storage], ac_cv_ss_family, + [ + AC_TRY_COMPILE([ +#include <sys/socket.h> +#include <sys/types.h> +#include <netdb.h> + ], [struct sockaddr_storage sa_store; sa_store.ss_family = AF_INET6;], + ac_cv_ss_family=yes, ac_cv_ss_family=no) + ]) + + if test "$ac_cv_ss_family" = yes; then + AC_DEFINE(HAVE_SA_SS_FAMILY,1,[Whether you have sockaddr_storage.ss_family]) + fi - PHP_NEW_EXTENSION([sockets], [sockets.c], [$ext_shared]) + PHP_NEW_EXTENSION([sockets], [sockets.c multicast.c], [$ext_shared]) PHP_INSTALL_HEADERS([ext/sockets/], [php_sockets.h]) fi |
