You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
977 B

24 years ago
  1. dnl
  2. dnl $Id$
  3. dnl
  4. PHP_ARG_ENABLE(sockets, whether to enable sockets support,
  5. [ --enable-sockets Enable sockets support])
  6. if test "$PHP_SOCKETS" != "no"; then
  7. dnl Check for struct cmsghdr
  8. AC_CACHE_CHECK([for struct cmsghdr], ac_cv_cmsghdr,
  9. [
  10. AC_TRY_COMPILE([
  11. #include <sys/types.h>
  12. #include <sys/socket.h>], [struct cmsghdr s; s], ac_cv_cmsghdr=yes, ac_cv_cmsghdr=no)
  13. ])
  14. if test "$ac_cv_cmsghdr" = yes; then
  15. AC_DEFINE(HAVE_CMSGHDR,1,[Whether you have struct cmsghdr])
  16. fi
  17. AC_CHECK_FUNCS([hstrerror socketpair if_nametoindex])
  18. AC_CHECK_HEADERS([netdb.h netinet/tcp.h sys/un.h errno.h])
  19. AC_TRY_COMPILE([
  20. #include <sys/types.h>
  21. #include <sys/socket.h>
  22. ], [static struct msghdr tp; int n = (int) tp.msg_flags; return n],[],
  23. [AC_DEFINE(MISSING_MSGHDR_MSGFLAGS, 1, [ ])]
  24. )
  25. AC_DEFINE([HAVE_SOCKETS], 1, [ ])
  26. PHP_NEW_EXTENSION([sockets], [sockets.c multicast.c], [$ext_shared])
  27. PHP_INSTALL_HEADERS([ext/sockets/], [php_sockets.h])
  28. fi