]> granicus.if.org Git - php/commitdiff
MFH: move PHP_TEST_WRITE_STDOUT to acinclude.m4 and use it in configure.in
authorAntony Dovgal <tony2001@php.net>
Tue, 20 Feb 2007 20:11:11 +0000 (20:11 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 20 Feb 2007 20:11:11 +0000 (20:11 +0000)
acinclude.m4
configure.in
sapi/cgi/config9.m4

index 751835fab8850c24a3552f30c2ecf7e5baaeab35..11dcad5917758d491739aa551fa4e29b87a40bb5 100644 (file)
@@ -2645,3 +2645,33 @@ php_cv_crypt_r_style=struct_crypt_data_gnu_source)
     AC_MSG_ERROR([Unable to detect data struct used by crypt_r])
   fi
 ])
+
+AC_DEFUN([PHP_TEST_WRITE_STDOUT],[
+  AC_CACHE_CHECK(whether writing to stdout works,ac_cv_write_stdout,[
+    AC_TRY_RUN([
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#define TEXT "This is the test message -- "
+
+main()
+{
+  int n;
+
+  n = write(1, TEXT, sizeof(TEXT)-1);
+  return (!(n == sizeof(TEXT)-1));
+}
+    ],[
+      ac_cv_write_stdout=yes
+    ],[
+      ac_cv_write_stdout=no
+    ],[
+      ac_cv_write_stdout=no
+    ])
+  ])
+  if test "$ac_cv_write_stdout" = "yes"; then
+    AC_DEFINE(PHP_WRITE_STDOUT, 1, [whether write(2) works])
+  fi
+])
+
index d3fa73e27421e73be5a3e823ce373d23d2137a35..da4bc76d8ae3a9b583edab1290078730e0faa05a 100644 (file)
@@ -288,6 +288,9 @@ PHP_EBCDIC
 dnl Check whether the system byte ordering is bigendian
 PHP_C_BIGENDIAN
 
+dnl Check whether writing to stdout works
+PHP_TEST_WRITE_STDOUT
+
 dnl Check for /usr/pkg/{lib,include} which is where NetBSD puts binary
 dnl and source packages.  This should be harmless on other OSs.
 if test -d /usr/pkg/include -a -d /usr/pkg/lib ; then
index b31adabaccca8e2974eb5b43e4ad77ddd40b104e..816cec799d8aa2b1b6869527cc3de6a61fda89c4 100644 (file)
@@ -50,36 +50,6 @@ AC_ARG_ENABLE(path-info-check,
   PHP_ENABLE_PATHINFO_CHECK=yes
 ])
 
-AC_DEFUN([PHP_TEST_WRITE_STDOUT],[
-  AC_CACHE_CHECK(whether writing to stdout works,ac_cv_write_stdout,[
-    AC_TRY_RUN([
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#define TEXT "This is the test message -- "
-        
-main()
-{
-  int n;
-
-  n = write(1, TEXT, sizeof(TEXT)-1);
-  return (!(n == sizeof(TEXT)-1));
-}
-    ],[
-      ac_cv_write_stdout=yes
-    ],[
-      ac_cv_write_stdout=no
-    ],[
-      ac_cv_write_stdout=no
-    ])
-  ])
-  if test "$ac_cv_write_stdout" = "yes"; then
-    AC_DEFINE(PHP_WRITE_STDOUT, 1, [whether write(2) works])
-  fi
-])
-
-
 if test "$PHP_SAPI" = "default"; then
   AC_MSG_CHECKING(for CGI build)
   if test "$PHP_SAPI_CGI" != "no"; then
@@ -96,8 +66,6 @@ if test "$PHP_SAPI" = "default"; then
     esac
     PHP_SUBST(SAPI_CGI_PATH)
 
-    PHP_TEST_WRITE_STDOUT
-
     AC_MSG_CHECKING(whether to force Apache CGI redirect)
     if test "$PHP_FORCE_CGI_REDIRECT" = "yes"; then
       REDIRECT=1