]> granicus.if.org Git - php/commitdiff
Please welcome the new build system.
authorSascha Schumann <sas@php.net>
Thu, 7 Mar 2002 14:20:02 +0000 (14:20 +0000)
committerSascha Schumann <sas@php.net>
Thu, 7 Mar 2002 14:20:02 +0000 (14:20 +0000)
If you encounter any problems, please make sure to email sas@php.net
directly.

An introduction can be found on

http://schumann.cx/buildv5.txt

77 files changed:
Makefile.frag [new file with mode: 0644]
Makefile.global [new file with mode: 0644]
Makefile.in [deleted file]
README.SELF-CONTAINED-EXTENSIONS
TODO.BUILDv5 [new file with mode: 0644]
acinclude.m4
build/bsd_makefile [deleted file]
build/build2.mk
build/dynlib.mk [deleted file]
build/fastgen.sh [deleted file]
build/library.mk [deleted file]
build/ltlib.mk [deleted file]
build/shtool
build/sysv_makefile [deleted file]
configure.in
dynlib.m4 [deleted file]
ext/bcmath/Makefile.in [deleted file]
ext/bcmath/config.m4
ext/bcmath/libbcmath/Makefile.in [deleted file]
ext/bcmath/libbcmath/src/Makefile.in [deleted file]
ext/domxml/config.m4
ext/ext_skel
ext/informix/Makefile.frag [new file with mode: 0644]
ext/mysql/config.m4
ext/mysql/libmysql/mysql.m4
ext/pcre/config.m4
ext/pcre/config0.m4
ext/pdf/config.m4
ext/rpc/xmlrpc/config.m4
ext/rpc/xmlrpc/libxmlrpc/xmlrpc.m4
ext/session/Makefile.in [deleted file]
ext/session/config.m4
ext/standard/Makefile.frag [new file with mode: 0644]
ext/standard/Makefile.in [deleted file]
ext/standard/config.m4
ext/xml/config.m4
ext/xmlrpc/config.m4
ext/xmlrpc/libxmlrpc/xmlrpc.m4
pear/Makefile.frag [moved from pear/Makefile.in with 72% similarity]
pear/pear.m4
pear/scripts/phpize.in
sapi/Makefile.in [deleted file]
sapi/README [deleted file]
sapi/aolserver/Makefile.in [deleted file]
sapi/aolserver/config.m4
sapi/apache/Makefile.in [deleted file]
sapi/apache/config.m4
sapi/apache2filter/Makefile.in [deleted file]
sapi/apache2filter/config.m4
sapi/caudium/Makefile.in [deleted file]
sapi/caudium/config.m4
sapi/cgi/Makefile.in [deleted file]
sapi/cgi/config.m4
sapi/cli/Makefile.in [deleted file]
sapi/cli/config.m4
sapi/fastcgi/Makefile.in [deleted file]
sapi/fastcgi/config.m4
sapi/isapi/Makefile.in [deleted file]
sapi/isapi/config.m4
sapi/nsapi/Makefile.in [deleted file]
sapi/nsapi/config.m4
sapi/phttpd/Makefile.in [deleted file]
sapi/phttpd/config.m4
sapi/pi3web/Makefile.in [deleted file]
sapi/pi3web/config.m4
sapi/roxen/Makefile.in [deleted file]
sapi/roxen/config.m4
sapi/servlet/Makefile.frag [new file with mode: 0644]
sapi/servlet/Makefile.in [deleted file]
sapi/servlet/config.m4
sapi/thttpd/Makefile.in [deleted file]
sapi/thttpd/config.m4
sapi/tux/Makefile.in [deleted file]
sapi/tux/config.m4
sapi/webjames/Makefile.in [deleted file]
sapi/webjames/config.m4
scan_makefile_in.awk [new file with mode: 0644]

diff --git a/Makefile.frag b/Makefile.frag
new file mode 100644 (file)
index 0000000..b4a4f40
--- /dev/null
@@ -0,0 +1,16 @@
+$(builddir)/zend_language_scanner.lo: $(builddir)/zend_language_parser.h
+$(builddir)/zend_ini_scanner.lo: $(builddir)/zend_ini_parser.h
+
+$(builddir)/zend_language_scanner.c: $(srcdir)/zend_language_scanner.l
+       $(LEX) -Pzend -S$(srcdir)/flex.skl -o$@ -i $(srcdir)/zend_language_scanner.l
+
+$(builddir)/zend_language_parser.h: $(builddir)/zend_language_parser.c
+$(builddir)/zend_language_parser.c: $(srcdir)/zend_language_parser.y
+       $(YACC) -p zend -v -d $(srcdir)/zend_language_parser.y -o $@
+
+$(builddir)/zend_ini_parser.h: $(builddir)/zend_ini_parser.c
+$(builddir)/zend_ini_parser.c: $(srcdir)/zend_ini_parser.y
+       $(YACC) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o $@
+
+$(builddir)/zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l
+       $(LEX) -Pini_ -S$(srcdir)/flex.skl -o$@ -i $(srcdir)/zend_ini_scanner.l
diff --git a/Makefile.global b/Makefile.global
new file mode 100644 (file)
index 0000000..3f82f72
--- /dev/null
@@ -0,0 +1,71 @@
+
+mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p
+INSTALL = $(top_srcdir)/build/shtool install -c
+INSTALL_DATA = $(INSTALL) -m 644
+
+DEFS = -I$(top_builddir)/main -I$(top_srcdir)
+COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS)
+
+
+all: $(all_targets) 
+
+build-modules: $(PHP_MODULES)
+
+libphp4.la: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
+       $(LIBTOOL) --mode=link $(CC)  $(COMMON_FLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) -o $@
+
+php: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
+       $(LIBTOOL) --mode=link $(CC)  $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) -o $@
+
+sapi/cli/php: $(PHP_GLOBAL_OBJS) $(PHP_CLI_OBJS)
+       $(LIBTOOL) --mode=link $(CC)  $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_CLI_OBJS) $(EXTRA_LIBS) -o $@
+
+install: $(install_targets) 
+
+
+install-cli:
+       $(INSTALL_CLI)
+
+install-sapi:
+       -@$(LIBTOOL) --silent --mode=install cp libphp4.la $(phptempdir)/libphp4.la >/dev/null 2>&1
+       -@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
+       -@if test ! -r $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME); then \
+               for i in 0.0.0 0.0 0; do \
+                       if test -r $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME).$$i; then \
+                               $(LN_S) $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME).$$i $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME); \
+                               break; \
+                       fi; \
+               done; \
+       fi
+       $(INSTALL_IT)
+
+install-modules:
+       @test -d modules && \
+       $(mkinstalldirs) $(INSTALL_ROOT)$(EXTENSION_DIR) && \
+       echo "installing shared modules into $(EXTENSION_DIR)" && \
+       rm -f modules/*.la && \
+       cp modules/* $(INSTALL_ROOT)$(EXTENSION_DIR) >/dev/null 2>&1 || true
+
+install-tester:
+       @echo "Installing regression tester"
+       @$(mkinstalldirs) $(PEAR_INSTALLDIR)
+       @$(INSTALL) -m 755 $(top_srcdir)/run-tests.php $(INSTALL_ROOT)$(PEAR_INSTALLDIR)
+
+install-su: install-pear install-tester
+
+test: php
+       TOP_BUILDDIR=$(top_builddir) TOP_SRCDIR=$(top_srcdir) \
+                       $(top_builddir)/php -C -q $(top_srcdir)/run-tests.php \
+                       $(top_srcdir)
+
+clean:
+       find . -name \*.lo -o -name \*.o -o -name \*.la -o -name \*.a| xargs rm -f
+       find . -name .libs -a -type d|xargs rm -rf
+       rm -f libphp4.la php sapi/cli/php modules/* libs/*
+
+distclean: clean
+       rm -f config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h php4.spec sapi/apache/libphp4.module buildmk.stamp
+       find . -name Makefile | xargs rm -f
+
+.PHONY: all clean install distclean test
+.NOEXPORT:
diff --git a/Makefile.in b/Makefile.in
deleted file mode 100644 (file)
index e2168a0..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-
-ZEND_DIR = $(srcdir)/Zend
-SUBDIRS = Zend main ext sapi $(TSRM_DIR) $(REGEX_DIR) $(CLI_DIR) . $(PEAR_DIR)
-
-LTLIBRARY_NAME = libphp4.la
-LTLIBRARY_SOURCES = stub.c
-
-LTLIBRARY_DEPENDENCIES = \
-               Zend/libZend.la \
-               sapi/$(PHP_SAPI)/libsapi.la \
-               main/libmain.la \
-               $(REGEX_LIB) \
-               $(EXT_LTLIBS) \
-               $(TSRM_LIB)
-
-LTLIBRARY_LDFLAGS = -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS)
-LTLIBRARY_LIBADD = $(LTLIBRARY_DEPENDENCIES) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS)
-
-PROGRAM_NAME         = php
-PROGRAM_SOURCES      = stub.c
-PROGRAM_LDADD        = libphp4.la $(EXT_PROGRAM_LDADD)
-PROGRAM_LDFLAGS      = -export-dynamic 
-PROGRAM_DEPENDENCIES = $(PROGRAM_LDADD)
-
-targets = $(LTLIBRARY_NAME) $(PHP_PROGRAM)
-
-install_targets = install-sapi install-modules
-
-include $(top_srcdir)/build/rules.mk
-include $(top_srcdir)/build/library.mk
-include $(top_srcdir)/build/program.mk
-
-install-sapi:
-       @$(LIBTOOL) --silent --mode=install cp libphp4.la $(phptempdir)/libphp4.la >/dev/null 2>&1
-       -@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
-       -@if test ! -r $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME); then \
-               for i in 0.0.0 0.0 0; do \
-                       if test -r $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME).$$i; then \
-                               $(LN_S) $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME).$$i $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME); \
-                               break; \
-                       fi; \
-               done; \
-       fi
-       $(INSTALL_IT)
-
-install-modules:
-       @test -d modules && \
-       $(mkinstalldirs) $(INSTALL_ROOT)$(moduledir) && \
-       echo "installing shared modules into $(moduledir)" && \
-       rm -f modules/*.la && \
-       cp modules/* $(INSTALL_ROOT)$(moduledir) >/dev/null 2>&1 || true
-
-install-tester:
-       @echo "Installing regression tester"
-       @$(mkinstalldirs) $(PEAR_INSTALLDIR)
-       @$(INSTALL) -m 755 $(srcdir)/run-tests.php $(INSTALL_ROOT)$(PEAR_INSTALLDIR)
-
-install-pear: install-modules
-       (cd pear && $(MAKE) install)
-
-install-su: install-pear install-tester
-
-.NOEXPORT:
index 1f2e9da7706a28cdffae001f973facd9ba631810..bff6c80726bf4e7254ed648ed8add8cb50152426 100644 (file)
@@ -7,7 +7,6 @@ HOW TO CREATE A SELF-CONTAINED PHP EXTENSION
   the PHP source. To create such an extension, three things are
   required:
 
-  - Makefile template (Makefile.in)
   - Configuration file (config.m4)
   - Source code for your module
 
@@ -74,28 +73,9 @@ DEFINING THE NEW EXTENSION
   need to specify anything).
 
 
-CREATING THE MAKEFILE TEMPLATE 
-  
-  The Makefile Template (Makefile.in) contains three lines:
-
-------------------------------------------------------------------------------
-LTLIBRARY_SHARED_NAME = foobar.la
-LTLIBRARY_SOURCES     = foo.c bar.c
-
-include $(top_srcdir)/build/dynlib.mk
-------------------------------------------------------------------------------
-
-  LTLIBRARY_SHARED_NAME specifies the name of the extension.
-  It must be of the form `ext-name.la'.
-
   LTLIBRARY_SOURCES specifies the names of the sources files. You can
   name an arbitrary number of source files here.
 
-  The final include directive includes the build rules (you usually
-  don't need to care about what happens there). rules.mk and other
-  files are installed by phpize which we will cover later.
-
-
 CREATING THE M4 CONFIGURATION FILE
 
   The m4 configuration can perform additional checks. For a 
@@ -107,13 +87,17 @@ PHP_ARG_ENABLE(foobar,whether to enable foobar,
 [  --enable-foobar            Enable foobar])
 
 if test "$PHP_FOOBAR" != "no"; then
-  PHP_EXTENSION(foobar, $ext_shared)
+  PHP_NEW_EXTENSION(foobar, foo.c bar.c, $ext_shared)
 fi
 ------------------------------------------------------------------------------
 
   PHP_ARG_ENABLE will automatically set the correct variables, so
-  that the extension will be enabled by PHP_EXTENSION in shared mode.
+  that the extension will be enabled by PHP_NEW_EXTENSION in shared mode.
 
+  The first argument of PHP_NEW_EXTENSION describes the name of the
+  extension.  The second names the source-code files.  The third passes
+  $ext_shared which is set by PHP_ARG_ENABLE/WITH to PHP_NEW_EXTENSION.
+  
   Please use always PHP_ARG_ENABLE or PHP_ARG_WITH. Even if you do not
   plan to distribute your module with PHP, these facilities allow you
   to integrate your module easily into the main PHP module framework.
@@ -131,8 +115,8 @@ CREATING SOURCE FILES
 
 CREATING THE SELF-CONTAINED EXTENSION
 
-  Put Makefile.in, config.m4 and the source files into one directory.
-  Then run phpize (this is installed during make install by PHP 4.0).
+  Put config.m4 and the source files into one directory. Afterwards,
+  run phpize (this is installed during make install by PHP 4.0).
   For example, if you configured PHP with --prefix=/php, you would run
 
      $ /php/bin/phpize
@@ -157,17 +141,13 @@ ADDING SHARED MODULE SUPPORT TO A MODULE
   support to an existing module called foo.
 
   1. In config.m4, use PHP_ARG_WITH/PHP_ARG_ENABLE. Then you will
-     automatically be able to use --with-foo=shared or
-     --enable-foo=shared.
+     automatically be able to use --with-foo=shared[,..] or
+     --enable-foo=shared[,..].
 
-  2. In config.m4, use PHP_EXTENSION(foo, $ext_shared) to enable
+  2. In config.m4, use PHP_NEW_EXTENSION(foo,.., $ext_shared) to enable
      building the extension.
 
-  3. Add the following line to Makefile.in:
-
-        LTLIBRARY_SHARED_NAME = foo.la
-
-  4. Add the following lines to your C source file:
+  3. Add the following lines to your C source file:
 
         #ifdef COMPILE_DL_FOO
         ZEND_GET_MODULE(foo)
diff --git a/TODO.BUILDv5 b/TODO.BUILDv5
new file mode 100644 (file)
index 0000000..e45ae2e
--- /dev/null
@@ -0,0 +1,4 @@
+- fix phpize
+- clean up .cvsignores
+- purge Makefile.ins and replace PHP_EXTENSION in config.m4s
+  with appropiate calls to PHP_NEW_EXTENSION
index c867dbf6cc11959bea41983551c9c2c8398b9b9c..43ed444bfd00b2e354ee764b73b4607bbe1fd149 100644 (file)
@@ -2,7 +2,124 @@ dnl $Id$
 dnl
 dnl This file contains local autoconf functions.
 
-sinclude(dynlib.m4)
+dnl PHP_ADD_MAKEFILE_FRAGMENT([srcfile[, ext_srcdir[, ext_builddir]]])
+dnl
+dnl Processes a file called Makefile.frag in the source directory
+dnl of the most recently added extension. $(srcdir) and $(builddir)
+dnl are substituted with the proper paths. Can be used to supply
+dnl custom rules and/or additional targets.
+dnl
+AC_DEFUN(PHP_ADD_MAKEFILE_FRAGMENT,[
+  ifelse($1,,src=$ext_srcdir/Makefile.frag,src=$1)
+  ifelse($2,,ac_srcdir=$ext_srcdir,ac_srcdir=$2)
+  ifelse($3,,ac_builddir=$ext_builddir,ac_builddir=$3)
+  sed -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src  >> Makefile.fragments
+])
+
+
+dnl PHP_DEFINE(what[, value])
+dnl
+dnl Creates builddir/include/what.h and in there #define what value
+dnl
+AC_DEFUN(PHP_DEFINE,[
+  echo "#define $1 $2" > include/$1.h
+])
+
+dnl PHP_INIT_BUILD_SYSTEM
+dnl
+AC_DEFUN(PHP_INIT_BUILD_SYSTEM,[
+mkdir include >/dev/null 2>&1
+> Makefile.objects
+> Makefile.fragments
+])
+
+dnl PHP_GEN_GLOBAL_MAKEFILE
+dnl 
+dnl Generates the global makefile.
+dnl
+AC_DEFUN(PHP_GEN_GLOBAL_MAKEFILE,[
+  cat >Makefile <<EOF
+srcdir = $abs_srcdir
+builddir = $abs_builddir
+top_srcdir = $abs_srcdir
+top_builddir = $abs_builddir
+EOF
+  for i in $PHP_VAR_SUBST; do
+    eval echo "$i = \$$i" >> Makefile
+  done
+
+  cat $abs_srcdir/Makefile.global Makefile.fragments Makefile.objects >> Makefile
+])
+
+dnl PHP_ADD_SOURCES(source-path, sources[, special-flags[, type]])
+dnl
+dnl Adds sources which are located relative to source-path to the 
+dnl array of type type.  Sources are processed with optional 
+dnl special-flags which are passed to the compiler.  Sources
+dnl can be either written in C or C++ (filenames shall end in .c 
+dnl or .cpp, respectively).
+dnl
+dnl Note: If source-path begins with a "/", the "/" is removed and
+dnl the path is interpreted relative to the top build-directory.
+dnl
+dnl which array to append to?
+AC_DEFUN(PHP_ADD_SOURCES,[
+  ifelse($4,cli,ac_what=PHP_CLI_OBJS,ifelse($4,sapi,ac_what=PHP_SAPI_OBJS,ac_what=PHP_GLOBAL_OBJS))
+  PHP_ADD_SOURCES_X($1, $2, $3, $ac_what)
+])
+
+dnl PHP_ASSIGN_BUILD_VARS(type)
+dnl Internal macro, should/can be exploded manually
+AC_DEFUN(PHP_ASSIGN_BUILD_VARS,[
+  for acx in pre meta post; do for acy in c cxx; do eval b_${acy}_$acx=[\$]$1_${acy}_$acx; done; done
+  b_lo=[$]$1_lo
+])
+
+dnl PHP_ADD_SOURCES_X(source-path, sources[, special-flags[, target-var[, shared[, special-post-flags]]]])
+dnl
+dnl Additional to PHP_ADD_SOURCES (see above), this lets you set the
+dnl name of the array target-var directly, as well as whether
+dnl shared objects will be built from the sources.  Should not be 
+dnl used directly.
+dnl 
+AC_DEFUN(PHP_ADD_SOURCES_X,[
+  ac_what=$4
+
+dnl relative to source- or build-directory?
+  case $1 in
+  /*[)] ac_srcdir=`echo $ac_n "$1$ac_c"|cut -c 2-`; ac_bdir=$ac_srcdir ;;
+  *[)] ac_srcdir="$abs_srcdir/$1"; ac_bdir=$1 ;;
+  esac
+  
+dnl how to build .. shared or static?
+  ifelse($5,yes,PHP_ASSIGN_BUILD_VARS(shared),PHP_ASSIGN_BUILD_VARS(php))
+
+dnl iterate over the sources
+  for ac_src in $2; do
+  
+dnl remove the suffix
+      old_IFS=[$]IFS
+      IFS=.
+      set $ac_src
+      ac_obj=[$]1
+      IFS=$old_IFS
+      
+dnl append to the array which has been dynamically chosen
+      eval "$ac_what=\"[\$$]ac_what $ac_bdir/[$]ac_obj.lo\""
+
+dnl choose the right compiler/flags/etc. for the source-file
+      case $ac_src in
+         *.c[)] ac_comp="$b_c_pre $3 -I$abs_srcdir/$ac_bdir -I$abs_builddir/$ac_bdir $b_c_meta -c $ac_srcdir/$ac_src -o $ac_bdir/$ac_obj.$b_lo $6$b_c_post" ;;
+         *.cpp[)] ac_comp="$b_cxx_pre $3 -I$abs_srcdir/$ac_bdir -I$abs_builddir/$ac_bdir $b_cxx_meta -c $ac_srcdir/$ac_src -o $ac_bdir/$ac_obj.$b_lo $6$b_cxx_post" ;;
+      esac
+
+dnl create a rule for the object/source combo
+         cat >>Makefile.objects<<EOF
+$ac_bdir/[$]ac_obj.lo: $ac_srcdir/[$]ac_src
+       $ac_comp
+EOF
+  done
+])
 
 dnl
 dnl Disable building CLI
@@ -370,9 +487,7 @@ if test "$php_always_shared" = "yes"; then
   test "[$]$1" = "no" && $1=yes
 fi
 
-if test -n "$2"; then
-  AC_MSG_RESULT([$ext_output])
-fi
+ifelse([$2],,,[AC_MSG_RESULT([$ext_output])])
 ])
 
 dnl
@@ -386,9 +501,7 @@ PHP_REAL_ARG_WITH([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z0-9-,A-Z0-9_))
 ])
 
 AC_DEFUN(PHP_REAL_ARG_WITH,[
-if test -n "$2"; then
-  AC_MSG_CHECKING([$2])
-fi
+ifelse([$2],,,[AC_MSG_CHECKING([$2])])
 AC_ARG_WITH($1,[$3],$5=[$]withval,$5=ifelse($4,,no,$4))
 PHP_ARG_ANALYZE($5,[$2])
 ])
@@ -404,9 +517,7 @@ PHP_REAL_ARG_ENABLE([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z-,A-Z_))
 ])
 
 AC_DEFUN(PHP_REAL_ARG_ENABLE,[
-if test -n "$2"; then
-  AC_MSG_CHECKING([$2])
-fi
+ifelse([$2],,,[AC_MSG_CHECKING([$2])])
 AC_ARG_ENABLE($1,[$3],$5=[$]enableval,$5=ifelse($4,,no,$4))
 PHP_ARG_ANALYZE($5,[$2])
 ])
@@ -493,10 +604,6 @@ AC_DEFUN(PHP_SUBST_OLD,[
   AC_SUBST($1)
 ])
 
-AC_DEFUN(PHP_FAST_OUTPUT,[
-  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $1"
-])
-
 AC_DEFUN(PHP_MKDIR_P_CHECK,[
   AC_CACHE_CHECK(for working mkdir -p, ac_cv_mkdir_p,[
     test -d conftestdir && rm -rf conftestdir
@@ -512,19 +619,6 @@ dnl `mkdir -p' must be quiet about creating existing directories
   ])
 ])
 
-AC_DEFUN(PHP_GEN_CONFIG_VARS,[
-  PHP_MKDIR_P_CHECK
-  echo creating config_vars.mk
-  > config_vars.mk
-  for i in $PHP_VAR_SUBST; do
-    eval echo "$i = \$$i" | sed 's%#%\\#%g' >> config_vars.mk
-  done
-])
-
-AC_DEFUN(PHP_GEN_MAKEFILES,[
-  $SHELL $srcdir/build/fastgen.sh $srcdir $ac_cv_mkdir_p $BSD_MAKEFILE $1
-])
-
 AC_DEFUN(PHP_TM_GMTOFF,[
 AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff,
 [AC_TRY_COMPILE([#include <sys/types.h>
@@ -645,13 +739,25 @@ dnl
 dnl PHP_BUILD_SHARED
 dnl
 AC_DEFUN(PHP_BUILD_SHARED,[
+  PHP_BUILD_PROGRAM
+  OVERALL_TARGET=libphp4.la
   php_build_target=shared
+  
+  php_c_pre=$shared_c_pre
+  php_c_meta=$shared_c_meta
+  php_c_post=$shared_c_post
+  php_cxx_pre=$shared_cxx_pre
+  php_cxx_meta=$shared_cxx_meta
+  php_cxx_post=$shared_cxx_post
+  php_lo=$shared_lo
 ])
 
 dnl
 dnl PHP_BUILD_STATIC
 dnl
 AC_DEFUN(PHP_BUILD_STATIC,[
+  PHP_BUILD_PROGRAM
+  OVERALL_TARGET=libphp4.la
   php_build_target=static
 ])
 
@@ -659,6 +765,23 @@ dnl
 dnl PHP_BUILD_PROGRAM
 dnl
 AC_DEFUN(PHP_BUILD_PROGRAM,[
+  OVERALL_TARGET=php
+  php_c_pre='$(CC)'
+  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
+  php_c_post=' && > $[@]'
+  php_cxx_pre='$(CXX)'
+  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
+  php_cxx_post=' && > $[@]'
+  php_lo=o
+  
+  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
+  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) -prefer-pic'
+  shared_c_post=
+  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
+  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -prefer-pic'
+  shared_cxx_post=
+  shared_lo=lo
+
   php_build_target=program
 ])
 
@@ -722,7 +845,7 @@ dnl builds RPATH from PHP_RPATHS
 dnl
 AC_DEFUN(PHP_BUILD_RPATH,[
   if test "$PHP_RPATH" = "yes" && test -n "$PHP_RPATHS"; then
-    OLD_RPATHS="$PHP_RPATHS"
+    OLD_RPATHS=$PHP_RPATHS
     unset PHP_RPATHS
     for i in $OLD_RPATHS; do
       PHP_LDFLAGS="$PHP_LDFLAGS -L$i"
@@ -752,7 +875,7 @@ AC_DEFUN(PHP_ADD_INCLUDE,[
 ])
 
 AC_DEFUN(PHP_X_ADD_LIBRARY,[
-  ifelse($2,,$3="-l$1 [$]$3", $3="[$]$3 -l$1")
+  ifelse([$2],,$3="-l$1 [$]$3", $3="[$]$3 -l$1")
 ])
 
 dnl
@@ -838,8 +961,8 @@ AC_DEFUN(PHP_ADD_LIBRARY_DEFER_WITH_PATH,[
 dnl
 dnl Set libtool variable
 dnl
-AC_DEFUN(AM_SET_LIBTOOL_VARIABLE,[
-  LIBTOOL='$(SHELL) $(top_builddir)/libtool $1'
+AC_DEFUN(PHP_SET_LIBTOOL_VARIABLE,[
+  LIBTOOL='$(SHELL) libtool $1'
 ])
 
 dnl
@@ -870,21 +993,15 @@ AC_DEFUN(PHP_CHECK_CC_OPTION,[
 AC_DEFUN(PHP_REGEX,[
 
 if test "$REGEX_TYPE" = "php"; then
-  REGEX_LIB=regex/libregex.la
-  REGEX_DIR=regex
   AC_DEFINE(HSREGEX,1,[ ])
   AC_DEFINE(REGEX,1,[ ])
-  PHP_FAST_OUTPUT(regex/Makefile)
+  PHP_ADD_SOURCES(regex, regcomp.c regexec.c regerror.c regfree.c)
 elif test "$REGEX_TYPE" = "system"; then
   AC_DEFINE(REGEX,0,[ ])
 fi
 
 AC_MSG_CHECKING([which regex library to use])
 AC_MSG_RESULT([$REGEX_TYPE])
-
-PHP_SUBST(REGEX_DIR)
-PHP_SUBST(REGEX_LIB)
-PHP_SUBST(HSREGEX)
 ])
 
 dnl
@@ -921,21 +1038,79 @@ AC_DEFUN(PHP_AC_BROKEN_SPRINTF,[
   fi
 ])
 
+dnl PHP_SHARED_MODULE(module-name, object-var, build-dir)
+dnl
+dnl Basically sets up the link-stage for building module-name
+dnl from object_var in build-dir.
+dnl
+AC_DEFUN(PHP_SHARED_MODULE,[
+  PHP_MODULES="$PHP_MODULES \$(phplibdir)/$1.la"
+  PHP_SUBST($2)
+  cat >>Makefile.objects<<EOF
+\$(phplibdir)/$1.la: $3/$1.la
+       \$(LIBTOOL) --mode=install cp $3/$1.la \$(phplibdir)
+
+$3/$1.la: \$($2) \$(translit($1,a-z-,A-Z_)_SHARED_DEPENDENCIES)
+       \$(LIBTOOL) --mode=link \$(CC) \$(COMMON_FLAGS) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(LDFLAGS) -o \[$]@ -export-dynamic -avoid-version -prefer-pic -module -rpath \$(phplibdir) \$(EXTRA_LDFLAGS) \$($2) \$(translit($1,a-z-,A-Z_)_SHARED_LIBADD)
+
+EOF
+])
+
+dnl
+dnl PHP_SELECT_SAPI(name, type[, sources])
+dnl
+dnl Selects the SAPI name and type (static, shared, programm)
+dnl and optionally also the source-files for the SAPI-specific
+dnl objects.
+dnl
+AC_DEFUN(PHP_SELECT_SAPI,[
+  PHP_SAPI=$1
+  
+  case "$2" in
+  static) PHP_BUILD_STATIC;;
+  shared) PHP_BUILD_SHARED;;
+  program) PHP_BUILD_PROGRAM;;
+  esac
+  
+  ifelse($3,,,[PHP_ADD_SOURCES(sapi/$1, $3,,sapi)])
+])
+
+dnl deprecated
+AC_DEFUN(PHP_EXTENSION,[
+  sources=`awk -f $abs_srcdir/scan_makefile_in.awk < $abs_srcdir/ext/$1/Makefile.in`
+
+  PHP_NEW_EXTENSION($1, $sources, $2, $3)
+
+  if test -r "$ext_srcdir/Makefile.frag"; then
+    PHP_ADD_MAKEFILE_FRAGMENT
+  fi
+])
+
+AC_DEFUN(PHP_ADD_BUILD_DIR,[
+  BUILD_DIR="$BUILD_DIR $1"
+])
+
+AC_DEFUN(PHP_GEN_BUILD_DIRS,[
+  PHP_MKDIR_P_CHECK
+  if test "$ac_cv_mkdir_p" = "yes"; then
+    mkdir -p $BUILD_DIR
+  fi
+])
+
 dnl
-dnl PHP_EXTENSION(extname [, shared [,sapi_class]])
+dnl PHP_NEW_EXTENSION(extname, sources [, shared [,sapi_class[, extra-cflags]]])
 dnl
 dnl Includes an extension in the build.
 dnl
-dnl "extname" is the name of the ext/ subdir where the extension resides
+dnl "extname" is the name of the ext/ subdir where the extension resides.
+dnl "sources" is a list of files relative to the subdir which are used
+dnl to build the extension.
 dnl "shared" can be set to "shared" or "yes" to build the extension as
 dnl a dynamically loadable library. Optional parameter "sapi_class" can
 dnl be set to "cli" to mark extension build only with CLI or CGI sapi's.
-dnl If "nocli" is passed the extension will be built only with a non-cli
-dnl sapi.
-dnl
-AC_DEFUN(PHP_EXTENSION,[
-  EXT_SUBDIRS="$EXT_SUBDIRS $1"
-  
+dnl extra-cflags are passed to the compiler, with @ext_srcdir@ being
+dnl substituted.
+AC_DEFUN(PHP_NEW_EXTENSION,[
   if test -d "$abs_srcdir/ext/$1"; then
 dnl ---------------------------------------------- Internal Module
     ext_builddir=ext/$1
@@ -946,35 +1121,39 @@ dnl ---------------------------------------------- External Module
     ext_srcdir=$abs_srcdir
   fi
 
-  if test "$2" != "shared" && test "$2" != "yes" && test "$3" != "cli"; then
+  ifelse($5,,,[ac_extra=`echo $ac_n "$5$ac_c"|sed s#@ext_srcdir@#$ext_srcdir#g`])
+
+  if test "$3" != "shared" && test "$3" != "yes" && test "$4" != "cli"; then
 dnl ---------------------------------------------- Static module
-    LIB_BUILD($ext_builddir)
-    EXT_LTLIBS="$EXT_LTLIBS $abs_builddir/$ext_builddir/lib$1.la"
+
+    PHP_ADD_SOURCES($ext_builddir,$2,$ac_extra,)
     EXT_STATIC="$EXT_STATIC $1"
     if test "$3" != "nocli"; then
       EXT_CLI_LTLIBS="$EXT_CLI_LTLIBS $abs_builddir/$ext_builddir/lib$1.la"
       EXT_CLI_STATIC="$EXT_CLI_STATIC $1"
     fi
   else
-    if test "$2" = "shared" || test "$2" = "yes"; then
+    if test "$3" = "shared" || test "$3" = "yes"; then
 dnl ---------------------------------------------- Shared module
-      LIB_BUILD($ext_builddir,yes)
+      PHP_ADD_SOURCES_X($ext_builddir,$2,$ac_extra,shared_objects_$1,yes)
+      PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir)
       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 "$2" != "yes" && test "$3" = "cli"; then
-dnl ---------------------------------------------- CLI only static module
-    LIB_BUILD($ext_builddir)
+  if test "$3" != "shared" && test "$3" != "yes" && test "$4" = "cli"; then
+dnl ---------------------------------------------- CLI static module
     if test "$PHP_SAPI" = "cgi"; then
-      EXT_LTLIBS="$EXT_LTLIBS $abs_builddir/$ext_builddir/lib$1.la"
+      PHP_ADD_SOURCES($ext_builddir,$2,$ac_extra,)
       EXT_STATIC="$EXT_STATIC $1"
+    else
+      PHP_ADD_SOURCES($ext_srcdir,$2,$ac_extra,cli)
+      EXT_CLI_STATIC="$EXT_CLI_STATIC $1"
     fi
     EXT_CLI_LTLIBS="$EXT_CLI_LTLIBS $abs_builddir/$ext_builddir/lib$1.la"
     EXT_CLI_STATIC="$EXT_CLI_STATIC $1"
   fi
-
-  PHP_FAST_OUTPUT($ext_builddir/Makefile)
+  PHP_ADD_BUILD_DIR($ext_builddir)
 ])
 
 dnl
@@ -1127,11 +1306,6 @@ int main(void) {
   fi
 ])
 
-AC_DEFUN(AC_ADD_LIBPATH, [indir([PHP_ADD_LIBPATH], $@)])
-AC_DEFUN(AC_ADD_LIBRARY, [indir([PHP_ADD_LIBRARY], $@)])
-AC_DEFUN(AC_ADD_LIBRARY_WITH_PATH, [indir([PHP_ADD_LIBRARY_WITH_PATH], $@)])
-AC_DEFUN(AC_ADD_INCLUDE, [indir([PHP_ADD_INCLUDE], $@)])
-
 AC_DEFUN(PHP_FOPENCOOKIE,[
        AC_CHECK_FUNC(fopencookie, [ have_glibc_fopencookie=yes ])
 
diff --git a/build/bsd_makefile b/build/bsd_makefile
deleted file mode 100755 (executable)
index cb9ecdc..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#! /bin/sh
-#  +----------------------------------------------------------------------+
-#  | PHP Version 4                                                        |
-#  +----------------------------------------------------------------------+
-#  | Copyright (c) 1997-2002 The PHP Group                                |
-#  +----------------------------------------------------------------------+
-#  | This source file is subject to version 2.02 of the PHP license,      |
-#  | that is bundled with this package in the file LICENSE, and is        |
-#  | available at through the world-wide-web at                           |
-#  | http://www.php.net/license/2_02.txt.                                 |
-#  | If you did not receive a copy of the PHP license and are unable to   |
-#  | obtain it through the world-wide-web, please send a note to          |
-#  | license@php.net so we can mail you a copy immediately.               |
-#  +----------------------------------------------------------------------+
-#  | Author: Sascha Schumann <sascha@schumann.cx>                         |
-#  +----------------------------------------------------------------------+
-#
-# $Id$ 
-#
-
-# cwd must be top_srcdir
-test -f build/bsd_makefile || exit 2
-
-test -f bsd_converted && exit 0
-
-tmpfile=`mktemp /tmp/bsd_makefile.XXXXXX 2>/dev/null` || tmpfile="tmp.$$"
-for i in build/*.mk; do
-    sed 's/^include \(.*\)/.include "\1"/' $i >$tmpfile \
-        && cp $tmpfile $i
-done
-rm -f $tmpfile
-
-touch bsd_converted
-exit 0
index 4954991c4573987b5c786329c37d56139ab874d0..8ec12e44ae3c8c9cec21b40e37c01487caa4ff5f 100644 (file)
@@ -30,37 +30,16 @@ config_h_in = main/php_config.h.in
 
 acconfig_h_SOURCES = acconfig.h.in $(config_h_files)
 
-targets = $(TOUCH_FILES) $(makefile_in_files) configure $(config_h_in)
+targets = $(TOUCH_FILES) configure $(config_h_in)
 
 
-all: Zend/Makefile.am TSRM/Makefile.am $(targets)
-
-Zend/Makefile.am:
-       test -d Zend || (test -d ../Zend && ln -s ../Zend Zend)
-
-TSRM/Makefile.am:
-       test -d TSRM || (test -d ../TSRM && ln -s ../TSRM TSRM)
+all: $(targets)
 
 acconfig.h: $(acconfig_h_SOURCES)
        @echo rebuilding $@
        cat $(acconfig_h_SOURCES) > $@
 
-$(makefile_in_files): $(makefile_am_files) aclocal.m4 configure.in $(config_m4_files)
-       @echo rebuilding Makefile templates
-       @for i in $(LT_TARGETS); do \
-               if test -f "$$i"; then \
-                       mv $$i $$i.bak; \
-                       cp $$i.bak $$i; \
-               fi; \
-       done
-       @test -f want_dependencies || flag=-i; \
-       automake -a $$flag $(AMFLAGS) $(makefile_files) 2>&1 | $(SUPPRESS_WARNINGS)
-       @for i in $(LT_TARGETS); do mv $$i.bak $$i; done
-
-aclocal.m4: configure.in acinclude.m4 dynlib.m4
-       aclocal 2>&1 | $(SUPPRESS_WARNINGS)
-
-SUPPRESS_WARNINGS = (egrep -v '(AC_TRY_RUN called without default to allow cross compiling|AC_PROG_CXXCPP was called before AC_PROG_CXX|.*AM_PROG_LEX.*|defined in acinclude.m4 but never used|AC_PROG_LEX invoked multiple times|AC_PROG_CPP called before)'||true)
+SUPPRESS_WARNINGS = (egrep -v '(AC_TRY_RUN called without default to allow cross compiling|AC_PROG_CXXCPP was called before AC_PROG_CXX|defined in acinclude.m4 but never used|AC_PROG_LEX invoked multiple times|AC_PROG_CPP was called before AC_PROG_CC)'||true)
 
 $(config_h_in): configure acconfig.h
 # explicitly remove target since autoheader does not seem to work 
@@ -72,6 +51,9 @@ $(config_h_in): configure acconfig.h
 $(TOUCH_FILES):
        touch $(TOUCH_FILES)
 
+aclocal.m4: configure.in acinclude.m4
+       aclocal 2>&1 | $(SUPPRESS_WARNINGS)
+       
 configure: aclocal.m4 configure.in $(config_m4_files)
        @echo rebuilding $@
        @autoconf 2>&1 | $(SUPPRESS_WARNINGS)
diff --git a/build/dynlib.mk b/build/dynlib.mk
deleted file mode 100644 (file)
index 91370be..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#  +----------------------------------------------------------------------+
-#  | PHP Version 4                                                        |
-#  +----------------------------------------------------------------------+
-#  | Copyright (c) 1997-2002 The PHP Group                                |
-#  +----------------------------------------------------------------------+
-#  | This source file is subject to version 2.02 of the PHP license,      |
-#  | that is bundled with this package in the file LICENSE, and is        |
-#  | available at through the world-wide-web at                           |
-#  | http://www.php.net/license/2_02.txt.                                 |
-#  | If you did not receive a copy of the PHP license and are unable to   |
-#  | obtain it through the world-wide-web, please send a note to          |
-#  | license@php.net so we can mail you a copy immediately.               |
-#  +----------------------------------------------------------------------+
-#  | Author: Sascha Schumann <sascha@schumann.cx>                         |
-#  +----------------------------------------------------------------------+
-#
-# $Id$ 
-#
-
-all: all-recursive
-
-include $(builddir)/libs.mk
-
-include $(top_srcdir)/build/rules.mk
diff --git a/build/fastgen.sh b/build/fastgen.sh
deleted file mode 100755 (executable)
index 1961849..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-#! /bin/sh
-#
-#  +----------------------------------------------------------------------+
-#  | PHP Version 4                                                        |
-#  +----------------------------------------------------------------------+
-#  | Copyright (c) 1997-2002 The PHP Group                                |
-#  +----------------------------------------------------------------------+
-#  | This source file is subject to version 2.02 of the PHP license,      |
-#  | that is bundled with this package in the file LICENSE, and is        |
-#  | available at through the world-wide-web at                           |
-#  | http://www.php.net/license/2_02.txt.                                 |
-#  | If you did not receive a copy of the PHP license and are unable to   |
-#  | obtain it through the world-wide-web, please send a note to          |
-#  | license@php.net so we can mail you a copy immediately.               |
-#  +----------------------------------------------------------------------+
-#  | Author: Sascha Schumann <sascha@schumann.cx>                         |
-#  +----------------------------------------------------------------------+
-#
-# $Id: fastgen.sh,v 1.14 2002-02-28 08:25:33 sebastian Exp $ 
-#
-
-if test "$#" = "0"; then
-  echo "Usage: fastgen.sh <srcdir> <mkdir_p> <bsdmakefile_p> <file>"
-fi
-
-srcdir=$1
-shift
-
-mkdir_p=$1
-shift
-
-bsd_makefile=$1
-shift
-
-top_srcdir=`(cd $srcdir; pwd)`
-top_builddir=`pwd`
-
-if test "$mkdir_p" = "yes"; then
-  mkdir_p="mkdir -p"
-else
-  mkdir_p="$top_srcdir/build/shtool mkdir -p"
-fi
-
-if test "$bsd_makefile" = "yes"; then
-  (cd $top_srcdir; ./build/bsd_makefile)
-
-  for makefile in $@; do
-    echo "fastgen.sh: creating $makefile"
-    dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'`
-    $mkdir_p "$dir/"
-
-    cat - $top_srcdir/$makefile.in <<EOF |sed 's/^include \(.*\)/.include "\1"/' >$makefile 
-top_srcdir   = $top_srcdir
-top_builddir = $top_builddir
-srcdir       = $top_srcdir/$dir
-builddir     = $top_builddir/$dir
-VPATH        = $top_srcdir/$dir
-EOF
-
-    test -z "$dir" && dir=.
-    touch $dir/.deps
-  done
-else  
-  for makefile in $@; do
-    echo "fastgen.sh: creating $makefile"
-    dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'`
-    $mkdir_p "$dir/"
-
-    cat - $top_srcdir/$makefile.in <<EOF >$makefile
-top_srcdir   = $top_srcdir
-top_builddir = $top_builddir
-srcdir       = $top_srcdir/$dir
-builddir     = $top_builddir/$dir
-VPATH        = $top_srcdir/$dir
-EOF
-  
-    test -z "$dir" && dir=.
-    touch $dir/.deps
-  done
-fi
diff --git a/build/library.mk b/build/library.mk
deleted file mode 100644 (file)
index b210a28..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#  +----------------------------------------------------------------------+
-#  | PHP Version 4                                                        |
-#  +----------------------------------------------------------------------+
-#  | Copyright (c) 1997-2002 The PHP Group                                |
-#  +----------------------------------------------------------------------+
-#  | This source file is subject to version 2.02 of the PHP license,      |
-#  | that is bundled with this package in the file LICENSE, and is        |
-#  | available at through the world-wide-web at                           |
-#  | http://www.php.net/license/2_02.txt.                                 |
-#  | If you did not receive a copy of the PHP license and are unable to   |
-#  | obtain it through the world-wide-web, please send a note to          |
-#  | license@php.net so we can mail you a copy immediately.               |
-#  +----------------------------------------------------------------------+
-#  | Author: Sascha Schumann <sascha@schumann.cx>                         |
-#  +----------------------------------------------------------------------+
-#
-# $Id$ 
-#
-
-LTLIBRARY_OBJECTS = $(LTLIBRARY_SOURCES:.c=.lo) $(LTLIBRARY_OBJECTS_X)
-
-$(LTLIBRARY_NAME): $(LTLIBRARY_OBJECTS) $(LTLIBRARY_DEPENDENCIES)
-       $(LINK) $(LTLIBRARY_LDFLAGS) $(LTLIBRARY_OBJECTS) $(LTLIBRARY_LIBADD)
diff --git a/build/ltlib.mk b/build/ltlib.mk
deleted file mode 100644 (file)
index 86f0417..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#  +----------------------------------------------------------------------+
-#  | PHP Version 4                                                        |
-#  +----------------------------------------------------------------------+
-#  | Copyright (c) 1997-2002 The PHP Group                                |
-#  +----------------------------------------------------------------------+
-#  | This source file is subject to version 2.02 of the PHP license,      |
-#  | that is bundled with this package in the file LICENSE, and is        |
-#  | available at through the world-wide-web at                           |
-#  | http://www.php.net/license/2_02.txt.                                 |
-#  | If you did not receive a copy of the PHP license and are unable to   |
-#  | obtain it through the world-wide-web, please send a note to          |
-#  | license@php.net so we can mail you a copy immediately.               |
-#  +----------------------------------------------------------------------+
-#  | Author: Sascha Schumann <sascha@schumann.cx>                         |
-#  +----------------------------------------------------------------------+
-#
-# $Id$ 
-#
-
-targets = $(LTLIBRARY_NAME)
-
-include $(top_srcdir)/build/rules.mk
-include $(top_srcdir)/build/library.mk
-
index 4c1a7396fd9808066bdc376afc7add52e294711b..391f5a83c2b637badaab3c1d365127a6eb0eaa50 100755 (executable)
@@ -1,13 +1,13 @@
 #!/bin/sh
 ##
 ##  GNU shtool -- The GNU Portable Shell Tool
-##  Copyright (c) 1994-2000 Ralf S. Engelschall <rse@engelschall.com>
+##  Copyright (c) 1994-2001 Ralf S. Engelschall <rse@engelschall.com>
 ##
 ##  See http://www.gnu.org/software/shtool/ for more information.
 ##  See ftp://ftp.gnu.org/gnu/shtool/ for latest version.
 ##
-##  Version 1.4.9 (16-Apr-2000)
-##  Ingredients: 3/17 available modules
+##  Version:  1.5.4 (14-Jun-2001)
+##  Contents: 3/17 available modules
 ##
 
 ##
@@ -26,7 +26,7 @@
 ##  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 ##  USA, or contact Ralf S. Engelschall <rse@engelschall.com>.
 ##
-##  Notice: Given that you include this file verbatim into your own
+##  NOTICE: Given that you include this file verbatim into your own
 ##  source tree, you are justified in saying that it remains separate
 ##  from your package, and that this way you are simply just using GNU
 ##  shtool. So, in this situation, there is no requirement that your
@@ -55,7 +55,7 @@
 ##    arx        Extended archive command
 ##    slo        Separate linker options by library class
 ##    scpp       Sharing C Pre-Processor
-##    version    Generate and maintain a version information file
+##    version    Maintain a version information file
 ##    path       Deal with program paths
 ##
 
@@ -65,21 +65,22 @@ if [ $# -eq 0 ]; then
     exit 1
 fi
 if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then
-    echo "This is GNU shtool, version 1.4.9 (16-Apr-2000)"
-    echo "Copyright (c) 1994-2000 Ralf S. Engelschall <rse@engelschall.com>"
+    echo "This is GNU shtool, version 1.5.4 (14-Jun-2001)"
+    echo "Copyright (c) 1994-2001 Ralf S. Engelschall <rse@engelschall.com>"
     echo "Report bugs to <bug-shtool@gnu.org>"
     echo ''
-    echo "Usage: shtool [<options>] [<cmd-name> [<cmd-options>] [<cmd-args>]]" 
+    echo "Usage: shtool [<options>] [<cmd-name> [<cmd-options>] [<cmd-args>]]"
     echo ''
     echo 'Available global <options>:'
     echo '  -v, --version   display shtool version information'
     echo '  -h, --help      display shtool usage help page (this one)'
     echo '  -d, --debug     display shell trace information'
+    echo '  -r, --recreate  recreate this shtool script via shtoolize'
     echo ''
     echo 'Available <cmd-name> [<cmd-options>] [<cmd-args>]:'
     echo '  echo     [-n] [-e] [<str> ...]'
     echo '  install  [-v] [-t] [-c] [-C] [-s] [-m<mode>] [-o<owner>] [-g<group>]'
-    echo '           [-e<ext>] <file> <path>'
+    echo '           [-e<sed-cmd>] <file> [<file> ...] <path>'
     echo '  mkdir    [-t] [-f] [-p] [-m<mode>] <dir> [<dir> ...]'
     echo ''
     echo 'Not available <cmd-name> (because module was not built-in):'
@@ -90,21 +91,25 @@ if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then
     echo '  mkln     [-t] [-f] [-s] <src-path> [<src-path> ...] <dst-path>'
     echo '  mkshadow [-v] [-t] [-a] <src-dir> <dst-dir>'
     echo '  fixperm  [-v] [-t] <path> [<path> ...]'
-    echo '  tarball  [-t] [-v] [-o <tarball>] [-c <prog>] [-d <dir>] [-u'
-    echo '           <user>] [-g <group>] [-e <pattern>] <path> [<path> ...]'
+    echo '  tarball  [-t] [-v] [-o<tarball>] [-c<prog>] [-d<dir>] [-u<user>]'
+    echo '           [-g<group>] [-e<pattern>] <path> [<path> ...]'
     echo '  guessos  '
     echo '  arx      [-t] [-C<cmd>] <op> <archive> [<file> ...]'
     echo '  slo      [-p<str>] -- -L<dir> -l<lib> [-L<dir> -l<lib> ...]'
     echo '  scpp     [-v] [-p] [-f<filter>] [-o<ofile>] [-t<tfile>] [-M<mark>]'
     echo '           [-D<dname>] [-C<cname>] <file> [<file> ...]'
-    echo '  version  [-l<lang>] [-n<name>] [-p<prefix>] [-s<version>] [-i<knob>]'
-    echo '           [-d<type>] <file>'
+    echo '  version  [-l<lang>] [-n<name>] [-p<prefix>] [-s<version>] [-e]'
+    echo '           [-i<knob>] [-d<type>] <file>'
     echo '  path     [-s] [-r] [-d] [-b] [-m] [-p<path>] <str> [<str> ...]'
     echo ''
     exit 0
 fi
 if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then
-    echo "GNU shtool 1.4.9 (16-Apr-2000)"
+    echo "GNU shtool 1.5.4 (14-Jun-2001)"
+    exit 0
+fi
+if [ ".$1" = ".-r" -o ".$1" = ."--recreate" ]; then
+    shtoolize -ofoo echo install mkdir
     exit 0
 fi
 if [ ".$1" = ".-d" -o ".$1" = ."--debug" ]; then
@@ -142,15 +147,15 @@ case $tool in
         ;;
     install )
         str_tool="install"
-        str_usage="[-v] [-t] [-c] [-C] [-s] [-m<mode>] [-o<owner>] [-g<group>] [-e<ext>] <file> <path>"
-        arg_spec="2="
-        opt_spec="v.t.c.C.s.m:o:g:e:"
+        str_usage="[-v] [-t] [-c] [-C] [-s] [-m<mode>] [-o<owner>] [-g<group>] [-e<sed-cmd>] <file> [<file> ...] <path>"
+        arg_spec="2+"
+        opt_spec="v.t.c.C.s.m:o:g:e+"
         opt_v=no
         opt_t=no
         opt_c=no
         opt_C=no
         opt_s=no
-        opt_m=""
+        opt_m="0755"
         opt_o=""
         opt_g=""
         opt_e=""
@@ -312,6 +317,7 @@ if [ ".$gen_tmpfile" = .yes ]; then
     tmpfile="$tmpdir/.shtool.$$"
     rm -f $tmpfile >/dev/null 2>&1
     touch $tmpfile
+    chmod 600 $tmpfile
 fi
 
 ##
@@ -323,7 +329,7 @@ case $tool in
 echo )
     ##
     ##  echo -- Print string with optional construct expansion
-    ##  Copyright (c) 1998-2000 Ralf S. Engelschall <rse@engelschall.com>
+    ##  Copyright (c) 1998-2001 Ralf S. Engelschall <rse@engelschall.com>
     ##  Originally written for WML as buildinfo
     ##
     
@@ -347,7 +353,7 @@ echo )
     fi
     
     #   determine terminal bold sequence
-    term_bold='' 
+    term_bold=''
     term_norm=''
     if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[Bb]'`" != . ]; then
         case $TERM in
@@ -398,7 +404,7 @@ echo )
     
     #   determine user name
     username=''
-    if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[uU]'`" != . ]; then
+    if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[uUgG]'`" != . ]; then
         username="$LOGNAME"
         if [ ".$username" = . ]; then
             username="$USER"
@@ -440,8 +446,38 @@ echo )
         fi
     fi
     
-    #   determine host name
+    #   determine (primary) group id
+    groupid=''
+    if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[gG]'`" != . ]; then
+        groupid=`egrep "^${username}:" /etc/passwd 2>/dev/null | \
+                 sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
+        if [ ".$groupid" = . ]; then
+            groupid=`(ypcat passwd) 2>/dev/null | egrep "^${username}:" | \
+                     sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
+            if [ ".$groupid" = . ]; then
+                groupid='?'
+            fi
+        fi
+    fi
+    
+    #   determine (primary) group name
+    groupname=''
+    if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%g'`" != . ]; then
+        groupname=`egrep "^[^:]*:[^:]*:${groupid}:" /etc/group 2>/dev/null | \
+                   sed -e 's/:.*$//'`
+        if [ ".$groupname" = . ]; then
+            groupname=`(ypcat group) 2>/dev/null | \
+                       egrep "^[^:]*:[^:]*:${groupid}:" | \
+                       sed -e 's/:.*$//'`
+            if [ ".$groupname" = . ]; then
+                groupname='?'
+            fi
+        fi
+    fi
+    
+    #   determine host and domain name
     hostname=''
+    domainname=''
     if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%h'`" != . ]; then
         hostname="`(uname -n) 2>/dev/null |\
                    awk '{ printf("%s", $1); }'`"
@@ -459,9 +495,6 @@ echo )
                 ;;
         esac
     fi
-    
-    #   determine domain name
-    domainname=''
     if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%d'`" != . ]; then
         if [ ".$domainname" = . ]; then
             if [ -f /etc/resolv.conf ]; then
@@ -521,6 +554,8 @@ echo )
                   -e "s/%b/${term_norm}/g" \
                   -e "s/%u/${username}/g" \
                   -e "s/%U/${userid}/g" \
+                  -e "s/%g/${groupname}/g" \
+                  -e "s/%G/${groupid}/g" \
                   -e "s/%h/${hostname}/g" \
                   -e "s/%d/${domainname}/g" \
                   -e "s/%D/${time_day}/g" \
@@ -546,114 +581,144 @@ echo )
 install )
     ##
     ##  install -- Install a program, script or datafile
-    ##  Copyright (c) 1997-2000 Ralf S. Engelschall <rse@engelschall.com>
+    ##  Copyright (c) 1997-2001 Ralf S. Engelschall <rse@engelschall.com>
     ##  Originally written for shtool
     ##
     
-    src="$1"
-    dst="$2"
-    
-    #  If destination is a directory, append the input filename
-    if [ -d $dst ]; then
-        dst=`echo "$dst" | sed -e 's:/$::'`
-        dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'`
-        dst="$dst/$dstfile"
-    fi
+    #   determine source(s) and destination
+    argc=$#
+    srcs=""
+    while [ $# -gt 1 ]; do
+        srcs="$srcs $1"
+        shift
+    done
+    dstpath="$1"
     
-    #  Add a possible extension to src and dst
-    if [ ".$opt_e" != . ]; then
-        src="$src$opt_e"
-        dst="$dst$opt_e"
+    #   type check for destination
+    dstisdir=0
+    if [ -d $dstpath ]; then
+        dstpath=`echo "$dstpath" | sed -e 's:/$::'`
+        dstisdir=1
     fi
     
-    #  Check for correct arguments
-    if [ ".$src" = ".$dst" ]; then
-        echo "$msgprefix:Error: source and destination are the same" 1>&2
+    #   consistency check for destination
+    if [ $argc -gt 2 -a $dstisdir = 0 ]; then
+        echo "$msgprefix:Error: multiple sources require destination to be directory" 1>&2
         exit 1
     fi
     
-    #  Make a temp file name in the destination directory
-    dstdir=`echo $dst | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;'`
-    dsttmp="$dstdir/#INST@$$#"
+    #   iterate over all source(s)
+    for src in $srcs; do
+        dst=$dstpath
     
-    #  Verbosity
-    if [ ".$opt_v" = .yes ]; then
-        echo "$src -> $dst" 1>&2
-    fi
+        #   if destination is a directory, append the input filename
+        if [ $dstisdir = 1 ]; then
+            dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'`
+            dst="$dst/$dstfile"
+        fi
     
-    #  Copy or move the file name to the temp name
-    #  (because we might be not allowed to change the source)
-    if [ ".$opt_C" = .yes ]; then
-        opt_c=yes
-    fi
-    if [ ".$opt_c" = .yes ]; then
-        if [ ".$opt_t" = .yes ]; then
-            echo "cp $src $dsttmp" 1>&2
+        #   check for correct arguments
+        if [ ".$src" = ".$dst" ]; then
+            echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2
+            continue
         fi
-        cp $src $dsttmp || exit $?
-    else
-        if [ ".$opt_t" = .yes ]; then
-            echo "mv $src $dsttmp" 1>&2
+        if [ -d "$src" ]; then
+            echo "$msgprefix:Warning: source \`$src' is a directory - skipped" 1>&2
+            continue
         fi
-        mv $src $dsttmp || exit $?
-    fi
     
-    #  Adjust the target file
-    #  (we do chmod last to preserve setuid bits)
-    if [ ".$opt_s" = .yes ]; then
-        if [ ".$opt_t" = .yes ]; then
-            echo "strip $dsttmp" 1>&2
-        fi
-        strip $dsttmp || exit $?
-    fi
-    if [ ".$opt_o" != . ]; then
-        if [ ".$opt_t" = .yes ]; then
-            echo "chown $opt_o $dsttmp" 1>&2
+        #   make a temp file name in the destination directory
+        dsttmp=`echo $dst |\
+                sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \
+                    -e "s;\$;/#INST@$$#;"`
+    
+        #   verbosity
+        if [ ".$opt_v" = .yes ]; then
+            echo "$src -> $dst" 1>&2
         fi
-        chown $opt_o $dsttmp || exit $?
-    fi
-    if [ ".$opt_g" != . ]; then
-        if [ ".$opt_t" = .yes ]; then
-            echo "chgrp $opt_g $dsttmp" 1>&2
+    
+        #   copy or move the file name to the temp name
+        #   (because we might be not allowed to change the source)
+        if [ ".$opt_C" = .yes ]; then
+            opt_c=yes
         fi
-        chgrp $opt_g $dsttmp || exit $?
-    fi
-    if [ ".$opt_m" != . ]; then
-        if [ ".$opt_t" = .yes ]; then
-            echo "chmod $opt_m $dsttmp" 1>&2
+        if [ ".$opt_c" = .yes ]; then
+            if [ ".$opt_t" = .yes ]; then
+                echo "cp $src $dsttmp" 1>&2
+            fi
+            cp $src $dsttmp || exit $?
+        else
+            if [ ".$opt_t" = .yes ]; then
+                echo "mv $src $dsttmp" 1>&2
+            fi
+            mv $src $dsttmp || exit $?
         fi
-        chmod $opt_m $dsttmp || exit $?
-    fi
     
-    #   Determine whether to do a quick install
-    #   (has to be done _after_ the strip was already done)
-    quick=no
-    if [ ".$opt_C" = .yes ]; then
-        if [ -r $dst ]; then
-            if cmp -s $src $dst; then
-                quick=yes
+        #   adjust the target file
+        if [ ".$opt_e" != . ]; then
+            sed='sed'
+            for e in $opt_e; do
+                sed="$sed -e '$e'"
+            done
+            cp $dsttmp $dsttmp.old
+            eval "$sed <$dsttmp.old >$dsttmp" || exit $?
+            rm -f $dsttmp.old
+        fi
+        if [ ".$opt_s" = .yes ]; then
+            if [ ".$opt_t" = .yes ]; then
+                echo "strip $dsttmp" 1>&2
             fi
+            strip $dsttmp || exit $?
+        fi
+        if [ ".$opt_o" != . ]; then
+            if [ ".$opt_t" = .yes ]; then
+                echo "chown $opt_o $dsttmp" 1>&2
+            fi
+            chown $opt_o $dsttmp || exit $?
+        fi
+        if [ ".$opt_g" != . ]; then
+            if [ ".$opt_t" = .yes ]; then
+                echo "chgrp $opt_g $dsttmp" 1>&2
+            fi
+            chgrp $opt_g $dsttmp || exit $?
+        fi
+        if [ ".$opt_m" != ".-" ]; then
+            if [ ".$opt_t" = .yes ]; then
+                echo "chmod $opt_m $dsttmp" 1>&2
+            fi
+            chmod $opt_m $dsttmp || exit $?
         fi
-    fi
     
-    #   Finally install the file to the real destination
-    if [ $quick = yes ]; then
-        if [ ".$opt_t" = .yes ]; then
-            echo "rm -f $dsttmp" 1>&2
+        #   determine whether to do a quick install
+        #   (has to be done _after_ the strip was already done)
+        quick=no
+        if [ ".$opt_C" = .yes ]; then
+            if [ -r $dst ]; then
+                if cmp -s $src $dst; then
+                    quick=yes
+                fi
+            fi
         fi
-        rm -f $dsttmp
-    else
-        if [ ".$opt_t" = .yes ]; then
-            echo "rm -f $dst && mv $dsttmp $dst" 1>&2
+    
+        #   finally, install the file to the real destination
+        if [ $quick = yes ]; then
+            if [ ".$opt_t" = .yes ]; then
+                echo "rm -f $dsttmp" 1>&2
+            fi
+            rm -f $dsttmp
+        else
+            if [ ".$opt_t" = .yes ]; then
+                echo "rm -f $dst && mv $dsttmp $dst" 1>&2
+            fi
+            rm -f $dst && mv $dsttmp $dst
         fi
-        rm -f $dst && mv $dsttmp $dst
-    fi
+    done
     ;;
 
 mkdir )
     ##
     ##  mkdir -- Make one or more directories
-    ##  Copyright (c) 1996-2000 Ralf S. Engelschall <rse@engelschall.com>
+    ##  Copyright (c) 1996-2001 Ralf S. Engelschall <rse@engelschall.com>
     ##  Originally written for public domain by Noah Friedman <friedman@prep.ai.mit.edu>
     ##  Cleaned up and enhanced for shtool
     ##
@@ -662,7 +727,7 @@ mkdir )
     for p in ${1+"$@"}; do
         #   if the directory already exists...
         if [ -d "$p" ]; then
-            if [ ".$opt_f" = .no ] && [ ".$opt_p" = .no ]; then
+            if [ ".$opt_f" = .no -a ".$opt_p" = .no ]; then
                 echo "$msgprefix:Error: directory already exists: $p" 1>&2
                 errstatus=1
                 break
@@ -676,6 +741,12 @@ mkdir )
                 echo "mkdir $p" 1>&2
             fi
             mkdir $p || errstatus=$?
+            if [ ".$opt_m" != . ]; then
+                if [ ".$opt_t" = .yes ]; then
+                    echo "chmod $opt_m $p" 1>&2
+                fi
+                chmod $opt_m $p || errstatus=$?
+            fi
         else
             #   the smart situation
             set fnord `echo ":$p" |\
diff --git a/build/sysv_makefile b/build/sysv_makefile
deleted file mode 100755 (executable)
index 06b2bd2..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#! /bin/sh
-#  +----------------------------------------------------------------------+
-#  | PHP Version 4                                                        |
-#  +----------------------------------------------------------------------+
-#  | Copyright (c) 1997-2002 The PHP Group                                |
-#  +----------------------------------------------------------------------+
-#  | This source file is subject to version 2.02 of the PHP license,      |
-#  | that is bundled with this package in the file LICENSE, and is        |
-#  | available at through the world-wide-web at                           |
-#  | http://www.php.net/license/2_02.txt.                                 |
-#  | If you did not receive a copy of the PHP license and are unable to   |
-#  | obtain it through the world-wide-web, please send a note to          |
-#  | license@php.net so we can mail you a copy immediately.               |
-#  +----------------------------------------------------------------------+
-#  | Author: Sascha Schumann <sascha@schumann.cx>                         |
-#  +----------------------------------------------------------------------+
-#
-# $Id$ 
-#
-
-# cwd must be top_srcdir
-test -f build/sysv_makefile || exit 2
-
-test -f bsd_converted || exit 1
-
-tmpfile=`mktemp /tmp/sysv_makefile.XXXXXX` || tmpfile="tmp.$$"
-for i in build/*.mk; do
-    sed 's/^\.include "\(.*\)"/include \1/' $i >$tmpfile \
-        && cp $tmpfile $i
-done
-rm -f $tmpfile
-
-rm bsd_converted
-exit 0
index 00081be1ca9dedae9fab93313e49d9942e2e3ca2..16d647508f71dfc8ac71fa1cd607fb0d022045b6 100644 (file)
@@ -36,10 +36,9 @@ for arg in $0 "$@"; do
 done
 
 AC_CANONICAL_HOST
-AM_INIT_AUTOMAKE(php, 4.3.0-dev, nodefine)
-AM_CONFIG_HEADER(main/php_config.h)
-AM_MAINTAINER_MODE
+AC_CONFIG_HEADER(main/php_config.h)
 
+VERSION=4.3.0-dev
 
 
 dnl Setting up the PHP version based on the information above.
@@ -109,6 +108,8 @@ dnl -------------------------------------------------------------------------
 
 cwd=`pwd`
 
+PHP_INIT_BUILD_SYSTEM
+
 php_shtool=$srcdir/build/shtool
 T_MD=`$php_shtool echo -n -e %B`
 T_ME=`$php_shtool echo -n -e %b`
@@ -130,16 +131,13 @@ dnl or the contents of libs.
 $php_shtool mkdir -p libs
 rm -f libs/*
 
-PHP_FAST_OUTPUT(sapi/Makefile ext/Makefile Makefile pear/Makefile main/Makefile sapi/cli/Makefile)
-
-
 dnl Checks for programs.
 dnl -------------------------------------------------------------------------
 
 AC_PROG_CC
 AC_PROG_CC_C_O
 dnl Change to AC_PROG_CC_STDC when we start requiring a post-2.13 autoconf
-AM_PROG_CC_STDC
+dnl AC_PROG_CC_STDC
 AC_PROG_CPP
 AC_PROG_CXX
 AC_PROG_CXXCPP
@@ -220,7 +218,7 @@ dnl -------------------------------------------------------------------------
 PTHREADS_CHECK
 PHP_HELP_SEPARATOR([SAPI modules:])
 PHP_SHLIB_SUFFIX_NAME
-PHP_SAPI=cgi
+PHP_SAPI=default
 PHP_BUILD_PROGRAM
 
 
@@ -238,6 +236,10 @@ PHP_CONFIGURE_PART(Configuring SAPI modules)
 
 esyscmd(./scripts/config-stubs sapi)
 
+if test "$PHP_SAPI" = "default"; then
+  PHP_SELECT_SAPI(cgi, program, cgi_main.c getopt.c)
+fi
+
 AC_MSG_CHECKING([for chosen SAPI module])
 AC_MSG_RESULT([$PHP_SAPI])
 
@@ -247,7 +249,6 @@ if test "$enable_experimental_zts" = "yes"; then
 fi
 
 
-
 divert(3)
 
 dnl ## In diversion 3 we check for compile-time options to the PHP
@@ -769,9 +770,6 @@ PHP_CONFIGURE_PART(Configuring extensions)
 # reading config stubs
 esyscmd(./scripts/config-stubs ext)
 
-PHP_FAST_OUTPUT(sapi/$PHP_SAPI/Makefile)
-
-
 
 dnl Other settings.
 dnl -------------------------------------------------------------------------
@@ -802,11 +800,9 @@ unset with_pic
 case $php_build_target in
 program|static)
     standard_libtool_flag='-prefer-non-pic -static'
-    if test "$lib_build_shared" != "yes"; then
+    if test -z "$PHP_MODULES"; then
         enable_shared=no
     fi
-    PHP_COMPILE='$(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) -c $< && touch $@'
-    CXX_PHP_COMPILE='$(CXX) $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)  -c $< && touch $@'
 ;;
 shared)
     enable_static=no
@@ -815,15 +811,6 @@ shared)
 ;;
 esac
 
-if test "$PHP_SAPI" = "cgi"; then
-  PHP_PROGRAM=php
-fi
-
-if test "$PHP_SAPI" = "fastcgi"; then
-  PHP_PROGRAM=php
-fi
-
-
 PHP_REGEX
 
 EXTRA_LIBS="$EXTRA_LIBS $DLIBS $LIBS"
@@ -960,20 +947,19 @@ AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME",[uname -a output])
 PHP_OS=`uname`
 AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS",[uname output])
 
-if test "$disable_cli" = "1"; then
-  CLI_DIR=
-else
-  CLI_DIR=sapi/cli
+if test "$disable_cli" != "1"; then
+  PHP_CLI_TARGET=sapi/cli/php
+  PHP_ADD_SOURCES(sapi/cli, php_cli.c getopt.c,, cli)
 fi
 
-PHP_SUBST(CLI_DIR)
+PHP_SUBST(PHP_CLI_TARGET)
+PHP_SUBST(PHP_SAPI_OBJS)
+PHP_SUBST(PHP_CLI_OBJS)
+PHP_SUBST(PHP_GLOBAL_OBJS)
+
+PHP_SUBST(PHP_MODULES)
 
-PHP_SUBST(EXT_SUBDIRS)
-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)
@@ -1020,7 +1006,7 @@ PHP_SUBST(PHP_BUILD_DATE)
 PHP_SUBST(PHP_COMPILE)
 PHP_SUBST_OLD(PHP_LDFLAGS)
 PHP_SUBST_OLD(PHP_LIBS)
-PHP_SUBST(PHP_PROGRAM)
+PHP_SUBST(OVERALL_TARGET)
 PHP_SUBST(PHP_RPATHS)
 PHP_SUBST(PHP_SAPI)
 PHP_SUBST(PHP_VERSION)
@@ -1051,9 +1037,9 @@ if test "$PHP_THREAD_SAFETY" = "yes" && test "$PHP_MYSQL" = "yes"; then
   CPPFLAGS="$CPPFLAGS -DTHREAD=1"
 fi
 
-AM_PROG_LIBTOOL
+AC_PROG_LIBTOOL
 if test "$enable_debug" != "yes"; then
-  AM_SET_LIBTOOL_VARIABLE([--silent])
+  PHP_SET_LIBTOOL_VARIABLE([--silent])
 fi
 
 
@@ -1071,13 +1057,61 @@ CFLAGS="$CFLAGS $standard_libtool_flag"
 INLINE_CFLAGS="$INLINE_CFLAGS $standard_libtool_flag"
 CXXFLAGS="$CXXFLAGS $standard_libtool_flag"
 
-PHP_GEN_CONFIG_VARS
+all_targets='$(OVERALL_TARGET) $(PHP_MODULES) $(PHP_CLI_TARGET)'
+install_targets='install-sapi install-modules install-cli install-data-local install-headers install-build install-programs'
+PHP_SUBST(all_targets)
+PHP_SUBST(install_targets)
+
+PHP_ADD_SOURCES(TSRM, TSRM.c tsrm_strtok_r.c tsrm_virtual_cwd.c)
+
+PHP_ADD_SOURCES(main, main.c snprintf.c php_sprintf.c \
+       safe_mode.c fopen_wrappers.c alloca.c \
+       php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \
+       strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c \
+       streams.c network.c php_open_temporary_file.c php_logos.c \
+       output.c)
+PHP_ADD_SOURCES(/main, internal_functions.c,, sapi)
+PHP_ADD_SOURCES(/main, internal_functions_cli.c,, cli)
+
+PHP_ADD_SOURCES(/Zend,  zend_language_parser.c zend_language_scanner.c \
+    zend_ini_parser.c zend_ini_scanner.c)
+       
+PHP_ADD_SOURCES(Zend, \
+    zend_alloc.c zend_compile.c zend_constants.c zend_dynamic_array.c \
+    zend_execute_API.c zend_highlight.c zend_llist.c \
+    zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \
+    zend_variables.c zend.c zend_API.c zend_extensions.c zend_hash.c \
+    zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c \
+    zend_ini.c zend_qsort.c)
+
+dnl Selectively disable optimization due to high RAM usage during
+dnl compiling the executor.
+if test -n "$GCC" && test "$ZEND_INLINE_OPTIMIZATION" != "yes"; then
+  flag=-O0
+else
+  flag=
+fi
+
+PHP_ADD_SOURCES_X(Zend, zend_execute.c,,PHP_GLOBAL_OBJS,,$flag)
+
+PHP_ADD_BUILD_DIR(main)
+PHP_ADD_BUILD_DIR(regex)
+PHP_ADD_BUILD_DIR(sapi/$PHP_SAPI sapi/cli)
+PHP_ADD_BUILD_DIR(TSRM)
+PHP_ADD_BUILD_DIR(Zend)
+
+
+PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/pear/Makefile.frag,$abs_srcdir/pear,pear)
+PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/Makefile.frag,$abs_srcdir/Zend,Zend)
+
+PHP_GEN_BUILD_DIRS
+PHP_GEN_GLOBAL_MAKEFILE
 
 $php_shtool mkdir -p pear/scripts
-ALL_OUTPUT_FILES="php4.spec Zend/Makefile main/build-defs.h \
+ALL_OUTPUT_FILES="php4.spec main/build-defs.h \
 pear/scripts/pear pear/scripts/phpize pear/scripts/php-config \
 pear/scripts/pearize pear/scripts/phptar pear/scripts/pear-get \
-TSRM/Makefile $PHP_OUTPUT_FILES"
+$PHP_OUTPUT_FILES"
 
 AC_OUTPUT($ALL_OUTPUT_FILES, [], [
 
@@ -1085,10 +1119,6 @@ if test "\$CONFIG_FILES" = "$ALL_OUTPUT_FILES" || test -z "\$CONFIG_FILES"; then
   REDO_ALL=yes
 fi
 
-if test -n "\$REDO_ALL"; then
-  PHP_GEN_MAKEFILES($PHP_FAST_OUTPUT_FILES)
-fi
-                  
 if test ! -f $srcdir/ext/bcmath/number.c; then
        echo "creating number.c"
        echo "/* Dummy File */" > $srcdir/ext/bcmath/number.c
diff --git a/dynlib.m4 b/dynlib.m4
deleted file mode 100644 (file)
index 610e7d8..0000000
--- a/dynlib.m4
+++ /dev/null
@@ -1,88 +0,0 @@
-#  +----------------------------------------------------------------------+
-#  | PHP Version 4                                                        |
-#  +----------------------------------------------------------------------+
-#  | Copyright (c) 1997-2002 The PHP Group                                |
-#  +----------------------------------------------------------------------+
-#  | This source file is subject to version 2.02 of the PHP license,      |
-#  | that is bundled with this package in the file LICENSE, and is        |
-#  | available at through the world-wide-web at                           |
-#  | http://www.php.net/license/2_02.txt.                                 |
-#  | If you did not receive a copy of the PHP license and are unable to   |
-#  | obtain it through the world-wide-web, please send a note to          |
-#  | license@php.net so we can mail you a copy immediately.               |
-#  +----------------------------------------------------------------------+
-#  | Author: Sascha Schumann <sascha@schumann.cx>                         |
-#  +----------------------------------------------------------------------+
-#
-# $Id$ 
-#
-
-
-
-AC_DEFUN(LIB_SHARED_CONVENIENCE,[
-  lib_target="\$(LTLIBRARY_NAME)"
-  cat >>$1<<EOF
-\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
-       \$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \[$]@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
-
-EOF
-])
-
-AC_DEFUN(LIB_SHARED_MODULE,[
-  lib_target="\$(LTLIBRARY_SHARED_NAME)"
-  cat >>$1<<EOF
-\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
-       \$(SHARED_LIBTOOL) --mode=link \$(CC) \$(COMMON_FLAGS) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(LDFLAGS) -o \[$]@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
-       \$(SHARED_LIBTOOL) --mode=install cp \[$]@ \$(phplibdir)
-
-EOF
-])
-
-AC_DEFUN(LIB_STATIC_CONVENIENCE,[
-  lib_target="\$(LTLIBRARY_NAME)"
-  cat >>$1<<EOF
-\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
-       \$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)
-
-EOF
-])
-
-dnl LIB_BUILD(path, shared, convenience)
-dnl sets up path to build a shared/static convenience/module
-AC_DEFUN(LIB_BUILD,[
-  lib_makefile="$1/libs.mk"
-  lib_target=""
-  
-  $php_shtool mkdir -p $1
-  if test "$BSD_MAKEFILE" = "yes"; then
-    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
-  else
-    lib_include_conf="include \$(top_builddir)/config_vars.mk"
-  fi
-  cat >$lib_makefile<<EOF
-$lib_include_conf
-LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
-LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
-EOF
-
-  if test "$2" = "shared" || test "$2" = "yes"; then
-    lib_build_shared=yes
-    if test -n "$3"; then
-dnl ---------------------------------------- Shared Convenience
-      LIB_SHARED_CONVENIENCE($lib_makefile)
-    else
-dnl ---------------------------------------- Shared Module
-      LIB_SHARED_MODULE($lib_makefile)
-    fi
-  else
-dnl ---------------------------------------- Static Convenience = Static Module
-    LIB_STATIC_CONVENIENCE($lib_makefile)
-  fi
-
-dnl ---------------------------------------- Generate build targets
-  if test -n "$lib_target"; then
-    cat >>$lib_makefile<<EOF
-targets = $lib_target
-EOF
-  fi
-])
diff --git a/ext/bcmath/Makefile.in b/ext/bcmath/Makefile.in
deleted file mode 100644 (file)
index e57936f..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-
-LTLIBRARY_NAME    = libbcmath.la
-LTLIBRARY_SOURCES = bcmath.c number.c
-LTLIBRARY_SHARED_NAME = bcmath.la
-LTLIBRARY_DEPENDENCIES  = libbcmath/libbcmath.la
-LTLIBRARY_LIBADD        = $(LTLIBRARY_DEPENDENCIES)
-LTLIBRARY_SHARED_LIBADD = $(LTLIBRARY_LIBADD)
-
-SUBDIRS = libbcmath
-
-include $(top_srcdir)/build/dynlib.mk
index 4d6e7bc02892e4ab2c43fcff45ad3833c2a039a8..a4fbb600303a4c77bdb64a0bcd6707b2715c68e3 100644 (file)
@@ -7,8 +7,11 @@ PHP_ARG_ENABLE(bcmath, whether to enable bc style precision math functions,
 
 if test "$PHP_BCMATH" != "no"; then
   AC_DEFINE(WITH_BCMATH, 1, [Whether you have bcmath])
-  PHP_EXTENSION(bcmath, $ext_shared)
-  PHP_FAST_OUTPUT($ext_builddir/libbcmath/Makefile $ext_builddir/libbcmath/src/Makefile)
-  LIB_BUILD($ext_builddir/libbcmath,$ext_shared,yes)
-  LIB_BUILD($ext_builddir/libbcmath/src,$ext_shared,yes)
+  PHP_NEW_EXTENSION(bcmath, bcmath.c number.c \
+libbcmath/src/add.c libbcmath/src/div.c libbcmath/src/init.c libbcmath/src/neg.c libbcmath/src/outofmem.c libbcmath/src/raisemod.c libbcmath/src/rt.c libbcmath/src/sub.c \
+libbcmath/src/compare.c libbcmath/src/divmod.c libbcmath/src/int2num.c libbcmath/src/num2long.c libbcmath/src/output.c libbcmath/src/recmul.c \
+libbcmath/src/sqrt.c libbcmath/src/zero.c libbcmath/src/debug.c libbcmath/src/doaddsub.c libbcmath/src/nearzero.c libbcmath/src/num2str.c libbcmath/src/raise.c \
+libbcmath/src/rmzero.c libbcmath/src/str2num.c,
+          $ext_shared,,-I@ext_srcdir@/libbcmath/src)
+  PHP_ADD_BUILD_DIR($ext_builddir/libbcmath/src)
 fi
diff --git a/ext/bcmath/libbcmath/Makefile.in b/ext/bcmath/libbcmath/Makefile.in
deleted file mode 100644 (file)
index 0743bd7..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-
-LTLIBRARY_NAME          = libbcmath.la
-LTLIBRARY_DEPENDENCIES  = src/libbcmath.la
-LTLIBRARY_LIBADD        = $(LTLIBRARY_DEPENDENCIES)
-LTLIBRARY_SHARED_LIBADD = $(LTLIBRARY_LIBADD)
-
-SUBDIRS = src
-
-include $(top_srcdir)/build/dynlib.mk
diff --git a/ext/bcmath/libbcmath/src/Makefile.in b/ext/bcmath/libbcmath/src/Makefile.in
deleted file mode 100644 (file)
index f4a235f..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-LTLIBRARY_NAME          = libbcmath.la
-LTLIBRARY_SOURCES       =              add.c div.c init.c neg.c outofmem.c raisemod.c rt.c sub.c \
-                                                               compare.c divmod.c int2num.c num2long.c output.c recmul.c \
-                                                               sqrt.c zero.c debug.c doaddsub.c nearzero.c num2str.c raise.c \
-                                                               rmzero.c str2num.c 
-
-include $(top_srcdir)/build/dynlib.mk
index cbe6d9ad5c5f1130fd0f002ba1a1f56bf6499716..bcd959645f10523a30e3a36898d68e684639488d 100644 (file)
@@ -104,7 +104,7 @@ PHP_ARG_WITH(dom-xslt, for DOM XSLT support,
                           DIR is the libxslt install directory.])
 
 PHP_ARG_WITH(dom-exslt, for DOM EXSLT support,
-[  --with-dom-exslt[=DIR]   Include DOM EXSLT support (requires libxslt >= 1.0.3).
+[  --with-dom-exslt[=DIR]  Include DOM EXSLT support (requires libxslt >= 1.0.3).
                           DIR is the libexslt install directory.])
 
 if test "$PHP_DOM_XSLT" != "no"; then
index 0cde8133446c6752c3f0c28ff0de778b70815f52..78c473920c6990b0128cd64b71c2a9d0f048cc6b 100755 (executable)
@@ -156,31 +156,17 @@ if test "\$PHP_$EXTNAME" != "no"; then
   dnl
   dnl PHP_SUBST(${EXTNAME}_SHARED_LIBADD)
 
-  PHP_EXTENSION($extname, \$ext_shared)
+  PHP_NEW_EXTENSION($extname, $extname.c, \$ext_shared)
 fi
 eof
 
-$ECHO_N " Makefile.in$ECHO_C"
-cat >Makefile.in <<eof
-# \$Id\$
-
-LTLIBRARY_NAME          = lib$extname.la
-LTLIBRARY_SOURCES       = $extname.c
-LTLIBRARY_SHARED_NAME   = $extname.la
-LTLIBRARY_SHARED_LIBADD = \$(${EXTNAME}_SHARED_LIBADD)
-
-include \$(top_srcdir)/build/dynlib.mk
-eof
-
 
 $ECHO_N " .cvsignore$ECHO_C"
 cat >.cvsignore <<eof
 .deps
-Makefile
 *.lo
 *.la
 .libs
-libs.mk
 eof
 
 $ECHO_N " $extname.c$ECHO_C"
diff --git a/ext/informix/Makefile.frag b/ext/informix/Makefile.frag
new file mode 100644 (file)
index 0000000..815a9e2
--- /dev/null
@@ -0,0 +1,10 @@
+
+$(builddir)/ifx.c: $(srcdir)/ifx.ec $(builddir)/libphpifx.a
+       (if test -d $(INFORMIXDIR); then \
+          THREADLIB=POSIX $(INFORMIXDIR)/bin/esql -e $(IFX_ESQL_FLAGS) $(srcdir)/ifx.ec; mv ifx.c $@; \
+        else \
+          touch $@; \
+        fi)
+
+$(builddir)/libphpifx.a:
+       $(LINK) $(IFX_LIBOBJS)
index 5f1e268c9ef27a3decb5289f260a09b4c4b861d7..1a28ecd4fd93d624d460aa3ee749b559ce2e619d 100644 (file)
@@ -39,21 +39,32 @@ PHP_ARG_WITH(mysql, for MySQL support,
 [  --with-mysql[=DIR]      Include MySQL support. DIR is the MySQL base directory.
                           If unspecified, the bundled MySQL library will be used.], yes)
 
+if test "$PHP_MYSQL" = "yes"; then
+  sources="libmysql/libmysql.c libmysql/errmsg.c libmysql/net.c libmysql/violite.c libmysql/password.c \
+       libmysql/my_init.c libmysql/my_lib.c libmysql/my_static.c libmysql/my_malloc.c libmysql/my_realloc.c libmysql/my_create.c \
+       libmysql/my_delete.c libmysql/my_tempnam.c libmysql/my_open.c libmysql/mf_casecnv.c libmysql/my_read.c \
+       libmysql/my_write.c libmysql/errors.c libmysql/my_error.c libmysql/my_getwd.c libmysql/my_div.c libmysql/mf_pack.c \
+       libmysql/my_messnc.c libmysql/mf_dirname.c libmysql/mf_fn_ext.c libmysql/mf_wcomp.c libmysql/typelib.c libmysql/safemalloc.c \
+       libmysql/my_alloc.c libmysql/mf_format.c libmysql/mf_path.c libmysql/mf_unixpath.c libmysql/my_fopen.c libmysql/mf_loadpath.c \
+       libmysql/my_pthread.c libmysql/my_thr_init.c libmysql/thr_mutex.c libmysql/mulalloc.c libmysql/string.c libmysql/default.c \
+       libmysql/my_compress.c libmysql/array.c libmysql/my_once.c libmysql/list.c libmysql/my_net.c libmysql/dbug.c \
+       libmysql/strmov.c libmysql/strxmov.c libmysql/strnmov.c libmysql/strmake.c libmysql/strend.c libmysql/strfill.c \
+       libmysql/is_prefix.c libmysql/int2str.c libmysql/str2int.c libmysql/strinstr.c \
+       libmysql/strcont.c libmysql/strcend.c libmysql/bchange.c libmysql/bmove.c libmysql/bmove_upp.c \
+       libmysql/longlong2str.c libmysql/strtoull.c libmysql/strtoll.c libmysql/charset.c libmysql/ctype.c"
+else
+  sources=
+fi
+
 if test "$PHP_MYSQL" != "no"; then
   AC_DEFINE(HAVE_MYSQL, 1, [Whether you have MySQL])
-  PHP_EXTENSION(mysql,$ext_shared)
+  PHP_NEW_EXTENSION(mysql,php_mysql.c $sources, $ext_shared,,-I@ext_srcdir@/libmysql)
 fi
 
 if test "$PHP_MYSQL" = "yes"; then
   PHP_MYSQL_SOCK
   MYSQL_CHECKS
-  MYSQL_LIBADD=libmysql/libmysql_client.la
-  MYSQL_SHARED_LIBADD=libmysql/libmysql_client.la
-  MYSQL_SUBDIRS=libmysql
-  PHP_SUBST(MYSQL_LIBADD)
-  PHP_SUBST(MYSQL_SUBDIRS)
-  LIB_BUILD($ext_builddir/libmysql,$ext_shared,yes)
-  PHP_ADD_INCLUDE($ext_srcdir/libmysql)
+  PHP_ADD_BUILD_DIR($ext_builddir/libmysql)
   MYSQL_MODULE_TYPE=builtin
 elif test "$PHP_MYSQL" != "no"; then
   for i in $PHP_MYSQL; do
index 36bba66e5081dd43c19c2a3db8435818c523a4a0..23143e36a867c5a2e7cca7db51324e5cd7bd6c7c 100644 (file)
@@ -13,6 +13,4 @@ MYSQL_CHECK_PTHREAD_GETSPECIFIC
 MYSQL_CHECK_PTHREAD_MUTEX_INIT
 MYSQL_CHECK_READDIR_R_ARGS
 MYSQL_CHECK_SIGWAIT_STYLE
-
-PHP_FAST_OUTPUT($ext_builddir/libmysql/Makefile)
 ])
index cf973fe05218ab40f558aefdef4c6f336cd4e54f..7f03ddd3dfd9f20a578e4209b988aa30a67b0a86 100644 (file)
@@ -12,16 +12,10 @@ PHP_ARG_WITH(pcre-regex,for PCRE support,
                           if not using bundled library.],yes)
 
 if test "$PHP_PCRE_REGEX" != "no"; then
-  PHP_EXTENSION(pcre, $ext_shared)
   if test "$PHP_PCRE_REGEX" = "yes"; then
-    PCRE_LIBADD=pcrelib/libpcre.la
-    PCRE_SHARED_LIBADD=pcrelib/libpcre.la
-    PCRE_SUBDIRS=pcrelib
-    PHP_SUBST(PCRE_LIBADD)
-    PHP_SUBST(PCRE_SUBDIRS)
+    PHP_NEW_EXTENSION(pcre, pcrelib/maketables.c pcrelib/get.c pcrelib/study.c pcrelib/pcre.c php_pcre.c, $ext_shared,,-DSUPPORT_UTF8 -I@ext_srcdir@/pcrelib)
+    PHP_ADD_BUILD_DIR($ext_builddir/pcrelib)
     AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ])
-    PHP_FAST_OUTPUT($ext_builddir/pcrelib/Makefile)
-    LIB_BUILD($ext_builddir/pcrelib,$ext_shared,yes)
   else
     test -f $PHP_PCRE_REGEX/pcre.h && PCRE_INCDIR=$PHP_PCRE_REGEX
     test -f $PHP_PCRE_REGEX/include/pcre.h && PCRE_INCDIR=$PHP_PCRE_REGEX/include
@@ -52,8 +46,8 @@ if test "$PHP_PCRE_REGEX" != "no"; then
 
     PHP_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR, PCRE_SHARED_LIBADD)
     
-    PHP_ADD_INCLUDE($PCRE_INCDIR)
     AC_DEFINE(HAVE_PCRE, 1, [ ])
+    PHP_NEW_EXTENSION(pcre, php_pcre.c, $ext_shared,,-DSUPPORT_UTF8 -I$PCRE_INCDIR)
   fi
 fi
 PHP_SUBST(PCRE_SHARED_LIBADD)
index cf973fe05218ab40f558aefdef4c6f336cd4e54f..7f03ddd3dfd9f20a578e4209b988aa30a67b0a86 100644 (file)
@@ -12,16 +12,10 @@ PHP_ARG_WITH(pcre-regex,for PCRE support,
                           if not using bundled library.],yes)
 
 if test "$PHP_PCRE_REGEX" != "no"; then
-  PHP_EXTENSION(pcre, $ext_shared)
   if test "$PHP_PCRE_REGEX" = "yes"; then
-    PCRE_LIBADD=pcrelib/libpcre.la
-    PCRE_SHARED_LIBADD=pcrelib/libpcre.la
-    PCRE_SUBDIRS=pcrelib
-    PHP_SUBST(PCRE_LIBADD)
-    PHP_SUBST(PCRE_SUBDIRS)
+    PHP_NEW_EXTENSION(pcre, pcrelib/maketables.c pcrelib/get.c pcrelib/study.c pcrelib/pcre.c php_pcre.c, $ext_shared,,-DSUPPORT_UTF8 -I@ext_srcdir@/pcrelib)
+    PHP_ADD_BUILD_DIR($ext_builddir/pcrelib)
     AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ])
-    PHP_FAST_OUTPUT($ext_builddir/pcrelib/Makefile)
-    LIB_BUILD($ext_builddir/pcrelib,$ext_shared,yes)
   else
     test -f $PHP_PCRE_REGEX/pcre.h && PCRE_INCDIR=$PHP_PCRE_REGEX
     test -f $PHP_PCRE_REGEX/include/pcre.h && PCRE_INCDIR=$PHP_PCRE_REGEX/include
@@ -52,8 +46,8 @@ if test "$PHP_PCRE_REGEX" != "no"; then
 
     PHP_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR, PCRE_SHARED_LIBADD)
     
-    PHP_ADD_INCLUDE($PCRE_INCDIR)
     AC_DEFINE(HAVE_PCRE, 1, [ ])
+    PHP_NEW_EXTENSION(pcre, php_pcre.c, $ext_shared,,-DSUPPORT_UTF8 -I$PCRE_INCDIR)
   fi
 fi
 PHP_SUBST(PCRE_SHARED_LIBADD)
index b59cae49fa92ba605f84ecc6e9cfdbd7537ebc5f..1b13b868471b9af0987608cb9335217944a946fa 100644 (file)
@@ -17,7 +17,8 @@ if test "$PHP_PDFLIB" != "no"; then
   dnl # libjpeg
     
   PHP_ARG_WITH(jpeg-dir, for the location of libjpeg, 
-  [  --with-jpeg-dir[=DIR]     PDFLIB: define libjpeg install directory. (OPTIONAL for PDFlib v4)])
+  [  --with-jpeg-dir[=DIR]     PDFLIB: define libjpeg install directory.
+                                    (OPTIONAL for PDFlib v4)])
 
   if test "$PHP_JPEG_DIR" != "no"; then
     PHP_CHECK_LIBRARY(jpeg,jpeg_read_header, 
@@ -35,7 +36,8 @@ if test "$PHP_PDFLIB" != "no"; then
   dnl # libpng
 
   PHP_ARG_WITH(png-dir, for the location of libpng, 
-  [  --with-png-dir[=DIR]      PDFLIB: define libpng install directory.  (OPTIONAL for PDFlib v4)])
+  [  --with-png-dir[=DIR]      PDFLIB: define libpng install directory.
+                                    (OPTIONAL for PDFlib v4)])
  
   if test "$PHP_PNG_DIR" != "no"; then
     PHP_CHECK_LIBRARY(png,png_create_info_struct, 
@@ -53,7 +55,8 @@ if test "$PHP_PDFLIB" != "no"; then
   dnl # libtiff
 
   PHP_ARG_WITH(tiff-dir, for the location of libtiff,
-  [  --with-tiff-dir[=DIR]     PDFLIB: define libtiff install directory. (OPTIONAL for PDFlib v4)])
+  [  --with-tiff-dir[=DIR]     PDFLIB: define libtiff install directory.
+                                    (OPTIONAL for PDFlib v4)])
 
   if test "$PHP_TIFF_DIR" != "no"; then
     PHP_CHECK_LIBRARY(tiff,TIFFOpen, 
index 6462273cfe3a36b33419648320f0269e5f618a81..c8f036282c35d8c45da47851548202dd8e145d00 100644 (file)
@@ -15,7 +15,6 @@ PHP_ARG_WITH(expat-dir, libexpat dir for XMLRPC-EPI,
 
 if test "$PHP_XMLRPC" != "no"; then
 
-  PHP_EXTENSION(xmlrpc, $ext_shared)
   PHP_SUBST(XMLRPC_SHARED_LIBADD)
   AC_DEFINE(HAVE_XMLRPC,1,[ ])
 
@@ -54,13 +53,14 @@ fi
 
 if test "$PHP_XMLRPC" = "yes"; then
   XMLRPC_CHECKS
-  XMLRPC_LIBADD=libxmlrpc/libxmlrpc.la
-  XMLRPC_SHARED_LIBADD=libxmlrpc/libxmlrpc.la
-  XMLRPC_SUBDIRS=libxmlrpc
-  PHP_SUBST(XMLRPC_LIBADD)
-  PHP_SUBST(XMLRPC_SUBDIRS)
-  LIB_BUILD($ext_builddir/libxmlrpc,$ext_shared,yes)
-  PHP_ADD_INCLUDE($ext_srcdir/libxmlrpc)
+  PHP_NEW_EXTENSION(xmlrpc,xmlrpc-epi-php.c libxmlrpc/base64.c \
+          libxmlrpc/simplestring.c libxmlrpc/xml_to_dandarpc.c \
+          libxmlrpc/xmlrpc_introspection.c libxmlrpc/encodings.c \
+          libxmlrpc/system_methods.c libxmlrpc/xml_to_xmlrpc.c \
+          libxmlrpc/queue.c libxmlrpc/xml_element.c libxmlrpc/xmlrpc.c \
+          libxmlrpc/xml_to_soap.c,$ext_shared,,
+          -I@ext_srcdir@/libxmlrpc -DVERSION="0.50")
+  PHP_ADD_BUILD_DIR($ext_builddir/libxmlrpc)
   XMLRPC_MODULE_TYPE=builtin
 
 elif test "$PHP_XMLRPC" != "no"; then
index 7f797cb2a404fba0e10efc99158774d46448c435..e89c245f0253b7f15fb7da24ca6ed0c83d74e2f1 100644 (file)
@@ -9,6 +9,4 @@ AC_DEFINE(UNDEF_THREADS_HACK,,[ ])
 XMLRPC_HEADER_CHECKS
 XMLRPC_TYPE_CHECKS
 XMLRPC_FUNCTION_CHECKS
-
-PHP_FAST_OUTPUT($ext_builddir/libxmlrpc/Makefile)
 ])
diff --git a/ext/session/Makefile.in b/ext/session/Makefile.in
deleted file mode 100644 (file)
index 2e1d76e..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-LTLIBRARY_NAME    = libsession.la
-LTLIBRARY_SOURCES = session.c mod_files.c mod_mm.c mod_user.c
-LTLIBRARY_SHARED_NAME = session.la
-LTLIBRARY_SHARED_LIBADD = $(SESSION_SHARED_LIBADD)
-
-include $(top_srcdir)/build/dynlib.mk
index bf3f3b810502d2de69a307fa58d8f05028a8ab50..098e2719567086341369f1823a0d050d90fc6cc4 100644 (file)
@@ -29,7 +29,7 @@ if test "$PHP_SESSION" != "no"; then
   AC_CHECK_FUNCS(pread pwrite)
   PHP_MISSING_PWRITE_DECL
   PHP_MISSING_PREAD_DECL
-  PHP_EXTENSION(session,$ext_shared)
+  PHP_NEW_EXTENSION(session, session.c mod_files.c mod_mm.c mod_user.c, $ext_shared)
   PHP_SUBST(SESSION_SHARED_LIBADD)
   AC_DEFINE(HAVE_PHP_SESSION,1,[ ])
 fi
diff --git a/ext/standard/Makefile.frag b/ext/standard/Makefile.frag
new file mode 100644 (file)
index 0000000..934f501
--- /dev/null
@@ -0,0 +1,8 @@
+
+$(srcdir)/parsedate.c: $(srcdir)/parsedate.y
+
+$(srcdir)/var_unserializer.c: $(srcdir)/var_unserializer.re
+       re2c -b $(srcdir)/var_unserializer.re > $@
+
+$(srcdir)/url_scanner_ex.c: $(srcdir)/url_scanner_ex.re
+       re2c -b $(srcdir)/url_scanner_ex.re > $@
diff --git a/ext/standard/Makefile.in b/ext/standard/Makefile.in
deleted file mode 100644 (file)
index 6f7e06d..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-
-LTLIBRARY_NAME = libstandard.la
-LTLIBRARY_SOURCES=\
-       array.c base64.c basic_functions.c browscap.c crc32.c crypt.c cyr_convert.c datetime.c \
-       dir.c dl.c dns.c exec.c file.c filestat.c flock_compat.c \
-       formatted_print.c fsock.c head.c html.c image.c info.c iptc.c lcg.c \
-       link.c mail.c math.c md5.c metaphone.c microtime.c pack.c pageinfo.c \
-        parsedate.c quot_print.c rand.c reg.c soundex.c string.c scanf.c \
-       syslog.c type.c uniqid.c url.c url_scanner.c var.c versioning.c assert.c \
-       strnatcmp.c levenshtein.c incomplete_class.c url_scanner_ex.c \
-       ftp_fopen_wrapper.c http_fopen_wrapper.c php_fopen_wrapper.c credits.c \
-       var_unserializer.c ftok.c aggregation.c
-
-include $(top_srcdir)/build/dynlib.mk
-
-parsedate.c: $(srcdir)/parsedate.y
-
-$(srcdir)/var_unserializer.c: $(srcdir)/var_unserializer.re
-       re2c -b $(srcdir)/var_unserializer.re > $@
-
-$(srcdir)/url_scanner_ex.c: $(srcdir)/url_scanner_ex.re
-       re2c -b $(srcdir)/url_scanner_ex.re > $@
index e0043d23a78d41f1f2c48bff5980918c488d7abd..130664c3618df59cb7d5f57b0fb90c5c0b61e9df 100644 (file)
@@ -233,4 +233,14 @@ if test "$PHP_SAPI" = "cgi"; then
   AC_DEFINE(ENABLE_CHROOT_FUNC, 1, [Whether to enable chroot() function])
 fi
 
-PHP_EXTENSION(standard)
+PHP_NEW_EXTENSION(standard,    array.c base64.c basic_functions.c browscap.c crc32.c crypt.c cyr_convert.c datetime.c \
+       dir.c dl.c dns.c exec.c file.c filestat.c flock_compat.c \
+       formatted_print.c fsock.c head.c html.c image.c info.c iptc.c lcg.c \
+       link.c mail.c math.c md5.c metaphone.c microtime.c pack.c pageinfo.c \
+        parsedate.c quot_print.c rand.c reg.c soundex.c string.c scanf.c \
+       syslog.c type.c uniqid.c url.c url_scanner.c var.c versioning.c assert.c \
+       strnatcmp.c levenshtein.c incomplete_class.c url_scanner_ex.c \
+       ftp_fopen_wrapper.c http_fopen_wrapper.c php_fopen_wrapper.c credits.c \
+       var_unserializer.c ftok.c aggregation.c)
+
+PHP_ADD_MAKEFILE_FRAGMENT
index 56445663f9243eebdb700490277e33b8c05eddac..42dd8182e2a9b850eed662898a24ba88a74bdd58 100644 (file)
@@ -3,7 +3,7 @@ dnl $Id$
 dnl
 
 dnl Fallback for --with-xml[=DIR]
-AC_ARG_WITH(xml,[],enable_xml=$withval)
+dnl PHP_ARG_WITH(xml,[],enable_xml=$withval)
 
 AC_C_BIGENDIAN
 
@@ -20,27 +20,15 @@ PHP_ARG_WITH(expat-dir, external libexpat install dir,
 [  --with-expat-dir=DIR    XML: external libexpat install dir])
 
 if test "$PHP_XML" = "yes"; then
+  AC_DEFINE(HAVE_LIBEXPAT,  1, [ ])
 if test "$PHP_EXPAT_DIR" = "no"; then
 
-    AC_DEFINE(HAVE_LIBEXPAT, 1, [ ])
     AC_DEFINE(HAVE_LIBEXPAT_BUNDLED, 1, [ ])
-    XML_CPPFLAGS=-DXML_BYTE_ORDER=$order
-    EXPAT_INTERNAL_LIBADD=expat/libexpat.la
-    PHP_SUBST(EXPAT_INTERNAL_LIBADD)
-    PHP_SUBST(XML_CPPFLAGS)
-    EXPAT_SUBDIRS=expat
-    PHP_SUBST(EXPAT_SUBDIRS)
-    PHP_SUBST(EXPAT_SHARED_LIBADD)
-    PHP_EXTENSION(xml, $ext_shared)
-    LIB_BUILD($ext_builddir/expat,$ext_shared,yes)
-    PHP_ADD_INCLUDE($ext_srcdir/expat)
-    PHP_FAST_OUTPUT($ext_builddir/expat/Makefile)
-
+    PHP_NEW_EXTENSION(xml, xml.c expat/xmlparse.c expat/xmlrole.c expat/xmltok.c, $ext_shared,, -I@ext_srcdir@/expat -DXML_BYTE_ORDER=$order)
+    PHP_ADD_BUILD_DIR($ext_builddir/expat)
 else
   
-  PHP_EXTENSION(xml, $ext_shared)
-  PHP_SUBST(EXPAT_SHARED_LIBADD)
-  AC_DEFINE(HAVE_LIBEXPAT,  1, [ ])
+  PHP_NEW_EXTENSION(xml, xml.c, $ext_shared)
 
   for i in $PHP_XML $PHP_EXPAT_DIR; do
     if test -f $i/lib/libexpat.a -o -f $i/lib/libexpat.$SHLIB_SUFFIX_NAME ; then
@@ -54,5 +42,6 @@ else
 
   PHP_ADD_INCLUDE($EXPAT_DIR/include)
   PHP_ADD_LIBRARY_WITH_PATH(expat, $EXPAT_DIR/lib, EXPAT_SHARED_LIBADD)
+  PHP_SUBST(EXPAT_SHARED_LIBADD)
 fi
 fi
index 6462273cfe3a36b33419648320f0269e5f618a81..c8f036282c35d8c45da47851548202dd8e145d00 100644 (file)
@@ -15,7 +15,6 @@ PHP_ARG_WITH(expat-dir, libexpat dir for XMLRPC-EPI,
 
 if test "$PHP_XMLRPC" != "no"; then
 
-  PHP_EXTENSION(xmlrpc, $ext_shared)
   PHP_SUBST(XMLRPC_SHARED_LIBADD)
   AC_DEFINE(HAVE_XMLRPC,1,[ ])
 
@@ -54,13 +53,14 @@ fi
 
 if test "$PHP_XMLRPC" = "yes"; then
   XMLRPC_CHECKS
-  XMLRPC_LIBADD=libxmlrpc/libxmlrpc.la
-  XMLRPC_SHARED_LIBADD=libxmlrpc/libxmlrpc.la
-  XMLRPC_SUBDIRS=libxmlrpc
-  PHP_SUBST(XMLRPC_LIBADD)
-  PHP_SUBST(XMLRPC_SUBDIRS)
-  LIB_BUILD($ext_builddir/libxmlrpc,$ext_shared,yes)
-  PHP_ADD_INCLUDE($ext_srcdir/libxmlrpc)
+  PHP_NEW_EXTENSION(xmlrpc,xmlrpc-epi-php.c libxmlrpc/base64.c \
+          libxmlrpc/simplestring.c libxmlrpc/xml_to_dandarpc.c \
+          libxmlrpc/xmlrpc_introspection.c libxmlrpc/encodings.c \
+          libxmlrpc/system_methods.c libxmlrpc/xml_to_xmlrpc.c \
+          libxmlrpc/queue.c libxmlrpc/xml_element.c libxmlrpc/xmlrpc.c \
+          libxmlrpc/xml_to_soap.c,$ext_shared,,
+          -I@ext_srcdir@/libxmlrpc -DVERSION="0.50")
+  PHP_ADD_BUILD_DIR($ext_builddir/libxmlrpc)
   XMLRPC_MODULE_TYPE=builtin
 
 elif test "$PHP_XMLRPC" != "no"; then
index 7f797cb2a404fba0e10efc99158774d46448c435..e89c245f0253b7f15fb7da24ca6ed0c83d74e2f1 100644 (file)
@@ -9,6 +9,4 @@ AC_DEFINE(UNDEF_THREADS_HACK,,[ ])
 XMLRPC_HEADER_CHECKS
 XMLRPC_TYPE_CHECKS
 XMLRPC_FUNCTION_CHECKS
-
-PHP_FAST_OUTPUT($ext_builddir/libxmlrpc/Makefile)
 ])
similarity index 72%
rename from pear/Makefile.in
rename to pear/Makefile.frag
index 7e7d831f2be61d951c03cf6197bcdaf119b97ea2..bb35f75e7e244bfdd43900973219662e121c02a5 100644 (file)
@@ -1,12 +1,10 @@
 
-install_targets = \
+pear_install_targets = \
        install-data-local \
        install-headers \
        install-build \
        install-programs
 
-include $(top_srcdir)/build/rules.mk
-
 peardir=$(PEAR_INSTALLDIR)
 
 PEAR_SUBDIRS = \
@@ -112,17 +110,10 @@ phpbuilddir = $(prefix)/lib/php/build
 
 BUILD_FILES = \
        pear/pear.m4 \
-       build/fastgen.sh \
-       build/library.mk \
-       build/ltlib.mk \
        build/mkdep.awk \
-       build/program.mk \
-       build/rules.mk \
-       build/rules_common.mk \
-       build/rules_pear.mk \
-       build/dynlib.mk \
        build/shtool \
-       dynlib.m4 \
+       Makefile.global \
+       scan_makefile_in.awk \
        acinclude.m4
 
 bin_SCRIPTS = phpize php-config pear pear-get pearize phptar
@@ -135,7 +126,7 @@ install-build:
 install-programs:
        @for prog in $(bin_SCRIPTS); do \
                echo "Installing program: $$prog"; \
-               $(INSTALL) -m 755 scripts/$$prog $(INSTALL_ROOT)$(bindir)/$$prog; \
+               $(INSTALL) -m 755 $(builddir)/scripts/$$prog $(INSTALL_ROOT)$(bindir)/$$prog; \
        done; \
        for prog in phpextdist; do \
                echo "Installing program: $$prog"; \
@@ -169,20 +160,20 @@ install-headers:
                cd $(top_builddir)/$$i && cp -p *.h $(INSTALL_ROOT)$(phpincludedir)/$$i) 2>/dev/null || true; \
        done
 
-scripts/pear: scripts/pear.in $(top_builddir)/config.status
-       (cd ..;CONFIG_FILES=pear/scripts/pear CONFIG_HEADERS= $(top_builddir)/config.status)
+$(builddir)/scripts/pear: $(srcdir)/scripts/pear.in $(top_builddir)/config.status
+       (CONFIG_FILES=$@ CONFIG_HEADERS= $(top_builddir)/config.status)
 
-scripts/pear-get: scripts/pear-get.in $(top_builddir)/config.status
-       (cd ..;CONFIG_FILES=pear/scripts/pear-get CONFIG_HEADERS= $(top_builddir)/config.status)
+$(builddir)/scripts/pear-get: $(srcdir)/scripts/pear-get.in $(top_builddir)/config.status
+       (CONFIG_FILES=$@ CONFIG_HEADERS= $(top_builddir)/config.status)
 
-scripts/phpize: scripts/phpize.in $(top_builddir)/config.status
-       (cd ..;CONFIG_FILES=pear/scripts/phpize CONFIG_HEADERS= $(top_builddir)/config.status)
+$(builddir)/scripts/phpize: $(srcdir)/scripts/phpize.in $(top_builddir)/config.status
+       (CONFIG_FILES=$@ CONFIG_HEADERS= $(top_builddir)/config.status)
 
-scripts/phptar: scripts/phptar.in $(top_builddir)/config.status
-       (cd ..;CONFIG_FILES=pear/scripts/phptar CONFIG_HEADERS= $(top_builddir)/config.status)
+$(builddir)/scripts/phptar: $(srcdir)/scripts/phptar.in $(top_builddir)/config.status
+       (CONFIG_FILES=$@ CONFIG_HEADERS= $(top_builddir)/config.status)
 
-scripts/pearize: scripts/pearize.in $(top_builddir)/config.status
-       (cd ..;CONFIG_FILES=pear/scripts/pearize CONFIG_HEADERS= $(top_builddir)/config.status)
+$(builddir)/scripts/pearize: $(srcdir)/scripts/pearize.in $(top_builddir)/config.status
+       (CONFIG_FILES=$@ CONFIG_HEADERS= $(top_builddir)/config.status)
 
-scripts/php-config: scripts/php-config.in $(top_builddir)/config.status
-       (cd ..;CONFIG_FILES=pear/scripts/php-config CONFIG_HEADERS= $(top_builddir)/config.status)
+$(builddir)/scripts/php-config: $(srcdir)/scripts/php-config.in $(top_builddir)/config.status
+       (CONFIG_FILES=$@ CONFIG_HEADERS= $(top_builddir)/config.status)
index 9f128016117028c18eea62bdd8e3b56a0b68b97a..879e34ee113c07822f78c0964dd3b84d996a6c0a 100644 (file)
@@ -1,5 +1,8 @@
+dnl This file becomes configure.in for self-contained extensions.
 
-AC_INIT(Makefile.in)
+AC_INIT(config.m4)
+
+PHP_INIT_BUILD_SYSTEM
 
 AC_DEFUN(PHP_WITH_PHP_CONFIG,[
   AC_ARG_WITH(php-config,
@@ -25,6 +28,7 @@ AC_DEFUN(PHP_WITH_PHP_CONFIG,[
 ])
 
 abs_srcdir=`(cd $srcdir && pwd)`
+abs_builddir=`pwd`
 
 php_always_shared=yes
 
@@ -35,6 +39,8 @@ AC_PROG_CC_C_O
 
 PHP_WITH_PHP_CONFIG
 
+PHP_BUILD_SHARED
+
 AC_PREFIX_DEFAULT()
 
 sinclude(config.m4)
@@ -44,14 +50,18 @@ enable_shared=yes
 
 AC_PROG_LIBTOOL
 
-SHARED_LIBTOOL='$(LIBTOOL)'
-PHP_COMPILE='$(LIBTOOL) --mode=compile $(COMPILE) -c $<'
+all_targets='$(PHP_MODULES)'
+install_targets=install-modules
 phplibdir="`pwd`/modules"
 CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H"
 
 test "$prefix" = "NONE" && prefix="/usr/local"
 test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
 
+PHP_SUBST(PHP_MODULES)
+PHP_SUBST(all_targets)
+PHP_SUBST(install_targets)
+
 PHP_SUBST(prefix)
 PHP_SUBST(exec_prefix)
 PHP_SUBST(libdir)
@@ -76,10 +86,8 @@ PHP_SUBST(SHARED_LIBTOOL)
 PHP_SUBST(LIBTOOL)
 PHP_SUBST(SHELL)
 
-PHP_FAST_OUTPUT(Makefile)
-
-PHP_GEN_CONFIG_VARS
-PHP_GEN_MAKEFILES($PHP_FAST_OUTPUT_FILES)
+PHP_GEN_BUILD_DIRS
+PHP_GEN_GLOBAL_MAKEFILE
 
 test -d modules || mkdir modules
 touch .deps
index 33b5ad2cfb2f4904752cb43efb7f78cdaf7ecbe2..537431ffad1ee0e34528920bee4bede35523ba9a 100644 (file)
@@ -3,8 +3,8 @@
 prefix='@prefix@'
 phpdir="$prefix/lib/php/build"
 builddir="`pwd`"
-FILES_BUILD="dynlib.mk fastgen.sh library.mk ltlib.mk mkdep.awk program.mk rules.mk rules_common.mk rules_pear.mk shtool"
-FILES="acinclude.m4 dynlib.m4"
+FILES_BUILD="mkdep.awk shtool"
+FILES="acinclude.m4 Makefile.global scan_makefile_in.awk"
 
 if test ! -r config.m4; then
   echo "Cannot find config.m4. "
@@ -17,8 +17,6 @@ test -d build || mkdir build
 (cd $phpdir && cp $FILES_BUILD $builddir/build)
 (cd $phpdir && cp $FILES $builddir)
 
-mv build/rules_pear.mk build/rules.mk
-
 sed \
 -e "s#@prefix@#$prefix#" \
 < $phpdir/pear.m4 > configure.in
diff --git a/sapi/Makefile.in b/sapi/Makefile.in
deleted file mode 100644 (file)
index 089a1e4..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-
-SUBDIRS = $(PHP_SAPI)
-
-include $(top_srcdir)/build/rules.mk
diff --git a/sapi/README b/sapi/README
deleted file mode 100644 (file)
index d9a759d..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-Each SAPI backend has to contain:
-
-config.m4: just like for extensions, this file contains
-autoconf directives that end up in the configure script.  The
-only difference is that the sapi config.m4 files are read in diversion
-(output block) 2 instead of 3.  The sapi config.m4 files should set
-two variables: PHP_SAPI (which sapi backend to choose) and INSTALL_IT
-(the actions performed when "make install" is executed).  If they are
-not specified, they will default to "cgi" and "do nothing,"
-respectively.  Additionally, the following m4 macros can be used to
-influence what is created during "make":
-
-PHP_BUILD_SHARED    -- build shared target      $SAPI_SHARED
-PHP_BUILD_STATIC    -- build static target      $SAPI_STATIC
-PHP_BUILD_PROGRAM   -- build executable         $SAPI_PROGRAM
-
-(paths relative to top build dir)
diff --git a/sapi/aolserver/Makefile.in b/sapi/aolserver/Makefile.in
deleted file mode 100644 (file)
index 96a33af..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-LTLIBRARY_NAME    = libsapi.la
-LTLIBRARY_SOURCES = aolserver.c
-
-include $(top_srcdir)/build/ltlib.mk
index 5e2ee7ed295d84dbc8319af1a2242fc046de9c48..2c905af2cc2fdbc7d382c47043ee6f843ef085c3 100644 (file)
@@ -24,8 +24,7 @@ if test "$PHP_AOLSERVER" != "no"; then
   PHP_BUILD_THREAD_SAFE
   PHP_ADD_INCLUDE($PHP_AOLSERVER_SRC/include)
   AC_DEFINE(HAVE_AOLSERVER,1,[Whether you have AOLserver])
-  PHP_SAPI=aolserver
-  PHP_BUILD_SHARED
+  PHP_SELECT_SAPI(aolserver, shared, aolserver.c)
   INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$PHP_AOLSERVER/bin/"
 fi
 
diff --git a/sapi/apache/Makefile.in b/sapi/apache/Makefile.in
deleted file mode 100644 (file)
index 477b3a4..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-LTLIBRARY_NAME    = libsapi.la
-LTLIBRARY_SOURCES = sapi_apache.c mod_php4.c php_apache.c
-
-EXTRA_INCLUDES = $(APACHE_INCLUDE)
-
-include $(top_srcdir)/build/ltlib.mk
index c098062e72351f3fdd9cd27a53f9e32ab86e1d0a..4a1f1ad2167d61a8882d31c7a78ba73b5266bec4 100644 (file)
@@ -39,7 +39,7 @@ AC_ARG_WITH(apxs,
     esac
   done
   PHP_ADD_INCLUDE($APXS_INCLUDEDIR)
-  PHP_SAPI=apache
+  PHP_SELECT_SAPI(apache, shared, sapi_apache.c mod_php4.c php_apache.c)
 
   # Test whether apxs support -S option
   $APXS -q -S CFLAGS="$APXS_CFLAGS" CFLAGS >/dev/null 2>&1
@@ -50,7 +50,6 @@ AC_ARG_WITH(apxs,
     APACHE_INSTALL="\$(mkinstalldirs) \"\$(INSTALL_ROOT)`$APXS -q LIBEXECDIR`\" && $APXS -S LIBEXECDIR=\"\$(INSTALL_ROOT)`$APXS -q LIBEXECDIR`\" -i -a -n php4 $SAPI_SHARED"
   fi
 
-  PHP_BUILD_SHARED
   if test -z "`$APXS -q LD_SHLIB`" || test "`$APXS -q LIBEXECDIR`" = "modules"; then
     PHP_APXS_BROKEN=yes
   fi
@@ -86,7 +85,7 @@ AC_ARG_WITH(apache,
     if test -f $withval/src/httpd.h; then 
       APACHE_INCLUDE=-I$withval/src
       APACHE_TARGET=$withval/src
-      PHP_SAPI=apache
+      PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php4.c php_apache.c)
       APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_INSTALL_FILES $APACHE_TARGET"
       PHP_LIBS="-L. -lphp3"
       AC_MSG_RESULT(yes - Apache 1.2.x)
@@ -103,7 +102,7 @@ AC_ARG_WITH(apache,
       if test ! -d $APACHE_TARGET; then
         mkdir $APACHE_TARGET
       fi
-      PHP_SAPI=apache
+      PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php4.c php_apache.c)
       APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp4.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache/apMakefile.libdir $APACHE_TARGET/Makefile.libdir"
       PHP_LIBS="-Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4"
       AC_MSG_RESULT(yes - Apache 2.0.X)
@@ -129,7 +128,7 @@ AC_ARG_WITH(apache,
       if test ! -d $APACHE_TARGET; then
         mkdir $APACHE_TARGET
       fi
-      PHP_SAPI=apache
+      PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php4.c php_apache.c)
       APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp4.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache/apMakefile.libdir $APACHE_TARGET/Makefile.libdir"
       PHP_LIBS="-Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4"
       AC_MSG_RESULT(yes - Apache 1.3.x)
@@ -155,7 +154,7 @@ AC_ARG_WITH(apache,
       if test ! -d $APACHE_TARGET; then
         mkdir $APACHE_TARGET
       fi
-      PHP_SAPI=apache
+      PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php4.c php_apache.c)
       PHP_LIBS="-Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4"
       APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp4.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache/apMakefile.libdir $APACHE_TARGET/Makefile.libdir"
       AC_MSG_RESULT(yes - Apache 1.3.x)
@@ -177,7 +176,7 @@ AC_ARG_WITH(apache,
     elif test -f $withval/apache/httpd.h; then
       APACHE_INCLUDE=-"I$withval/apache -I$withval/ssl/include"
       APACHE_TARGET=$withval/apache
-      PHP_SAPI=apache
+      PHP_SELECT_SAPI(apache, static, sapi_apache.c mod_php4.c php_apache.c)
       PHP_LIBS="-Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4"
       APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp4.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET"
       STRONGHOLD=-DSTRONGHOLD=1
@@ -235,7 +234,6 @@ if test -n "$APACHE_MODULE"; then
   PHP_TARGET_RDYNAMIC
   $php_shtool mkdir -p sapi/apache
   PHP_OUTPUT(sapi/apache/libphp4.module)
-  PHP_BUILD_STATIC
 fi
 
 if test -n "$APACHE_INSTALL"; then
diff --git a/sapi/apache2filter/Makefile.in b/sapi/apache2filter/Makefile.in
deleted file mode 100644 (file)
index e4e876c..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-LTLIBRARY_NAME    = libsapi.la
-LTLIBRARY_SOURCES = sapi_apache2.c apache_config.c php_functions.c
-
-EXTRA_INCLUDES = $(APACHE_INCLUDE)
-
-include $(top_srcdir)/build/ltlib.mk
index ec0e36b0ce08c2a98aeb6c2ee7aa5f69554b4d54..07be909119b97628d6f096c8227d30cd88d38f81 100644 (file)
@@ -39,10 +39,9 @@ AC_ARG_WITH(apxs2,
     esac
   done
   PHP_ADD_INCLUDE($APXS_INCLUDEDIR)
-  PHP_SAPI=apache2filter
   INSTALL_IT="$APXS -i -a -n php4 $SAPI_LIBTOOL"
-  PHP_BUILD_SHARED
   PHP_BUILD_THREAD_SAFE
+  PHP_SELECT_SAPI(apache2filter, shared, sapi_apache2.c apache_config.c php_functions.c) 
   AC_MSG_RESULT(yes)
   case $host_alias in
   *aix*)
diff --git a/sapi/caudium/Makefile.in b/sapi/caudium/Makefile.in
deleted file mode 100644 (file)
index 6063dd2..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-LTLIBRARY_NAME    = libsapi.la
-LTLIBRARY_SOURCES = caudium.c
-
-include $(top_srcdir)/build/ltlib.mk
index 26f24202ba5a8675154bdfff591d3866acd95a0c..a4f76db1b6441e9f1095e8fdeeb2351e6a8b0a85 100644 (file)
@@ -82,8 +82,7 @@ AC_ARG_WITH(caudium,
        fi
     PIKE_VERSION=`$PIKE -e 'string v; int rel;sscanf(version(), "Pike v%s release %d", v, rel); write(v+"."+rel);'`   
        AC_DEFINE(HAVE_CAUDIUM,1,[Whether to compile with Caudium support])
-       PHP_SAPI=caudium
-       PHP_BUILD_SHARED
+    PHP_SELECT_SAPI(caudium, shared, caudium.c)
        INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $withval/lib/$PIKE_VERSION/PHP4.so"
        RESULT="        *** Pike binary used:         $PIKE
        *** Pike include dir(s) used: $PIKE_INCLUDE_DIR
diff --git a/sapi/cgi/Makefile.in b/sapi/cgi/Makefile.in
deleted file mode 100644 (file)
index 3b66c7d..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-LTLIBRARY_NAME    = libsapi.la
-LTLIBRARY_SOURCES = cgi_main.c getopt.c
-
-include $(top_srcdir)/build/ltlib.mk
index 04519d404e02db3797edf1d4e4d3da49beacc35d..d3aa978264879a584d2a3159cfdc68ba96f1b863 100644 (file)
@@ -31,7 +31,7 @@ main()
   fi
 ])
 
-if test "$PHP_SAPI" = "cgi"; then
+if test "$PHP_SAPI" = "default"; then
 
   PHP_TEST_WRITE_STDOUT
 
@@ -61,9 +61,6 @@ if test "$PHP_SAPI" = "cgi"; then
   fi
   AC_DEFINE_UNQUOTED(DISCARD_PATH, $DISCARD_PATH, [ ])
 
-fi
-
-if test "$PHP_SAPI" = "cgi" ; then
   INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_PROGRAM \$(INSTALL_ROOT)\$(bindir)/php-cgi"
 fi
 
diff --git a/sapi/cli/Makefile.in b/sapi/cli/Makefile.in
deleted file mode 100644 (file)
index 515c57f..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-LTLIBRARY_NAME = libphp4cli.la
-LTLIBRARY_SOURCES = php_cli.c getopt.c
-
-LTLIBRARY_DEPENDENCIES = \
-               $(top_builddir)/Zend/libZend.la \
-               $(top_builddir)/main/libmain_cli.la \
-               $(top_builddir)/$(REGEX_LIB) \
-               $(EXT_CLI_LTLIBS) \
-               $(top_builddir)/$(TSRM_LIB)
-
-LTLIBRARY_LDFLAGS = -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS)
-LTLIBRARY_LIBADD = $(LTLIBRARY_DEPENDENCIES) $(EXTRA_LIBS)
-
-
-PROGRAM_NAME         = php
-PROGRAM_SOURCES      = 
-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
-CFLAGS          = $(CFLAGS_CLEAN) -prefer-non-pic -static
-PHP_COMPILE     = $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) -c $< && touch $@
-CXX_PHP_COMPILE = $(CXX) $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)  -c $< && touch $@
-include $(top_srcdir)/build/library.mk
-include $(top_srcdir)/build/program.mk
index 83aef7b2bbe35aa8a886c8ff9f11e431ecda853f..724c759de72640cf8ef311fd058b375e84c83b04 100644 (file)
@@ -17,7 +17,8 @@ AC_ARG_ENABLE(cli,
 )
 
 if test "$PHP_SAPI_CLI" != "no"; then
-  INSTALL_IT="$INSTALL_IT; \$(INSTALL) -m 0755 sapi/cli/php \$(INSTALL_ROOT)\$(bindir)/php"
+  INSTALL_CLI="\$(INSTALL) -m 0755 sapi/cli/php \$(INSTALL_ROOT)\$(bindir)/php"
+  PHP_SUBST(INSTALL_CLI)
 else
   PHP_DISABLE_CLI
 fi
diff --git a/sapi/fastcgi/Makefile.in b/sapi/fastcgi/Makefile.in
deleted file mode 100644 (file)
index 0bea9c3..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-LTLIBRARY_NAME    = libsapi.la
-LTLIBRARY_SOURCES = fastcgi.c
-
-include $(top_srcdir)/build/ltlib.mk
index b01070587af71215745cc0bb7b21f00237b2bf5c..444d6d8af50ab74b32c6574cd86edf05565cd2b0 100644 (file)
@@ -12,7 +12,7 @@ AC_ARG_WITH(fastcgi,
   fi
   test -f "$FASTCGIPATH/lib/libfcgi.a" || AC_MSG_ERROR(Unable to find libfcgi.a in $FASTCGIPATH/lib)
   test -f "$FASTCGIPATH/include/fastcgi.h" || AC_MSG_ERROR(Unable to find fastcgi.h in $FASTCGIPATH/include)
-  PHP_SAPI=fastcgi
+  PHP_SELECT_SAPI(fastcgi, programm, fastcgi.c) 
   PHP_LIBS=$FASTCGIPATH/lib/libfcgi.a
   PHP_ADD_INCLUDE($FASTCGIPATH/include)
   EXT_PROGRAM_LDADD="$EXT_PROGRAM_LDADD $FASTCGIPATH/lib/libfcgi.a"
diff --git a/sapi/isapi/Makefile.in b/sapi/isapi/Makefile.in
deleted file mode 100644 (file)
index 34d4bdc..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-LTLIBRARY_NAME    = libsapi.la
-LTLIBRARY_SOURCES = php4isapi.c
-
-include $(top_srcdir)/build/ltlib.mk
index 6bc7a4cc4ad7bf64132c50f6daefb71391d253a4..ece730cef9f4f7982d6888a3b12c96862ad3119c 100644 (file)
@@ -16,8 +16,7 @@ AC_ARG_WITH(isapi,
        PHP_BUILD_THREAD_SAFE
        AC_DEFINE(WITH_ZEUS,1,[ ])
        PHP_ADD_INCLUDE($ZEUSPATH/web/include)
-       PHP_SAPI=isapi
-       PHP_BUILD_SHARED
+    PHP_SELECT_SAPI(isapi, shared, php4isapi.c)
        INSTALL_IT="\$(SHELL) \$(srcdir)/install-sh -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$ZEUSPATH/web/bin/"
        RESULT=yes
 ])
diff --git a/sapi/nsapi/Makefile.in b/sapi/nsapi/Makefile.in
deleted file mode 100644 (file)
index 8299911..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-LTLIBRARY_NAME    = libsapi.la
-LTLIBRARY_SOURCES = nsapi.c
-
-include $(top_srcdir)/build/ltlib.mk
index 1f4664d5b442f5f5fec67f8f3c96d0b57261839b..b7af1be4dac6e38151ad9a336ae2c54bb0381a0f 100644 (file)
@@ -28,8 +28,7 @@ if test "$PHP_NSAPI" != "no"; then
   PHP_ADD_INCLUDE($NSAPI_INCLUDE)
   PHP_BUILD_THREAD_SAFE
   AC_DEFINE(HAVE_NSAPI,1,[Whether you have a Netscape Server])
-  PHP_SAPI=nsapi
-  PHP_BUILD_SHARED
+  PHP_SELECT_SAPI(nsapi, shared, nsapi.c)
   INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$PHP_NSAPI/bin/"
 fi
 
diff --git a/sapi/phttpd/Makefile.in b/sapi/phttpd/Makefile.in
deleted file mode 100644 (file)
index 3fa6279..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-LTLIBRARY_NAME    = libsapi.la
-LTLIBRARY_SOURCES = phttpd.c
-
-include $(top_srcdir)/build/ltlib.mk
index d3d3c6d6655c34378ccb715c2684d3da6d5a19da..75c6d66891471d39e73ee83ef74f5d0e0e676f68 100644 (file)
@@ -14,8 +14,7 @@ AC_ARG_WITH(phttpd,
        PHTTPD_DIR=$withval
        PHP_ADD_INCLUDE($PHTTPD_DIR/include)
        AC_DEFINE(HAVE_PHTTPD,1,[Whether you have phttpd])
-       PHP_SAPI=phttpd
-       PHP_BUILD_SHARED
+       PHP_SELECT_SAPI(phttpd, shared, phttpd.c)
        INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$PHTTPD_DIR/modules/"
        RESULT=yes
 ])
diff --git a/sapi/pi3web/Makefile.in b/sapi/pi3web/Makefile.in
deleted file mode 100644 (file)
index 0195beb..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-LTLIBRARY_NAME    = libsapi.la
-LTLIBRARY_SOURCES = pi3web_sapi.c
-
-include $(top_srcdir)/build/ltlib.mk
index f4e54594ecde218671efcab61f730013eb1122cd..3541a9cf19a3a2797108370e982af7b676fa290a 100644 (file)
@@ -18,8 +18,7 @@ if test "$PHP_PI3WEB" != "no"; then
        PHP_ADD_INCLUDE($PI3PATH/Pi2API)
        PHP_ADD_INCLUDE($PI3PATH/Pi3API)
        PHP_ADD_INCLUDE($PI3PATH/PHP4)
-       PHP_SAPI=pi3web
-       PHP_BUILD_SHARED
+       PHP_SELECT_SAPI(pi3web, shared, pi3web_sapi.c)
        INSTALL_IT="\$(SHELL) \$(srcdir)/install-sh -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$PI3PATH/bin/"
 fi
 
diff --git a/sapi/roxen/Makefile.in b/sapi/roxen/Makefile.in
deleted file mode 100644 (file)
index c49bf97..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-LTLIBRARY_NAME    = libsapi.la
-LTLIBRARY_SOURCES = roxen.c
-
-include $(top_srcdir)/build/ltlib.mk
index 67eac5c5a15f256bb3bec044070f47fe2d7eb46d..cf2726b51beb8e55384d81554a23e52d2ddb734e 100644 (file)
@@ -30,8 +30,7 @@ AC_ARG_WITH(roxen,
    
        PHP_ADD_INCLUDE($PIKE_INCLUDE_DIR)
        AC_DEFINE(HAVE_ROXEN,1,[Whether you use Roxen])
-       PHP_SAPI=roxen
-       PHP_BUILD_SHARED
+       PHP_SELECT_SAPI(roxen, shared, roxen.c)
        INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $PIKE_MODULE_DIR/PHP4.so"
        RESULT="yes
        Pike binary used:      $PIKE
diff --git a/sapi/servlet/Makefile.frag b/sapi/servlet/Makefile.frag
new file mode 100644 (file)
index 0000000..6570d92
--- /dev/null
@@ -0,0 +1,19 @@
+
+$(builddir)/java.c : $(srcdir)/../../ext/java/java.c
+       @cp $(srcdir)/../../ext/java/java.c $(builddir)
+
+$(builddir)/phpsrvlt.jar : $(srcdir)/servlet.java $(srcdir)/../../ext/java/reflect.java
+       $(mkinstalldirs) $(builddir)/net/php
+       @echo library=php4 > $(builddir)/net/php/reflect.properties
+       @echo library=php4 > $(builddir)/net/php/servlet.properties
+       @cp $(builddir)/formatter.java $(builddir)/net/php
+       @cp $(builddir)/servlet.java $(builddir)/net/php
+       @cp $(srcdir)/../../ext/java/reflect.java $(builddir)/net/php
+       cd $(builddir) && javac net/php/reflect.java
+       @test ! -f $(builddir)/reflect.class || mv $(builddir)/reflect.class $(builddir)/net/php # bug in KJC javac
+       javac -classpath .:$(SERVLET_CLASSPATH):$(CLASSPATH) $(builddir)/net/php/servlet.java
+       @test ! -f $(builddir)/servlet.class || mv $(builddir)/servlet.class $(builddir)/net/php # bug in KJC javac
+       javac -classpath .:$(SERVLET_CLASSPATH):$(CLASSPATH) $(builddir)/net/php/formatter.java
+       @test ! -f $(builddir)/formatter.class || mv $(builddir)/formatter.class $(builddir)/net/php # bug in KJC javac
+       cd $(builddir)/ && $(JAVA_JAR) phpsrvlt.jar net/php/*.class net/php/*.properties
+       @rm -rf $(builddir)/net
diff --git a/sapi/servlet/Makefile.in b/sapi/servlet/Makefile.in
deleted file mode 100644 (file)
index 940866b..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-
-LTLIBRARY_NAME = libsapi.la
-LTLIBRARY_SOURCES = servlet.c java.c
-LTLIBRARY_DEPENDENCIES = phpsrvlt.jar
-
-EXTRA_CFLAGS = $(JAVA_CFLAGS)
-EXTRA_INCLUDES = $(JAVA_INCLUDE)
-
-include $(top_srcdir)/build/ltlib.mk
-
-java.c : ../../ext/java/java.c
-       @cp ../../ext/java/java.c .
-
-phpsrvlt.jar : servlet.java ../../ext/java/reflect.java
-       $(mkinstalldirs) net/php
-       @echo library=php4>net/php/reflect.properties
-       @echo library=php4>net/php/servlet.properties
-       @cp formatter.java net/php
-       @cp servlet.java net/php
-       @cp ../../ext/java/reflect.java net/php
-       javac net/php/reflect.java
-       @test ! -f reflect.class || mv reflect.class net/php # bug in KJC javac
-       javac -classpath .:$(SERVLET_CLASSPATH):$(CLASSPATH) net/php/servlet.java
-       @test ! -f servlet.class || mv servlet.class net/php # bug in KJC javac
-       javac -classpath .:$(SERVLET_CLASSPATH):$(CLASSPATH) net/php/formatter.java
-       @test ! -f formatter.class || mv formatter.class net/php # bug in KJC javac
-       $(JAVA_JAR) phpsrvlt.jar net/php/*.class net/php/*.properties
-       @rm net/php/servlet.* net/php/reflect.* net/php/formatter.*
-       @rmdir net/php
-       @rmdir net
index 8be5d17199775cc78bc94078c6483a27cb6e3d47..46219bee001f3182374d0e6141c163272a9b7d15 100644 (file)
@@ -37,8 +37,10 @@ AC_ARG_WITH(servlet,
     INSTALL_IT="$INSTALL_IT; \$(INSTALL) -m 0755 \$(srcdir)/sapi/servlet/phpsrvlt.jar \$(libdir)"
     INSTALL_IT="$INSTALL_IT; \$(INSTALL) -m 0755 $SAPI_SHARED \$(libdir)"
     PHP_SAPI=servlet
-    PHP_BUILD_SHARED
     PHP_BUILD_THREAD_SAFE
+    PHP_SELECT_SAPI(servlet, shared, servlet.c)
+    PHP_ADD_SOURCES(/sapi/servlet, java.c,,sapi)
+    PHP_ADD_MAKEFILE_FRAGMENT(sapi/servlet/Makefile.frag)
     AC_MSG_RESULT(yes)
   else
     AC_MSG_RESULT(no)
diff --git a/sapi/thttpd/Makefile.in b/sapi/thttpd/Makefile.in
deleted file mode 100644 (file)
index a18d0f8..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-LTLIBRARY_NAME    = libsapi.la
-LTLIBRARY_SOURCES = stub.c
-
-include $(top_srcdir)/build/ltlib.mk
index 99497efcf1b28754b615fd733b97eb62b8ab4b1d..cb3764152bab17fa54ee855ef5a11f07454f8add 100644 (file)
@@ -18,8 +18,7 @@ AC_ARG_WITH(thttpd,
     (cd $THTTPD && patch < $abs_srcdir/sapi/thttpd/thttpd_patch && touch php_patched)"
   PHP_THTTPD="yes, using $THTTPD"
   PHP_ADD_INCLUDE($THTTPD)
-  PHP_BUILD_STATIC
-  PHP_SAPI=thttpd
+  PHP_SELECT_SAPI(thttpd, static)
 ],[
   PHP_THTTPD=no
 ])
diff --git a/sapi/tux/Makefile.in b/sapi/tux/Makefile.in
deleted file mode 100644 (file)
index 221f50d..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-LTLIBRARY_NAME    = libsapi.la
-LTLIBRARY_SOURCES = php_tux.c
-
-include $(top_srcdir)/build/ltlib.mk
index dc22a72ad1f252c91cb767a8cfaad02fa1ec9d2f..ea12e67c4b46d4fec46d7ae6085e297f189e23b1 100644 (file)
@@ -8,8 +8,7 @@ AC_ARG_WITH(tux,
 [  --with-tux=MODULEDIR    Build PHP as a TUX module (Linux only)],[
   INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $withval/php4.tux.so"
   AC_CHECK_HEADERS(tuxmodule.h,[:],[AC_MSG_ERROR([Cannot find tuxmodule.h])])
-  PHP_BUILD_SHARED
-  PHP_SAPI=tux
+  PHP_SELECT_SAPI(tux, shared, php_tux.c)
   PHP_TUX=yes
 ])
 
diff --git a/sapi/webjames/Makefile.in b/sapi/webjames/Makefile.in
deleted file mode 100644 (file)
index b0dc7f1..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-LTLIBRARY_NAME    = libsapi.la
-LTLIBRARY_SOURCES = webjames.c
-
-include $(top_srcdir)/build/ltlib.mk
index 1e6de60bf553156629aad83d1f25aaeef7c53f04..b7bc225fb2a9f70e11066741645739f856009790 100644 (file)
@@ -12,8 +12,7 @@ AC_ARG_WITH(webjames,
     echo 'PHP_CFLAGS = -DPHP \$(COMMON_FLAGS) \$(EXTRA_CFLAGS) -I$abs_srcdir/sapi/webjames' >> $WEBJAMES/build/php;"
   PHP_WEBJAMES="yes, using $WEBJAMES"
   PHP_ADD_INCLUDE($WEBJAMES)
-  PHP_BUILD_STATIC
-  PHP_SAPI=webjames
+  PHP_SELECT_SAPI(webjames, static, webjames.c)
 ],[
   PHP_WEBJAMES="no"
 ])
diff --git a/scan_makefile_in.awk b/scan_makefile_in.awk
new file mode 100644 (file)
index 0000000..0c6d203
--- /dev/null
@@ -0,0 +1,32 @@
+BEGIN {
+       mode=0
+       sources=""
+}
+       
+mode == 0 && /^LTLIBRARY_SOURCES.*\\$/ {
+       if (match($0, "[^=]*$")) {
+       sources=substr($0, RSTART, RLENGTH-1)
+       }
+       mode=1
+       next
+}
+
+mode == 0 && /^LTLIBRARY_SOURCES.*/ {
+       if (match($0, "[^=]*$")) {
+       sources=substr($0, RSTART, RLENGTH)
+       }
+}
+
+mode == 1 && /.*\\$/ {
+       sources=sources substr($0, 0, length - 1)
+       next
+}
+
+mode == 1 {
+       sources=sources $0
+       mode=0
+}
+
+END {
+       print sources
+}