config.m4 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. dnl
  2. dnl $Id$
  3. dnl
  4. PHP_ARG_ENABLE(posix,whether to enable POSIX-like functions,
  5. [ --disable-posix Disable POSIX-like functions], yes)
  6. if test "$PHP_POSIX" = "yes"; then
  7. AC_DEFINE(HAVE_POSIX, 1, [whether to include POSIX-like functions])
  8. PHP_NEW_EXTENSION(posix, posix.c, $ext_shared)
  9. AC_CHECK_HEADERS(sys/mkdev.h)
  10. AC_CHECK_FUNCS(seteuid setegid setsid getsid setpgid getpgid ctermid mkfifo mknod getrlimit getlogin getgroups makedev initgroups getpwuid_r getgrgid_r)
  11. AC_MSG_CHECKING([for working ttyname_r() implementation])
  12. AC_TRY_RUN([
  13. #include <unistd.h>
  14. int main(int argc, char *argv[])
  15. {
  16. char buf[64];
  17. return ttyname_r(0, buf, 64) ? 1 : 0;
  18. }
  19. ],[
  20. AC_MSG_RESULT([yes])
  21. AC_DEFINE(HAVE_TTYNAME_R, 1, [Whether you have a working ttyname_r])
  22. ],[
  23. AC_MSG_RESULT([no, posix_ttyname() will be thread-unsafe])
  24. ], [
  25. AC_MSG_RESULT([no, cannot detect working ttyname_r() when cross compiling. posix_ttyname() will be thread-unsafe])
  26. ])
  27. AC_CACHE_CHECK([for utsname.domainname], ac_cv_have_utsname_domainname, [
  28. AC_TRY_COMPILE([
  29. #define _GNU_SOURCE
  30. #include <sys/utsname.h>
  31. ],[
  32. return sizeof(((struct utsname *)0)->domainname);
  33. ],[
  34. ac_cv_have_utsname_domainname=yes
  35. ],[
  36. ac_cv_have_utsname_domainname=no
  37. ])
  38. ])
  39. if test "$ac_cv_have_utsname_domainname" = yes; then
  40. AC_DEFINE(HAVE_UTSNAME_DOMAINNAME, 1, [Whether struct utsname has domainname])
  41. fi
  42. fi