>     But one thing I know.
>
>     If you try to compile --with-pcntl now, and you use
>     --with-apxs, the ./configure process tries to be smart and
>     bails out, saying that pcntl does not work with apache sapi.
>
>     Seems we need some more smart changes to the build process.

This is bit dirty, but if you apply this patch it would enable any extension
that has PHP_EXTENSION(ext_name, $ext_shared, cli) in their config.m4 to be
linked only with the cli executable. The patch also modifies
ext/pcntl/config.m4 to make use of this.

Edin
Index: acinclude.m4
===================================================================
RCS file: /repository/php4/acinclude.m4,v
retrieving revision 1.148
diff -u -3 -p -r1.148 acinclude.m4
--- acinclude.m4        12 Jan 2002 14:51:54 -0000      1.148
+++ acinclude.m4        13 Jan 2002 01:52:09 -0000
@@ -927,15 +927,24 @@ dnl ------------------------------------
     ext_srcdir=$abs_srcdir
   fi
 
-  if test "$2" != "shared" && test "$2" != "yes"; then
+  if test "$2" != "shared" && test "$2" != "yes" && test "$3" != "cli"; then
 dnl ---------------------------------------------- Static module
     LIB_BUILD($ext_builddir)
     EXT_LTLIBS="$EXT_LTLIBS $abs_srcdir/$ext_builddir/lib$1.la"
     EXT_STATIC="$EXT_STATIC $1"
-  else 
+  else
+    if test "$2" = "shared"; then
 dnl ---------------------------------------------- Shared module
-    LIB_BUILD($ext_builddir,yes)
-    AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z-,A-Z_), 1, Whether to build $1 as 
dynamic module)
+      LIB_BUILD($ext_builddir,yes)
+      AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z-,A-Z_), 1, Whether to build $1 
+as dynamic module)
+    fi
+  fi
+
+  if test "$2" != "shared" && test "$3" = "cli"; then
+dnl ---------------------------------------------- CLI static module
+    LIB_BUILD($ext_builddir)
+    EXT_CLI_LTLIBS="$EXT_LTLIBS $abs_srcdir/$ext_builddir/lib$1.la"
+    EXT_CLI_STATIC="$EXT_STATIC $1"
   fi
 
   PHP_FAST_OUTPUT($ext_builddir/Makefile)
Index: configure.in
===================================================================
RCS file: /repository/php4/configure.in,v
retrieving revision 1.289
diff -u -3 -p -r1.289 configure.in
--- configure.in        12 Jan 2002 14:51:54 -0000      1.289
+++ configure.in        13 Jan 2002 01:52:09 -0000
@@ -850,6 +850,7 @@ PHP_SUBST(EXT_STATIC)
 PHP_SUBST(EXT_SHARED)
 PHP_SUBST(EXT_LIBS)
 PHP_SUBST(EXT_LTLIBS)
+PHP_SUBST(EXT_CLI_LTLIBS)
 
 PHP_SUBST_OLD(abs_builddir)
 PHP_SUBST_OLD(abs_srcdir)
@@ -995,6 +996,11 @@ if test -n "\$REDO_ALL"; then
   extensions="$EXT_STATIC"
 dnl mv -f main/internal_functions.c main/internal_functions.c.old 2>/dev/null
   sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in $srcdir 
"$EXTRA_MODULE_PTRS" $AWK \$extensions > main/internal_functions.c
+
+  echo "creating sapi/cli/internal_functions_cli.c"
+  extensions="$EXT_STATIC $EXT_CLI_STATIC"
+  sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in $srcdir 
+"$EXTRA_MODULE_PTRS" $AWK \$extensions > sapi/cli/internal_functions_cli.c
+
 dnl  if cmp main/internal_functions.c.old main/internal_functions.c > /dev/null 2>&1; 
then
 dnl      echo "main/internal_functions.c is unchanged"
 dnl      mv main/internal_functions.c.old main/internal_functions.c
Index: ext/pcntl/config.m4
===================================================================
RCS file: /repository/php4/ext/pcntl/config.m4,v
retrieving revision 1.5
diff -u -3 -p -r1.5 config.m4
--- ext/pcntl/config.m4 4 Jan 2002 14:08:50 -0000       1.5
+++ ext/pcntl/config.m4 13 Jan 2002 01:52:11 -0000
@@ -9,11 +9,11 @@ PHP_ARG_ENABLE(pcntl, whether to enable 
 [  --enable-pcntl          Enable experimental pcntl support (CGI ONLY!)])
 
 if test "$PHP_PCNTL" != "no"; then
-       PHP_CHECK_STANDALONE(pcntl)
+dnl    PHP_CHECK_STANDALONE(pcntl)
  
   AC_CHECK_FUNCS(fork, [ AC_DEFINE(HAVE_FORK,1,[ ]) ], [ AC_MSG_ERROR(pcntl: fork() 
not supported by this platform) ])
   AC_CHECK_FUNCS(waitpid, [ AC_DEFINE(HAVE_WAITPID,1,[ ]) ], [ AC_MSG_ERROR(pcntl: 
fork() not supported by this platform) ])
   AC_CHECK_FUNCS(sigaction, [ AC_DEFINE(HAVE_SIGACTION,1,[ ]) ], [ 
AC_MSG_ERROR(pcntl: sigaction() not supported by this platform) ])
   
-  PHP_EXTENSION(pcntl, $ext_shared)
+  PHP_EXTENSION(pcntl, $ext_shared, cli)
 fi
Index: sapi/cgi/Makefile.in
===================================================================
RCS file: /repository/php4/sapi/cgi/Makefile.in,v
retrieving revision 1.6
diff -u -3 -p -r1.6 Makefile.in
--- sapi/cgi/Makefile.in        1 May 2000 22:38:36 -0000       1.6
+++ sapi/cgi/Makefile.in        13 Jan 2002 01:52:21 -0000
@@ -1,5 +1,5 @@
 
 LTLIBRARY_NAME    = libsapi.la
 LTLIBRARY_SOURCES = cgi_main.c getopt.c
-
+LTLIBRARY_LIBADD  = $(EXT_CLI_LTLIBS)
 include $(top_srcdir)/build/ltlib.mk
Index: sapi/cli/.cvsignore
===================================================================
RCS file: /repository/php4/sapi/cli/.cvsignore,v
retrieving revision 1.2
diff -u -3 -p -r1.2 .cvsignore
--- sapi/cli/.cvsignore 12 Jan 2002 14:51:54 -0000      1.2
+++ sapi/cli/.cvsignore 13 Jan 2002 01:52:21 -0000
@@ -10,3 +10,4 @@ Debug_TS
 *.plg
 php
 php.cli
+internal_functions_cli.c
Index: sapi/cli/Makefile.in
===================================================================
RCS file: /repository/php4/sapi/cli/Makefile.in,v
retrieving revision 1.3
diff -u -3 -p -r1.3 Makefile.in
--- sapi/cli/Makefile.in        12 Jan 2002 22:48:54 -0000      1.3
+++ sapi/cli/Makefile.in        13 Jan 2002 01:52:21 -0000
@@ -1,12 +1,24 @@
 LTLIBRARY_NAME = libphp4cli.la
-LTLIBRARY_SOURCES = $(top_srcdir)/stub.c php_cli.c getopt.c
+LTLIBRARY_SOURCES = $(top_srcdir)/stub.c php_cli.c getopt.c \
+       $(top_srcdir)/main/main.c internal_functions_cli.c \
+       $(top_srcdir)/main/snprintf.c $(top_srcdir)/main/php_sprintf.c \
+       $(top_srcdir)/main/safe_mode.c $(top_srcdir)/main/fopen_wrappers.c \
+       $(top_srcdir)/main/alloca.c $(top_srcdir)/main/php_ini.c \
+       $(top_srcdir)/main/SAPI.c $(top_srcdir)/main/rfc1867.c \
+       $(top_srcdir)/main/php_content_types.c $(top_srcdir)/main/strlcpy.c \
+       $(top_srcdir)/main/strlcat.c $(top_srcdir)/main/mergesort.c 
+$(top_srcdir)/main/reentrancy.c \
+       $(top_srcdir)/main/php_variables.c $(top_srcdir)/main/php_ticks.c \
+       $(top_srcdir)/main/streams.c $(top_srcdir)/main/network.c \
+       $(top_srcdir)/main/php_open_temporary_file.c $(top_srcdir)/main/php_logos.c \
+       $(top_srcdir)/main/output.c
 
 LTLIBRARY_DEPENDENCIES = \
                $(top_srcdir)/Zend/libZend.la \
-               $(top_srcdir)/main/libmain.la \
                $(top_srcdir)/$(REGEX_LIB) \
                $(EXT_LTLIBS) \
-               $(top_srcdir)/$(TSRM_LIB)
+               $(top_srcdir)/$(TSRM_LIB) \
+               $(EXT_CLI_LTLIBS) 
+
 
 LTLIBRARY_LDFLAGS = -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS)
 LTLIBRARY_LIBADD = $(LTLIBRARY_DEPENDENCIES) $(EXTRA_LIBS)
@@ -26,3 +38,7 @@ PHP_COMPILE     = $(CC) $(COMMON_FLAGS) 
 CXX_PHP_COMPILE = $(CXX) $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)  -c $< 
&& touch $@
 include $(top_srcdir)/build/library.mk
 include $(top_srcdir)/build/program.mk
+
+internal_functions_cli.c: $(top_srcdir)/main/internal_functions.c.in 
+$(top_builddir)/config.status
+       cd $(top_builddir) && \
+       REDO_ALL=yes ./config.status

-- 
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