sniper Sun Oct 20 23:12:27 2002 EDT
Added files:
/php4/sapi/cgi config9.m4
Removed files:
/php4/sapi/cgi config.m4
Modified files:
/php4 acinclude.m4 configure.in
Log:
- Moved CGI specific lines from configure.in to sapi/cgi/config9.m4
which is 'executed' last of the SAPI config.m4's.
- Added --disable-cgi option. (was possible only with above change)
- Made the sed check to not test for the possibly working sed on Solaris
since that would make the test quite useless. (compile would still fail)
# That sed check is not enabled yet..need to know whether we fail
# during configure or just put out a warning about possible non-working
# sed. As even plain ./configure doesn't work in most cases, I think
# it would be better to just fail during configure and let the users
# fix their paths/install GNU sed.
Index: php4/acinclude.m4
diff -u php4/acinclude.m4:1.212 php4/acinclude.m4:1.213
--- php4/acinclude.m4:1.212 Wed Oct 16 12:21:13 2002
+++ php4/acinclude.m4 Sun Oct 20 23:12:27 2002
@@ -1,4 +1,4 @@
-dnl $Id: acinclude.m4,v 1.212 2002/10/16 16:21:13 sniper Exp $
+dnl $Id: acinclude.m4,v 1.213 2002/10/21 03:12:27 sniper Exp $
dnl
dnl This file contains local autoconf functions.
@@ -1777,9 +1777,8 @@
}
_max=0
_count=0
- # Add /usr/xpg4/bin/sed as it is typically found on Solaris
# along with /bin/sed that truncates output.
- for _sed in $_sed_list /usr/xpg4/bin/sed; do
+ for _sed in $_sed_list; do
test ! -f ${_sed} && break
cat /dev/null > "$tmp/sed.in"
_count=0
@@ -1811,6 +1810,7 @@
AC_MSG_ERROR([Could not find working sed on this system. Please install GNU sed.])
else
SED=$ac_cv_path_sed
+ PHP_SUBST(SED)
AC_MSG_RESULT([$SED])
fi
])
Index: php4/configure.in
diff -u php4/configure.in:1.384 php4/configure.in:1.385
--- php4/configure.in:1.384 Sun Oct 20 09:45:59 2002
+++ php4/configure.in Sun Oct 20 23:12:27 2002
@@ -1,4 +1,4 @@
-dnl ## $Id: configure.in,v 1.384 2002/10/20 13:45:59 wez Exp $ -*- sh -*-
+dnl ## $Id: configure.in,v 1.385 2002/10/21 03:12:27 sniper Exp $ -*- sh -*-
dnl ## Process this file with autoconf to produce a configure script.
divert(1)
@@ -127,6 +127,9 @@
dnl check for -R, etc. switch
PHP_RUNPATH_SWITCH
+dnl check for working sed (disabled for now, waiting for comments)
+dnl PHP_PROG_SED
+
AC_PROG_RANLIB
AC_PROG_LN_S
AC_PROG_AWK
@@ -223,10 +226,7 @@
esyscmd(./scripts/config-stubs sapi)
-if test "$PHP_SAPI" = "default"; then
- PHP_SELECT_SAPI(cgi, program, cgi_main.c getopt.c,,'$(SAPI_CGI_PATH)')
-fi
-
+dnl Show which main SAPI was selected
AC_MSG_CHECKING([for chosen SAPI module])
AC_MSG_RESULT([$PHP_SAPI])
Index: php4/sapi/cgi/config9.m4
+++ php4/sapi/cgi/config9.m4
dnl
dnl $Id: config9.m4,v 1.1 2002/10/21 03:12:27 sniper Exp $
dnl
AC_ARG_ENABLE(cgi,
[ --disable-cgi Disable building CGI version of PHP],
[
PHP_SAPI_CGI=$enableval
],[
PHP_SAPI_CGI=yes
])
AC_ARG_ENABLE(force-cgi-redirect,
[ --enable-force-cgi-redirect
Enable the security check for internal server
redirects. You should use this if you are
running the CGI version with Apache.],
[
PHP_FORCE_CGI_REDIRECT=$enableval
],[
PHP_FORCE_CGI_REDIRECT=no
])
AC_ARG_ENABLE(discard-path,
[ --enable-discard-path If this is enabled, the PHP CGI binary
can safely be placed outside of the
web tree and people will not be able
to circumvent .htaccess security.],
[
PHP_DISCARD_PATH=$enableval
],[
PHP_DISCARD_PATH=no
])
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
AC_MSG_RESULT(yes)
PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/sapi/cgi/Makefile.frag)
SAPI_CGI_PATH=sapi/cgi/php-cgi
PHP_SUBST(SAPI_CGI_PATH)
PHP_TEST_WRITE_STDOUT
AC_MSG_CHECKING(whether to force Apache CGI redirect)
if test "$PHP_FORCE_CGI_REDIRECT" = "yes"; then
REDIRECT=1
else
REDIRECT=0
fi
AC_DEFINE_UNQUOTED(FORCE_CGI_REDIRECT,$REDIRECT,[ ])
AC_MSG_RESULT($PHP_FORCE_CGI_REDIRECT)
AC_MSG_CHECKING(whether to discard path_info + path_translated)
if test "$PHP_DISCARD_PATH" = "yes"; then
DISCARD_PATH=1
else
DISCARD_PATH=0
fi
AC_DEFINE_UNQUOTED(DISCARD_PATH, $DISCARD_PATH, [ ])
AC_MSG_RESULT($PHP_DISCARD_PATH)
INSTALL_IT="\$(INSTALL) -m 0755 \$(SAPI_CGI_PATH)
\$(INSTALL_ROOT)\$(bindir)/php-cgi"
PHP_SELECT_SAPI(cgi, program, cgi_main.c getopt.c,,'$(SAPI_CGI_PATH)')
case $host_alias in
*darwin*)
BUILD_CGI="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS)
\$(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="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN)
\$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS)
\$(PHP_SAPI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)"
;;
esac
PHP_SUBST(BUILD_CGI)
elif test "$PHP_SAPI_CLI" != "no"; then
AC_MSG_RESULT(no)
OVERALL_TARGET=
PHP_SAPI=cli
else
AC_MSG_ERROR([No SAPIs selected.])
fi
fi
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php