version 1.1, 2012/02/21 23:48:06
|
version 1.1.1.3, 2013/10/14 08:02:45
|
Line 8 PHP_ARG_ENABLE(cgi,,
|
Line 8 PHP_ARG_ENABLE(cgi,,
|
dnl |
dnl |
dnl CGI setup |
dnl CGI setup |
dnl |
dnl |
AC_MSG_CHECKING(whether to build CGI binary) | AC_MSG_CHECKING(for CGI build) |
if test "$PHP_CGI" != "no"; then | if test "$PHP_CGI" != "no"; then |
AC_MSG_RESULT(yes) |
AC_MSG_RESULT(yes) |
|
|
AC_MSG_CHECKING([for socklen_t in sys/socket.h]) |
AC_MSG_CHECKING([for socklen_t in sys/socket.h]) |
AC_EGREP_HEADER([socklen_t], [sys/socket.h], |
AC_EGREP_HEADER([socklen_t], [sys/socket.h], |
[AC_MSG_RESULT([yes]) |
[AC_MSG_RESULT([yes]) |
Line 49 dnl
|
Line 48 dnl
|
SAPI_CGI_PATH=sapi/cgi/php-cgi |
SAPI_CGI_PATH=sapi/cgi/php-cgi |
;; |
;; |
esac |
esac |
PHP_SUBST(SAPI_CGI_PATH) |
|
|
|
dnl Set install target and select SAPI | dnl Select SAPI |
INSTALL_CGI="@echo \"Installing PHP CGI binary: \$(INSTALL_ROOT)\$(bindir)/\"; \$(INSTALL) -m 0755 \$(SAPI_CGI_PATH) \$(INSTALL_ROOT)\$(bindir)/\$(program_prefix)php-cgi\$(program_suffix)\$(EXEEXT)" | PHP_SELECT_SAPI(cgi, program, cgi_main.c fastcgi.c,, '$(SAPI_CGI_PATH)') |
PHP_ADD_SOURCES(sapi/cgi, cgi_main.c fastcgi.c,, cgi) | |
PHP_ADD_SOURCES(/main, internal_functions.c,,cgi) | |
|
|
case $host_alias in |
case $host_alias in |
*aix*) |
*aix*) |
BUILD_CGI="echo '\#! .' > php.sym && echo >>php.sym && nm -BCpg \`echo \$(PHP_GLOBAL_OBJS) \$(PHP_SAPI_OBJS) | sed 's/\([A-Za-z0-9_]*\)\.lo/\1.o/g'\` | \$(AWK) '{ if (((\$\$2 == \"T\") || (\$\$2 == \"D\") || (\$\$2 == \"B\")) && (substr(\$\$3,1,1) != \".\")) { print \$\$3 } }' | sort -u >> php.sym && \$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) -Wl,-brtl -Wl,-bE:php.sym \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_SAPI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)" | if test "$php_sapi_module" = "shared"; then |
| BUILD_CGI="echo '\#! .' > php.sym && echo >>php.sym && nm -BCpg \`echo \$(PHP_GLOBAL_OBJS) \$(PHP_BINARY_OBJS) \$(PHP_CGI_OBJS) | sed 's/\([A-Za-z0-9_]*\)\.lo/.libs\/\1.o/g'\` | \$(AWK) '{ if (((\$\$2 == \"T\") || (\$\$2 == \"D\") || (\$\$2 == \"B\")) && (substr(\$\$3,1,1) != \".\")) { print \$\$3 } }' | sort -u >> php.sym && \$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) -Wl,-brtl -Wl,-bE:php.sym \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_CGI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)" |
| else |
| BUILD_CGI="echo '\#! .' > php.sym && echo >>php.sym && nm -BCpg \`echo \$(PHP_GLOBAL_OBJS) \$(PHP_BINARY_OBJS) \$(PHP_CGI_OBJS) | sed 's/\([A-Za-z0-9_]*\)\.lo/\1.o/g'\` | \$(AWK) '{ if (((\$\$2 == \"T\") || (\$\$2 == \"D\") || (\$\$2 == \"B\")) && (substr(\$\$3,1,1) != \".\")) { print \$\$3 } }' | sort -u >> php.sym && \$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) -Wl,-brtl -Wl,-bE:php.sym \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_CGI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)" |
| fi |
;; |
;; |
*darwin*) |
*darwin*) |
BUILD_CGI="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_SAPI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)" | BUILD_CGI="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_BINARY_OBJS:.lo=.o) \$(PHP_CGI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)" |
;; |
;; |
*) |
*) |
BUILD_CGI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_CGI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)" | BUILD_CGI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_BINARY_OBJS) \$(PHP_CGI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)" |
;; |
;; |
esac |
esac |
|
|
PHP_CGI_TARGET="\$(SAPI_CGI_PATH)" | dnl Expose to Makefile |
PHP_INSTALL_CGI_TARGET="install-cgi" | PHP_SUBST(SAPI_CGI_PATH) |
PHP_SUBST(BUILD_CGI) |
PHP_SUBST(BUILD_CGI) |
PHP_SUBST(INSTALL_CGI) |
|
PHP_SUBST(PHP_CGI_OBJS) |
|
PHP_SUBST(PHP_CGI_TARGET) |
|
PHP_SUBST(PHP_INSTALL_CGI_TARGET) |
|
|
|
if test "$PHP_SAPI" = "default" ; then | PHP_OUTPUT(sapi/cgi/php-cgi.1) |
PHP_BUILD_PROGRAM($SAPI_CGI_PATH) | else |
fi | AC_MSG_RESULT(yes) |
else | |
AC_MSG_RESULT(no) | |
if test "$PHP_SAPI" = "default" ; then | |
if test "$PHP_CLI" != "no" ; then | |
OVERALL_TARGET= | |
PHP_SAPI=cli | |
else | |
AC_MSG_ERROR([No SAPIs selected.]) | |
fi | |
fi | |
fi |
fi |