2002-10-21 03:12:27 +00:00
|
|
|
dnl
|
|
|
|
dnl $Id$
|
|
|
|
dnl
|
|
|
|
|
2007-07-11 23:20:37 +00:00
|
|
|
PHP_ARG_ENABLE(cgi,,
|
|
|
|
[ --disable-cgi Disable building CGI version of PHP], yes, no)
|
2002-10-21 03:12:27 +00:00
|
|
|
|
2007-07-11 23:20:37 +00:00
|
|
|
dnl
|
|
|
|
dnl CGI setup
|
|
|
|
dnl
|
2010-11-13 23:13:07 +00:00
|
|
|
AC_MSG_CHECKING(for CGI build)
|
|
|
|
if test "$PHP_CGI" != "no"; then
|
2002-10-21 03:12:27 +00:00
|
|
|
AC_MSG_RESULT(yes)
|
2007-09-27 08:23:58 +00:00
|
|
|
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
|
|
|
|
|
2002-10-21 03:12:27 +00:00
|
|
|
PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/sapi/cgi/Makefile.frag)
|
2007-07-11 23:20:37 +00:00
|
|
|
|
|
|
|
dnl Set filename
|
2002-12-09 17:02:38 +00:00
|
|
|
case $host_alias in
|
|
|
|
*cygwin* )
|
2007-05-24 23:29:59 +00:00
|
|
|
SAPI_CGI_PATH=sapi/cgi/php-cgi.exe
|
2002-12-09 17:02:38 +00:00
|
|
|
;;
|
|
|
|
* )
|
2007-05-24 23:29:59 +00:00
|
|
|
SAPI_CGI_PATH=sapi/cgi/php-cgi
|
2002-12-09 17:02:38 +00:00
|
|
|
;;
|
|
|
|
esac
|
2002-10-21 03:12:27 +00:00
|
|
|
|
2010-11-13 23:13:07 +00:00
|
|
|
dnl Select SAPI
|
2014-10-15 14:33:40 +00:00
|
|
|
PHP_SELECT_SAPI(cgi, program, cgi_main.c fastcgi.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1, '$(SAPI_CGI_PATH)')
|
2002-10-21 03:12:27 +00:00
|
|
|
|
|
|
|
case $host_alias in
|
2005-07-07 05:54:43 +00:00
|
|
|
*aix*)
|
2010-11-13 23:13:07 +00:00
|
|
|
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
|
2005-07-07 05:54:43 +00:00
|
|
|
;;
|
2002-10-21 03:12:27 +00:00
|
|
|
*darwin*)
|
2010-11-13 23:13:07 +00:00
|
|
|
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)"
|
2002-10-21 03:12:27 +00:00
|
|
|
;;
|
|
|
|
*)
|
2010-11-13 23:13:07 +00:00
|
|
|
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)"
|
2002-10-21 03:12:27 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2010-11-13 23:13:07 +00:00
|
|
|
dnl Expose to Makefile
|
|
|
|
PHP_SUBST(SAPI_CGI_PATH)
|
2002-10-21 03:12:27 +00:00
|
|
|
PHP_SUBST(BUILD_CGI)
|
2013-07-02 08:42:47 +00:00
|
|
|
|
|
|
|
PHP_OUTPUT(sapi/cgi/php-cgi.1)
|
2010-11-13 23:13:07 +00:00
|
|
|
else
|
|
|
|
AC_MSG_RESULT(yes)
|
2002-10-21 03:12:27 +00:00
|
|
|
fi
|