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:
@@ -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
|
||||
])
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user