1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 02:33:17 +02:00

move PHP_TEST_WRITE_STDOUT to acinclude.m4 and use it in configure.in

its result is used in sapi/cli & sapi/embed, not just sapi/cgi
This commit is contained in:
Antony Dovgal
2007-02-20 20:10:53 +00:00
parent 2ad6c07ca1
commit 389e17332e
3 changed files with 33 additions and 32 deletions
+30
View File
@@ -2712,3 +2712,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
])
+3
View File
@@ -286,6 +286,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
-32
View File
@@ -10,36 +10,6 @@ AC_ARG_ENABLE(cgi,
PHP_SAPI_CGI=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
@@ -82,8 +52,6 @@ if test "$PHP_SAPI" = "default"; then
esac
PHP_SUBST(SAPI_CGI_PATH)
PHP_TEST_WRITE_STDOUT
INSTALL_IT="@echo \"Installing PHP CGI into: \$(INSTALL_ROOT)\$(bindir)/\"; \$(INSTALL) -m 0755 \$(SAPI_CGI_PATH) \$(INSTALL_ROOT)\$(bindir)/\$(program_prefix)php\$(program_suffix)\$(EXEEXT)"
PHP_SELECT_SAPI(cgi, program, fastcgi.c cgi_main.c getopt.c, , '$(SAPI_CGI_PATH)')