diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index bbcdc7f7831d5..f63ccbfc5b541 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -78,9 +78,8 @@ #include "php_getopt.h" -#include "fcgi_config.h" -#include "fcgiapp.h" -/* don't want to include fcgios.h, causes conflicts */ +#include "fastcgi.h" + #ifdef PHP_WIN32 extern int OS_SetImpersonate(void); #else diff --git a/sapi/cgi/config.w32 b/sapi/cgi/config.w32 index 001cef43e0614..18dbc69dc17b1 100644 --- a/sapi/cgi/config.w32 +++ b/sapi/cgi/config.w32 @@ -4,7 +4,6 @@ ARG_ENABLE('cgi', 'Build CGI version of PHP', 'yes'); if (PHP_CGI == "yes") { - SAPI('cgi', 'cgi_main.c getopt.c', 'php-cgi.exe', '/I sapi/cgi/libfcgi/include /D FCGI_STATIC'); - ADD_SOURCES('sapi/cgi/libfcgi', 'fcgi_stdio.c fcgiapp.c os_win32.c', 'cgi'); + SAPI('cgi', 'cgi_main.c getopt.c fastcgi.c', 'php-cgi.exe'); ADD_FLAG('LIBS_CGI', 'ws2_32.lib kernel32.lib advapi32.lib'); } diff --git a/sapi/cgi/config9.m4 b/sapi/cgi/config9.m4 index 35f6fe12b2e1a..18df6df3a73fc 100644 --- a/sapi/cgi/config9.m4 +++ b/sapi/cgi/config9.m4 @@ -45,6 +45,32 @@ if test "$PHP_SAPI" = "default"; then if test "$PHP_SAPI_CGI" != "no"; then AC_MSG_RESULT(yes) + AC_MSG_CHECKING([for socklen_t in sys/socket.h]) + AC_EGREP_HEADER([socklen_t], [sys/socket.h], + [AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_SOCKLEN_T], [1], + [Define if the socklen_t typedef is in sys/socket.h])], + AC_MSG_RESULT([no])) + + AC_MSG_CHECKING([for sun_len in sys/un.h]) + AC_EGREP_HEADER([sun_len], [sys/un.h], + [AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_SOCKADDR_UN_SUN_LEN], [1], + [Define if sockaddr_un in sys/un.h contains a sun_len component])], + AC_MSG_RESULT([no])) + + AC_MSG_CHECKING([whether cross-process locking is required by accept()]) + case "`uname -sr`" in + IRIX\ 5.* | SunOS\ 5.* | UNIX_System_V\ 4.0) + AC_MSG_RESULT([yes]) + AC_DEFINE([USE_LOCKING], [1], + [Define if cross-process locking is required by accept()]) + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac + PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/sapi/cgi/Makefile.frag) case $host_alias in *cygwin* ) @@ -58,11 +84,8 @@ if test "$PHP_SAPI" = "default"; then PHP_TEST_WRITE_STDOUT - PHP_ADD_BUILD_DIR($abs_builddir/sapi/cgi/libfcgi) - PHP_FCGI_INCLUDE="-I$abs_srcdir/sapi/cgi/libfcgi/include" - 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, libfcgi/fcgi_stdio.c libfcgi/fcgiapp.c libfcgi/os_unix.c cgi_main.c getopt.c, $PHP_FCGI_INCLUDE, '$(SAPI_CGI_PATH)') + PHP_SELECT_SAPI(cgi, program, fastcgi.c cgi_main.c getopt.c, '', '$(SAPI_CGI_PATH)') case $host_alias in *aix*)