The following patch enables a CLI build without
having CGI. Any suggestions?

marcus

diff -u -w -r1.163 acinclude.m4
--- acinclude.m4        13 Mar 2002 16:59:49 -0000      1.163
+++ acinclude.m4        17 Mar 2002 17:14:09 -0000
@@ -126,6 +126,14 @@
  ])

  dnl
+dnl Disable building CGI
+dnl
+AC_DEFUN(PHP_DISABLE_CGI,[
+  disable_cgi=1
+])
+
+
+dnl
  dnl Separator into the configure --help display.
  dnl
  AC_DEFUN(PHP_HELP_SEPARATOR,[
Index: configure.in
===================================================================
RCS file: /repository/php4/configure.in,v
retrieving revision 1.319
diff -u -w -r1.319 configure.in
--- configure.in        15 Mar 2002 21:02:54 -0000      1.319
+++ configure.in        17 Mar 2002 17:14:10 -0000
@@ -239,9 +239,16 @@

  esyscmd(./scripts/config-stubs sapi)

-if test "$PHP_SAPI" = "default"; then
+if test "$PHP_SAPI" = "default"; && test "$disable_cgi" != "1"; then
    PHP_SELECT_SAPI(cgi, program, cgi_main.c getopt.c)
  fi
+if test "$PHP_SAPI" = "default"; && test "$disable_cli" != "1"; then
+  PHP_SAPI=cli
+fi
+if test "$PHP_SAPI" = "cli"; then
+  PHP_DISABLE_CLI
+  PHP_SELECT_SAPI(cli, program, php_cli.c getopt.c)
+fi

  AC_MSG_CHECKING([for chosen SAPI module])
  AC_MSG_RESULT([$PHP_SAPI])
@@ -1094,7 +1101,11 @@

  PHP_ADD_BUILD_DIR(main)
  PHP_ADD_BUILD_DIR(regex)
-PHP_ADD_BUILD_DIR(sapi/$PHP_SAPI sapi/cli)
+PHP_ADD_BUILD_DIR(sapi/$PHP_SAPI)
+dnl Do not include cli if it is already invoked from PHP_SAPI
+if test "$PHP_SAPI" != "cli"; then
+  PHP_ADD_BUILD_DIR(sapi/cli)
+fi
  PHP_ADD_BUILD_DIR(TSRM)
  PHP_ADD_BUILD_DIR(Zend)

Index: sapi/cgi/config.m4
===================================================================
RCS file: /repository/php4/sapi/cgi/config.m4,v
retrieving revision 1.13
diff -u -w -r1.13 config.m4
--- sapi/cgi/config.m4  7 Mar 2002 14:19:51 -0000       1.13
+++ sapi/cgi/config.m4  17 Mar 2002 17:14:10 -0000
@@ -2,6 +2,22 @@
  dnl $Id: config.m4,v 1.13 2002/03/07 14:19:51 sas Exp $
  dnl

+AC_MSG_CHECKING(for CGI build)
+
+AC_ARG_ENABLE(cgi,
+[  --disable-cgi           Disable building CGI version of PHP.],
+[
+  if test "$enable_cgi" != "no"; then
+    PHP_SAPI_CGI=yes
+  else
+    PHP_SAPI_CGI=no
+  fi
+],
+[PHP_SAPI_CGI=yes]
+)
+
+if test "$PHP_SAPI_CGI" != "no"; then
+
  AC_DEFUN(PHP_TEST_WRITE_STDOUT,[
    AC_CACHE_CHECK(whether writing to stdout works,ac_cv_write_stdout,[
      AC_TRY_RUN([
@@ -97,3 +113,9 @@
  dnl## AC_SUBST(FHTTPD_INCLUDE)
  PHP_SUBST(FHTTPD_LIB)
  PHP_SUBST(FHTTPD_TARGET)
+
+else
+  PHP_DISABLE_CGI
+fi
+
+AC_MSG_RESULT($PHP_SAPI_CGI)




-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to