Here is the second part of adding cli sapi wich would be built no matter
what other sapi was selected. My plan is to commit it later today, unless
someone reviews the patch and finds some problems with it.

There is one known problem. If you select cgi sapi, make install we
overwrite cgi binary with cli binary in $(bindir)/php. One of them would
either have to be renamed, or installed in a different dir. They are both
compiled correctly: cgi in $srcdir and cli in $srcdir/sapi/cli.

And I need some sleep :)

Edin
Index: Makefile.in
===================================================================
RCS file: /repository/php4/Makefile.in,v
retrieving revision 1.102
diff -u -3 -p -r1.102 Makefile.in
--- Makefile.in 1 Oct 2001 21:03:05 -0000       1.102
+++ Makefile.in 12 Jan 2002 08:13:16 -0000
@@ -1,6 +1,6 @@
 
 ZEND_DIR = $(srcdir)/Zend
-SUBDIRS = Zend main ext sapi $(TSRM_DIR) $(REGEX_DIR) . $(PEAR_DIR)
+SUBDIRS = Zend main ext sapi $(TSRM_DIR) $(REGEX_DIR) . sapi/cli $(PEAR_DIR)
 
 LTLIBRARY_NAME = libphp4.la
 LTLIBRARY_SOURCES = stub.c
Index: acinclude.m4
===================================================================
RCS file: /repository/php4/acinclude.m4,v
retrieving revision 1.147
diff -u -3 -p -r1.147 acinclude.m4
--- acinclude.m4        9 Jan 2002 03:40:51 -0000       1.147
+++ acinclude.m4        12 Jan 2002 08:13:17 -0000
@@ -930,7 +930,7 @@ dnl ------------------------------------
   if test "$2" != "shared" && test "$2" != "yes"; then
 dnl ---------------------------------------------- Static module
     LIB_BUILD($ext_builddir)
-    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/lib$1.la"
+    EXT_LTLIBS="$EXT_LTLIBS $abs_srcdir/$ext_builddir/lib$1.la"
     EXT_STATIC="$EXT_STATIC $1"
   else 
 dnl ---------------------------------------------- Shared module
Index: configure.in
===================================================================
RCS file: /repository/php4/configure.in,v
retrieving revision 1.288
diff -u -3 -p -r1.288 configure.in
--- configure.in        9 Jan 2002 03:41:48 -0000       1.288
+++ configure.in        12 Jan 2002 08:13:17 -0000
@@ -5,7 +5,7 @@ divert(1)
 
 AC_INIT(README.CVS-RULES)
 
-PHP_FAST_OUTPUT(sapi/Makefile ext/Makefile Makefile pear/Makefile main/Makefile)
+PHP_FAST_OUTPUT(sapi/Makefile ext/Makefile Makefile pear/Makefile main/Makefile 
+sapi/cli/Makefile)
 
 if test "$with_shared_apache" != "no" && test -n "$with_shared_apache" ; then
   AC_MSG_ERROR([--with-shared-apache is not supported. Please refer to the 
documentation for using APXS])
Index: sapi/cli/.cvsignore
===================================================================
RCS file: /repository/php4/sapi/cli/.cvsignore,v
retrieving revision 1.1
diff -u -3 -p -r1.1 .cvsignore
--- sapi/cli/.cvsignore 6 Jan 2002 14:08:14 -0000       1.1
+++ sapi/cli/.cvsignore 12 Jan 2002 08:13:34 -0000
@@ -8,3 +8,5 @@ Release_TS_inline
 Release_TS
 Debug_TS
 *.plg
+php
+php.cli
Index: sapi/cli/Makefile.in
===================================================================
RCS file: /repository/php4/sapi/cli/Makefile.in,v
retrieving revision 1.1
diff -u -3 -p -r1.1 Makefile.in
--- sapi/cli/Makefile.in        6 Jan 2002 14:08:14 -0000       1.1
+++ sapi/cli/Makefile.in        12 Jan 2002 08:13:34 -0000
@@ -1,5 +1,25 @@
+LTLIBRARY_NAME = libphp4cli.la
+LTLIBRARY_SOURCES = $(top_srcdir)/stub.c php_cli.c getopt.c
 
-LTLIBRARY_NAME    = libsapi.la
-LTLIBRARY_SOURCES = php_cli.c getopt.c
+LTLIBRARY_DEPENDENCIES = \
+               $(top_srcdir)/Zend/libZend.la \
+               $(top_srcdir)/main/libmain.la \
+               $(top_srcdir)/$(REGEX_LIB) \
+               $(EXT_LTLIBS) \
+               $(top_srcdir)/$(TSRM_LIB)
 
-include $(top_srcdir)/build/ltlib.mk
+LTLIBRARY_LDFLAGS = -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS)
+LTLIBRARY_LIBADD = $(LTLIBRARY_DEPENDENCIES) $(EXTRA_LIBS)
+
+
+PROGRAM_NAME         = php
+PROGRAM_SOURCES      = $(top_srcdir)/stub.c
+PROGRAM_LDADD        = libphp4cli.la $(EXT_PROGRAM_LDADD)
+PROGRAM_LDFLAGS      = -export-dynamic
+PROGRAM_DEPENDENCIES = $(PROGRAM_LDADD)
+
+targets = $(LTLIBRARY_NAME) $(PROGRAM_NAME)
+
+include $(top_srcdir)/build/rules.mk
+include $(top_srcdir)/build/library.mk
+include $(top_srcdir)/build/program.mk
Index: sapi/cli/config.m4
===================================================================
RCS file: /repository/php4/sapi/cli/config.m4,v
retrieving revision 1.1
diff -u -3 -p -r1.1 config.m4
--- sapi/cli/config.m4  6 Jan 2002 14:08:14 -0000       1.1
+++ sapi/cli/config.m4  12 Jan 2002 08:13:34 -0000
@@ -2,20 +2,9 @@ dnl
 dnl $Id: config.m4,v 1.1 2002/01/06 14:08:14 edink Exp $
 dnl
 
+dnl Just for fun (not actually need)
 AC_MSG_CHECKING(for CLI build)
-AC_ARG_WITH(cli,
-[  --with-cli              Build PHP as CLI application],[
-  if test "$withval" = "yes"; then
-        CLIPATH=/usr/local
-  else
-        CLIPATH=$withval
-  fi
-  PHP_SAPI=cli
-  PHP_PROGRAM=php
-  INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_PROGRAM \$(bindir)/$PHP_PROGRAM"
-  RESULT=yes
-  PHP_SUBST(EXT_PROGRAM_LDADD)
-],[
-  RESULT=no
-])
-AC_MSG_RESULT($RESULT)
+AC_MSG_RESULT(yes)
+
+INSTALL_IT="$INSTALL_IT; \$(INSTALL) -m 0755 sapi/cli/php \$(INSTALL_ROOT)\$(bindir)/"
+

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to