summaryrefslogtreecommitdiff
path: root/ext/posix/config.m4
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2013-03-14 05:42:27 +0000
committer <>2013-04-03 16:25:08 +0000
commitc4dd7a1a684490673e25aaf4fabec5df138854c4 (patch)
tree4d57c44caae4480efff02b90b9be86f44bf25409 /ext/posix/config.m4
downloadphp2-master.tar.gz
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/posix/config.m4')
-rw-r--r--ext/posix/config.m450
1 files changed, 50 insertions, 0 deletions
diff --git a/ext/posix/config.m4 b/ext/posix/config.m4
new file mode 100644
index 0000000..83ead2e
--- /dev/null
+++ b/ext/posix/config.m4
@@ -0,0 +1,50 @@
+dnl
+dnl $Id$
+dnl
+
+PHP_ARG_ENABLE(posix,whether to enable POSIX-like functions,
+[ --disable-posix Disable POSIX-like functions], yes)
+
+if test "$PHP_POSIX" = "yes"; then
+ AC_DEFINE(HAVE_POSIX, 1, [whether to include POSIX-like functions])
+ PHP_NEW_EXTENSION(posix, posix.c, $ext_shared)
+
+ AC_CHECK_HEADERS(sys/mkdev.h)
+
+ AC_CHECK_FUNCS(seteuid setegid setsid getsid setpgid getpgid ctermid mkfifo mknod getrlimit getlogin getgroups makedev initgroups getpwuid_r getgrgid_r)
+
+ AC_MSG_CHECKING([for working ttyname_r() implementation])
+ AC_TRY_RUN([
+#include <unistd.h>
+
+int main(int argc, char *argv[])
+{
+ char buf[64];
+
+ return ttyname_r(0, buf, 64) ? 1 : 0;
+}
+ ],[
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_TTYNAME_R, 1, [Whether you have a working ttyname_r])
+ ],[
+ AC_MSG_RESULT([no, posix_ttyname() will be thread-unsafe])
+ ], [
+ AC_MSG_RESULT([no, cannot detect working ttyname_r() when cross compiling. posix_ttyname() will be thread-unsafe])
+ ])
+
+ AC_CACHE_CHECK([for utsname.domainname], ac_cv_have_utsname_domainname, [
+ AC_TRY_COMPILE([
+ #define _GNU_SOURCE
+ #include <sys/utsname.h>
+ ],[
+ return sizeof(((struct utsname *)0)->domainname);
+ ],[
+ ac_cv_have_utsname_domainname=yes
+ ],[
+ ac_cv_have_utsname_domainname=no
+ ])
+ ])
+ if test "$ac_cv_have_utsname_domainname" = yes; then
+ AC_DEFINE(HAVE_UTSNAME_DOMAINNAME, 1, [Wether struct utsname has domainname])
+ fi
+fi