]> granicus.if.org Git - php/commitdiff
Improved in-tree shared libraries build system
authorSascha Schumann <sas@php.net>
Mon, 1 May 2000 02:42:55 +0000 (02:42 +0000)
committerSascha Schumann <sas@php.net>
Mon, 1 May 2000 02:42:55 +0000 (02:42 +0000)
The following new/revived shared modules are available now:

  ... MySQL (*)
  ... PCRE (*)
  ... Session
  ... SWF

  (*) capable of using bundled library or external library

All changes:

  The m4 macro PHP_EXTENSION was revamped. Uses LIB_BUILD now.
  This effectively means that all extensions have to use dynlib.

  ext/mysql/config.m4 was revamped.
  Uses LIB_BUILD for building bundled library.

  ext/pcre/config.m4 was revamped.
  Uses LIB_BUILD for building bundled library.

  ext/ext_skel was changed to reflect that more modules should be
  compileable as shared module.

  ext/Makefile.in has been simplified enormously.

  Dependencies are now stored in the build tree.

  Empty dependencies are not generated by buildconf anymore. They
  are now dynamically created during the build process.

  Implicit rules for .S were removed.

  The NO_RECURSION feature was removed.

  "libs.mk" has been added to all cvsignore files in ext.

73 files changed:
acinclude.m4
build/build2.mk
build/dynlib.mk [new file with mode: 0644]
build/rules.mk
configure.in
dynlib.m4 [new file with mode: 0644]
ext/Makefile.in
ext/aspell/Makefile.in
ext/bcmath/Makefile.in
ext/calendar/Makefile.in
ext/cpdf/Makefile.in
ext/cybercash/Makefile.in
ext/dav/Makefile.in
ext/db/Makefile.in
ext/dba/Makefile.in
ext/dbase/Makefile.in
ext/domxml/Makefile.in
ext/ext_skel
ext/fdf/Makefile.in
ext/filepro/Makefile.in
ext/ftp/Makefile.in
ext/gd/Makefile.in
ext/gettext/Makefile.in
ext/hyperwave/Makefile.in
ext/icap/Makefile.in
ext/imap/Makefile.in
ext/informix/Makefile.in
ext/interbase/Makefile.in
ext/java/Makefile.in
ext/ldap/Makefile.in
ext/mcal/Makefile.in
ext/mcrypt/Makefile.in
ext/mhash/Makefile.in
ext/msql/Makefile.in
ext/mysql/Makefile.in
ext/mysql/config.m4
ext/mysql/libmysql/Makefile.in
ext/oci8/Makefile.in
ext/odbc/Makefile.in
ext/oracle/Makefile.in
ext/pcre/Makefile.in
ext/pcre/config.m4
ext/pcre/config0.m4
ext/pcre/pcrelib/Makefile.in
ext/pcre/php_pcre.c
ext/pdf/Makefile.in
ext/pgsql/Makefile.in
ext/posix/Makefile.in
ext/readline/Makefile.in
ext/recode/Makefile.in
ext/rpc/Makefile.in
ext/rpc/java/Makefile.in
ext/session/Makefile.in
ext/session/config.m4
ext/session/session.c
ext/snmp/Makefile.in
ext/standard/Makefile.in
ext/swf/Makefile.in
ext/swf/config.m4
ext/swf/php_swf.h
ext/swf/swf.c
ext/sybase/Makefile.in
ext/sybase_ct/Makefile.in
ext/sysvsem/Makefile.in
ext/sysvshm/Makefile.in
ext/wddx/Makefile.in
ext/xml/Makefile.in
ext/xml/config.m4
ext/xml/expat/Makefile.in
ext/xml/expat/xmlparse/Makefile.in
ext/xml/expat/xmltok/Makefile.in
ext/yp/Makefile.in
ext/zlib/Makefile.in

index bd95759a4003d0b985990798e623f61cdb2dc979..8abbc2f629388676843538c73dbd56140527527b 100644 (file)
@@ -2,6 +2,8 @@ dnl $Id$
 dnl
 dnl This file contains local autoconf functions.
 
+sinclude(dynlib.m4)
+
 dnl
 dnl PHP_LIBGCC_LIBPATH(gcc)
 dnl Stores the location of libgcc in libgcc_libpath
@@ -11,15 +13,44 @@ AC_DEFUN(PHP_LIBGCC_LIBPATH,[
   libgcc_libpath="`dirname $ac_data`"
 ])
 
+AC_DEFUN(PHP_ARG_ANALYZE,[
+case "[$]$1" in
+shared,*)
+  ext_output="yes, shared"
+  ext_shared=yes
+  $1=`echo $ac_n "[$]$1$ac_c"|sed s/^shared,//`
+  ;;
+shared)
+  ext_output="yes, shared"
+  ext_shared=yes
+  $1=yes
+  ;;
+no)
+  ext_output="no"
+  ext_shared=no
+  ;;
+*)
+  ext_output="yes"
+  ext_shared=no
+  ;;
+esac
+
+AC_MSG_RESULT($ext_output)
+])
+
 dnl
 dnl PHP_ARG_WITH(arg-name, check message, help text[, default-val])
 dnl Sets PHP_ARG_NAME either to the user value or to the default value.
 dnl default-val defaults to no. 
 dnl
 AC_DEFUN(PHP_ARG_WITH,[
+PHP_REAL_ARG_WITH([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z-,A-Z_))
+])
+
+AC_DEFUN(PHP_REAL_ARG_WITH,[
 AC_MSG_CHECKING($2)
-AC_ARG_WITH($1,[$3],PHP_[]translit($1,a-z-,A-Z_)=[$]withval,PHP_[]translit($1,a-z-,A-Z_)=ifelse($4,,no,$4))
-AC_MSG_RESULT([$]PHP_[]translit($1,a-z-,A-Z_))
+AC_ARG_WITH($1,[$3],$5=[$]withval,$5=ifelse($4,,no,$4))
+PHP_ARG_ANALYZE($5)
 ])
 
 dnl
@@ -28,9 +59,13 @@ dnl Sets PHP_ARG_NAME either to the user value or to the default value.
 dnl default-val defaults to no. 
 dnl
 AC_DEFUN(PHP_ARG_ENABLE,[
+PHP_REAL_ARG_ENABLE([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z-,A-Z_))
+])
+
+AC_DEFUN(PHP_REAL_ARG_ENABLE,[
 AC_MSG_CHECKING($2)
-AC_ARG_ENABLE($1,[$3],PHP_[]translit($1,a-z-,A-Z_)=[$]enableval,PHP_[]translit($1,a-z-,A-Z_)=ifelse($4,,no,$4))
-AC_MSG_RESULT([$]PHP_[]translit($1,a-z-,A-Z_))
+AC_ARG_ENABLE($1,[$3],$5=[$]enableval,$5=ifelse($4,,no,$4))
+PHP_ARG_ANALYZE($5)
 ])
 
 AC_DEFUN(PHP_MODULE_PTR,[
@@ -450,21 +485,30 @@ dnl "shared" can be set to "shared" or "yes" to build the extension as
 dnl a dynamically loadable library.
 dnl
 AC_DEFUN(PHP_EXTENSION,[
-  if test -d "$abs_srcdir/ext/$1" ; then
-    ext_src_base="$abs_srcdir/ext/$1/"
-    ext_base="ext/$1/"
-    EXT_SUBDIRS="$EXT_SUBDIRS $1"
-    if test "$2" != "shared" && test "$2" != "yes" && test -z "$php_always_shared"; then
-      _extlib="lib$1.a"
-      EXT_LTLIBS="$EXT_LTLIBS ext/$1/lib$1.la"
-      EXT_LIBS="$EXT_LIBS $1/$_extlib"
-      EXT_STATIC="$EXT_STATIC $1"
-    else
-      AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z-,A-Z_), 1, Whether to build $1 as dynamic module)
-      EXT_SHARED="$EXT_SHARED $1"
-    fi
-    PHP_FAST_OUTPUT(ext/$1/Makefile)
+  EXT_SUBDIRS="$EXT_SUBDIRS $1"
+  
+  if test -d "$abs_srcdir/ext/$1"; then
+dnl ---------------------------------------------- Internal Module
+    ext_builddir="ext/$1"
+    ext_srcdir="$abs_srcdir/ext/$1"
+  else
+dnl ---------------------------------------------- External Module
+    ext_builddir="."
+    ext_srcdir="$abs_srcdir"
   fi
+
+  if test "$2" != "shared" && test "$2" != "yes"; then
+dnl ---------------------------------------------- Static module
+    LIB_BUILD($ext_builddir)
+    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/lib$1.la"
+    EXT_STATIC="$EXT_STATIC $1"
+  else 
+dnl ---------------------------------------------- Shared module
+    LIB_BUILD($ext_builddir,yes)
+    AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z-,A-Z_), 1, Whether to build $1 as dynamic module)
+  fi
+
+  PHP_FAST_OUTPUT($ext_builddir/Makefile)
 ])
 
 PHP_SUBST(EXT_SUBDIRS)
index d74834355b7d9287589a390806cb76e79f8d385d..b51f86ace4024290475a66856c33bd4a550d7a38 100644 (file)
@@ -39,14 +39,7 @@ acconfig_h_SOURCES = acconfig.h.in $(config_h_files)
 targets = $(TOUCH_FILES) $(makefile_in_files) configure $(config_h_in)
 
 
-all: .deps Zend/Makefile.am TSRM/Makefile.am $(targets)
-
-.deps:
-       @echo creating empty dependencies
-       for i in `find ext sapi regex -type d \! -name \*CVS`; do \
-               list="$$list $$i/.deps"; \
-       done; \
-       touch $$list pear/.deps ext/mysql/libmysql/.deps $@
+all: Zend/Makefile.am TSRM/Makefile.am $(targets)
 
 Zend/Makefile.am:
        test -d Zend || (test -d ../Zend && ln -s ../Zend Zend)
@@ -71,7 +64,7 @@ $(makefile_in_files): $(makefile_am_files) aclocal.m4 configure.in $(config_m4_f
                || true >&2
        @for i in $(LT_TARGETS); do mv $$i.bak $$i; done
 
-aclocal.m4: configure.in acinclude.m4
+aclocal.m4: configure.in acinclude.m4 dynlib.m4
        aclocal
 
 $(config_h_in): configure acconfig.h
diff --git a/build/dynlib.mk b/build/dynlib.mk
new file mode 100644 (file)
index 0000000..d7e695c
--- /dev/null
@@ -0,0 +1,5 @@
+all: all-recursive
+
+include $(builddir)/libs.mk
+
+include $(top_srcdir)/build/rules.mk
index e034caaaf7487b9503bda22e1728391860985d08..9e389efc217e8b9b4222f11b4d374c3ec0acc157 100644 (file)
@@ -33,13 +33,13 @@ LINK = $(LIBTOOL) --mode=link $(CCLD) $(CFLAGS) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@
 mkinstalldirs = $(top_srcdir)/build/shtool mkdir -f -p
 INSTALL = $(top_srcdir)/build/shtool install -c
 INSTALL_DATA = $(INSTALL) -m 644
-
+SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -c $< && touch $@
 DEFS = -DHAVE_CONFIG_H -I. -I$(srcdir) -I$(top_builddir)
 
 moduledir    = $(libdir)/php/modules
 
 .SUFFIXES:
-.SUFFIXES: .S .c .lo .o .s .y .l
+.SUFFIXES: .slo .c .lo .o .s .y .l
 
 .c.o:
        $(COMPILE) -c $<
@@ -47,17 +47,14 @@ moduledir    = $(libdir)/php/modules
 .s.o:
        $(COMPILE) -c $<
 
-.S.o:
-       $(COMPILE) -c $<
-
 .c.lo:
        $(PHP_COMPILE)
 
 .s.lo:
        $(PHP_COMPILE)
 
-.S.lo:
-       $(PHP_COMPILE)
+.c.slo:
+       $(SHARED_COMPILE)
 
 .y.c:
        $(YACC) $(YFLAGS) $< && mv y.tab.c $*.c
@@ -74,34 +71,30 @@ install: install-recursive
 
 distclean-recursive depend-recursive clean-recursive all-recursive install-recursive:
        @otarget=`echo $@|sed s/-recursive//`; \
-       if test '$(NO_RECURSION)' != "$$otarget"; then \
-               list='$(SUBDIRS)'; for i in $$list; do \
-                       target="$$otarget"; \
-                       echo "Making $$target in $$i"; \
-                       if test "$$i" = "."; then \
-                               ok=yes; \
-                               target="$$target-p"; \
-                       fi; \
-                       (cd $$i && $(MAKE) $$target) || exit 1; \
-               done; \
-               if test "$$otarget" = "all" && test -z '$(targets)'; then ok=yes; fi; \
-               if test "$$ok" != "yes"; then $(MAKE) "$$otarget-p" || exit 1; fi; \
-       fi; \
-       if test -n '$(make_shared)'; then \
-               $(MAKE) shared || exit 1; \
-       fi;
+       list='$(SUBDIRS)'; for i in $$list; do \
+               target="$$otarget"; \
+               echo "Making $$target in $$i"; \
+               if test "$$i" = "."; then \
+                       ok=yes; \
+                       target="$$target-p"; \
+               fi; \
+               if test ! -f $$i/.deps; then touch $$i/.deps; fi; \
+               (cd $$i && $(MAKE) $$target) || exit 1; \
+       done; \
+       if test "$$otarget" = "all" && test -z '$(targets)'; then ok=yes; fi; \
+       if test "$$ok" != "yes"; then $(MAKE) "$$otarget-p" || exit 1; fi
 
 all-p: $(targets)
 install-p: $(targets) $(install_targets)
 distclean-p depend-p clean-p:
 
 depend: depend-recursive
-       test "`echo *.c`" = '*.c' || perl $(top_srcdir)/build/mkdep.perl $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) *.c > .deps
+       test "`echo *.c`" = '*.c' || perl $(top_srcdir)/build/mkdep.perl $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) *.c > $(builddir)/.deps
 
 clean: clean-recursive clean-x
 
 clean-x:
-       rm -f $(targets) *.lo *.la *.o $(CLEANFILES)
+       rm -f $(targets) *.lo *.slo *.la *.o $(CLEANFILES)
        rm -rf .libs
 
 distclean: distclean-recursive clean-x
@@ -115,7 +108,7 @@ install-modules:
        rm -f modules/*.la && \
        cp modules/* $(moduledir) || true
 
-include $(srcdir)/.deps
+include $(builddir)/.deps
 
 .PHONY: all-recursive clean-recursive install-recursive \
 $(install_targets) install all clean depend depend-recursive shared \
index 6f7cd86c397dc57be09ae378cb847fc0a169e6cb..bf4df29262884051ffd822a9d9e0fa503a6b8e04 100644 (file)
@@ -644,6 +644,7 @@ fi
 
 
 phplibdir="`pwd`/modules"
+test -d $phplibdir || mkdir $phplibdir
 phptempdir="`pwd`/libs"
 
 AC_BUILD_RPATH
@@ -697,7 +698,7 @@ PHP_SUBST(PHP_SAPI)
 PHP_SUBST(PHP_VERSION)
 PHP_SUBST(PROG_SENDMAIL)
 PHP_SUBST(SHELL)
-PHP_SUBST(SHLIBTOOL)
+PHP_SUBST(SHARED_LIBTOOL)
 PHP_SUBST(TSRM_DIR)
 PHP_SUBST(TSRM_LIB)
 PHP_SUBST(WARNING_LEVEL)
@@ -732,12 +733,12 @@ fi
 PHP_COMPILE='$(LIBTOOL) --mode=compile $(COMPILE) -c $<'
 
 if test "$enable_shared" = "yes"; then
-  SHLIBTOOL='$(LIBTOOL)'
+  SHARED_LIBTOOL='$(LIBTOOL)'
 else
-  if test -n "$EXT_SHARED"; then
+  if test "$lib_build_shared" = "yes"; then
     PHP_CONFIGURE_PART(Configuring shared libtool)
     $SHELL $srcdir/ltconfig --output=shlibtool --disable-static --srcdir=$srcdir --cache-file=./config.cache $srcdir/ltmain.sh
-    SHLIBTOOL='$(SHELL) $(top_builddir)/shlibtool'
+    SHARED_LIBTOOL='$(SHELL) $(top_builddir)/shlibtool'
   else
     PHP_COMPILE='$(COMPILE) -c $< && touch $@'
   fi
@@ -763,6 +764,7 @@ test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
 PHP_CONFIGURE_PART(Generating files)
 
 PHP_FAST_GENERATE
+touch .deps
 
 #libphp4.module 
 AC_OUTPUT([php4.spec Zend/Makefile 
diff --git a/dynlib.m4 b/dynlib.m4
new file mode 100644 (file)
index 0000000..fb3c70a
--- /dev/null
+++ b/dynlib.m4
@@ -0,0 +1,64 @@
+
+
+
+AC_DEFUN(LIB_SHARED_CONVENIENCE,[
+  lib_target="\$(LTLIBRARY_NAME)"
+  cat >>$1<<EOF
+\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
+       \$(SHARED_LIBTOOL) --mode=link \$(CCLD) \$(CFLAGS) \$(EXTRA_CFLAGS) \$(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 \$(CCLD) \$(CFLAGS) \$(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=""
+  
+  test -d $1 || $php_shtool mkdir -p $1
+  cat >$lib_makefile<<EOF
+LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo)
+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
+])
index d490f0116f467f1c91f7c07a975875eb3b8a64fc..77ff9c04b5f095085a14b6eb2ce74e4c04ad533a 100644 (file)
@@ -1,16 +1,4 @@
 
-SUBDIRS = $(EXT_STATIC) $(EXT_SHARED)
+SUBDIRS = $(EXT_SUBDIRS)
 
-all:
-       @list='$(EXT_STATIC)'; for i in $$list; do \
-               echo "Making all in $$i"; \
-               (cd $$i && $(MAKE) all) || exit 1; \
-       done
-       @list='$(EXT_SHARED)'; for i in $$list; do \
-               echo "Making shared in $$i"; \
-               (cd $$i && $(MAKE) shared) || exit 1; \
-       done
-
-NO_RECURSION = all
-       
 include $(top_srcdir)/build/rules.mk
index 94ffb01cf586829aebb724e2ff45e59de192c81b..c80a02c6173792d1d9cf26914ae5a273832264ef 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libaspell.la
 LTLIBRARY_SOURCES = aspell.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index e8517a459c1f811df6cd81841c3d87ad3ce66e43..0cd414d53ae276b058b73045a2ec1ba123a98835 100644 (file)
@@ -2,5 +2,5 @@
 LTLIBRARY_NAME    = libbcmath.la
 LTLIBRARY_SOURCES = bcmath.c number.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
 
index 1b49f58b8f7e78724512a76f09d7f4f545746a7f..d5c851486903260ee96c26fbe664baa8709b8bcf 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libcalendar.la
 LTLIBRARY_SOURCES = calendar.c dow.c french.c gregor.c jewish.c julian.c easter.c cal_unix.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index ee8e1cd1cb29ef968beb329f2a67aeadffe3cc17..7a74ccdba5caa724455502f64ed37f8d9e818a00 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libcpdf.la
 LTLIBRARY_SOURCES = cpdf.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 3d3c1d39e71ab2af3b53535e5034b2f03c1c5e3b..99ab73a9046fd3601f064d658ebbcc363f84be74 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libcybercash.la
 LTLIBRARY_SOURCES = cybercash.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 5e3149ea236e88a3aeabe970a05b8d510d11f33f..166edc8ff2c770e7066274f79a1863f9b0be49bc 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libdav.la
 LTLIBRARY_SOURCES = dav.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 1e877d5c88eb389ec73dc9e960c93e3f9822918b..f4531bed5803cc98f61f49133c61f57d6a2febe3 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libdb.la
 LTLIBRARY_SOURCES = db.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 3fb80ee8026b4b41152403508796deab6f09c2ac..75162fcebb46054f72583c3881c9531810439d33 100644 (file)
@@ -3,4 +3,4 @@ LTLIBRARY_NAME = libdba.la
 LTLIBRARY_SOURCES = dba.c dba_cdb.c dba_db2.c dba_dbm.c dba_gdbm.c \
                dba_ndbm.c dba_db3.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index fd67bf065c71bece644e9478b80a6c0d462abb09..0fe66dbda43c12e62f40b952e3281091c2049345 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libdbase.la
 LTLIBRARY_SOURCES = dbf_head.c dbf_rec.c dbf_misc.c dbf_ndx.c dbase.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 5bb4f6ff41095f5aab61e46b8b2e011221ebaea7..f7b9d4c61f0607c0e4fb495e861cd9175bff962a 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libdomxml.la
 LTLIBRARY_SOURCES = domxml.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 3db7ebae57f21dc487d12aa093e605e432a01558..60b5a224f96682555757359087620c0860b4d547 100755 (executable)
@@ -56,7 +56,7 @@ dnl Make sure that the comment is aligned:
 
 if test "\$PHP_$EXTNAME" != "no"; then
   dnl Action..
-  PHP_EXTENSION($extname)
+  PHP_EXTENSION($extname, \$ext_shared)
 fi
 eof
 
@@ -64,10 +64,11 @@ $ECHO_N " Makefile.in$ECHO_C"
 cat >Makefile.in <<eof
 # \$Id\$
 
-LTLIBRARY_NAME    = lib$extname.la
-LTLIBRARY_SOURCES = $extname.c
+LTLIBRARY_NAME        = lib$extname.la
+LTLIBRARY_SOURCES     = $extname.c
+LTLIBRARY_SHARED_NAME = $extname.la
 
-include \$(top_srcdir)/build/ltlib.mk
+include \$(top_srcdir)/build/dynlib.mk
 eof
 
 
@@ -79,6 +80,7 @@ Makefile
 *.lo
 *.la
 .libs
+libs.mk
 eof
 
 chmod 644 *
index db4edddee593a2433993fbc0962e2fd7c72ed0ee..8acb8fbf52abab8ec50f52dae3b23b1941bea1c6 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libfdf.la
 LTLIBRARY_SOURCES = fdf.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 491dcccffd9e89ffd0d5a5f21f4d73db34816ba2..efa4ac7a2b40cca30d7bddd130489164e08d66e4 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libfilepro.la
 LTLIBRARY_SOURCES = filepro.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 44bedc78f9db722f2204359744a876bb90e2c13d..9f6104836248ce255e73c45bdbd46e86a8b6ba15 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libftp.la
 LTLIBRARY_SOURCES = php_ftp.c ftp.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 6cb0424b45db8eb465a178e3f14bd0388d0bff61..fb82a8b6962776737e815d70f6eea1eb043c42de 100644 (file)
@@ -4,5 +4,5 @@ LTLIBRARY_SOURCES = gd.c gdcache.c gdttf.c gdt1.c
 LTLIBRARY_SHARED_NAME   = gd.la
 LTLIBRARY_SHARED_LIBADD = $(GD_LFLAGS) $(GD_LIBS)
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
 
index bac3cf40900a786d40e1a60e42938b00f56ace80..88c84b687cad1bca20f4ac2da51a4cf74b37ac9d 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libgettext.la
 LTLIBRARY_SOURCES = gettext.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 119da1d4fc7b81d1af167a9cd124baebd76703ca..b66d82cfda183849bc73480dc148db4a8113940e 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libhyperwave.la
 LTLIBRARY_SOURCES = hw.c hg_comm.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 9bb6e34005d65858f1ee49410dbc0715638f34e9..5965ec0272ea1f3aef3324db06a340c09db23b2e 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libicap.la
 LTLIBRARY_SOURCES = php_icap.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index f5f7ed21a43573fe000fabdb393c10fcb7fda094..8eec3416498396382dce23b79ed14841e33f6572 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libimap.la
 LTLIBRARY_SOURCES = php_imap.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 799f83d2841f5b37e64756b7bb377b52ebbe75c1..36989a3e1ff9460fc9d743a5679d653790531eda 100644 (file)
@@ -4,7 +4,7 @@ LTLIBRARY_SOURCES = ifx.c
 LTLIBRARY_LIBADD  = $(IFX_LIBS)
 CLEANFILES        = ifx.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
 
 ifx.c: $(srcdir)/ifx.ec
        (if test -d $(INFORMIXDIR); then \
index 414012d95bb878c28f0ce43427f7e3d807669282..a2ccc12f11bb317a682683d73d805dd2cb93fd26 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libinterbase.la
 LTLIBRARY_SOURCES = interbase.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 26fab50d02e3e0ac38357a4b99c7be6fc71918bf..7d8960a34f69803371aab7f80e18b2c844ddea04 100644 (file)
@@ -11,7 +11,7 @@ EXTRA_INCLUDES = $(JAVA_INCLUDE)
 
 make_shared = yes
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
 
 php_java.jar : reflect.java
        @test -d net || mkdir net
index e01996fc0737c66d24b99853151cd7e1a5bf6aa1..dd196e1f263bdde496ab0094474f727dbd342568 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libldap.la
 LTLIBRARY_SOURCES = ldap.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 4abaaa36833df4521c1d0d8ea451a10a2d6d1cc5..fa78917882becb507291d44072f99ecddb58d30d 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libmcal.la
 LTLIBRARY_SOURCES = php_mcal.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index ae5ba57ca7f9d0338e514c018a905aef5f09a462..8eaf83ae22f646438fa13880bba9517828974c72 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libmcrypt.la
 LTLIBRARY_SOURCES = mcrypt.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 65962b0b342639e72a6faf6f37b2253e11630b44..e7735193ff4b570159aa92d54fb9505344de6bb9 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libmhash.la
 LTLIBRARY_SOURCES = mhash.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index a65b6d98586aa3cdcbc9365ef883f8953e27ff3d..19a133224086c0d5a8f8e57d1ada2f91a868d1e9 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libmsql.la
 LTLIBRARY_SOURCES = php_msql.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 0ae2db88c4e30ca893005d19dfa44a039095d7a1..110388f9f58d1ca4a45c1fa5e24ca9279553ff1e 100644 (file)
@@ -3,8 +3,8 @@ LTLIBRARY_NAME    = libmysql.la
 LTLIBRARY_SOURCES = php_mysql.c
 LTLIBRARY_LIBADD  = $(MYSQL_LIBADD)
 LTLIBRARY_SHARED_NAME    = mysql.la
-LTLIBRARY_SHARED_LIBADD  = $(MYSQL_LFLAGS) -lmysqlclient
+LTLIBRARY_SHARED_LIBADD  = $(MYSQL_SHARED_LIBADD)
 
 SUBDIRS = $(MYSQL_SUBDIRS)
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 77c242d9b00986819b50092c88f81c79e6c82055..8772e922f2c6e3e49f9699cf1c49a23310ada334 100644 (file)
@@ -26,18 +26,19 @@ PHP_ARG_WITH(mysql, for MySQL support,
 
 if test "$PHP_MYSQL" != "no"; then
   AC_DEFINE(HAVE_MYSQL, 1, [Whether you have MySQL])
-  PHP_EXTENSION(mysql)
+  PHP_EXTENSION(mysql,$ext_shared)
 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)
-
-  AC_ADD_INCLUDE(${ext_src_base}libmysql)
+  LIB_BUILD($ext_builddir/libmysql,$ext_shared,yes)
+  AC_ADD_INCLUDE($ext_srcdir/libmysql)
 elif test "$PHP_MYSQL" != "no"; then
   for i in $PHP_MYSQL; do
     if test -r $i/include/mysql/mysql.h; then
@@ -53,7 +54,14 @@ elif test "$PHP_MYSQL" != "no"; then
     AC_MSG_ERROR(Cannot find header files under $PHP_MYSQL)
   fi
 
-  AC_ADD_LIBPATH($MYSQL_DIR/lib/mysql) 
-  AC_ADD_LIBRARY(mysqlclient)
+
+  if test "$ext_shared" = "yes"; then
+    MYSQL_SHARED_LIBADD="-R$MYSQL_DIR/lib/mysql -L$MYSQL_DIR/lib/mysql -lmysqlclient"
+  else
+    AC_ADD_LIBPATH($MYSQL_DIR/lib/mysql) 
+    AC_ADD_LIBRARY(mysqlclient)
+  fi
+
   AC_ADD_INCLUDE($MYSQL_INC_DIR)
 fi
+PHP_SUBST(MYSQL_SHARED_LIBADD)
index 43f25bd97686c264527b3e32c5bffb17947e4d2c..aaf98db2bcb432b5bd3c7c2599e69237b4de11fe 100644 (file)
@@ -13,4 +13,4 @@ LTLIBRARY_SOURCES = libmysql.c errmsg.c net.c violite.c password.c \
        strcont.c strcend.c bchange.c bmove.c bmove_upp.c \
        longlong2str.c strtoull.c strtoll.c ctype-latin1.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 1f4628c47fa5b122d0f1f04ceb5db0a10ff0ed12..7eba37e809b7036ef9e60cb1755ddf684471bf4b 100644 (file)
@@ -4,4 +4,4 @@ LTLIBRARY_SOURCES = oci8.c
 LTLIBRARY_SHARED_NAME   = oci8.la
 LTLIBRARY_SHARED_LIBADD = $(OCI8_LFLAGS) $(OCI8_LIBS)
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index cc99346b0904085fe076f6db915aeea65d809e6d..46f8b827e4d2dc2ef218e4eeaab2b5c58b6275d1 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libodbc.la
 LTLIBRARY_SOURCES = php_odbc.c velocis.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index e1be724441aabaf19fa34a0f1629e3e31e056df4..03fe31681c4244cc532de5be01ec8718f9145b4c 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = liboracle.la
 LTLIBRARY_SOURCES = oracle.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index aefe85016fea26c70477a0f897706a2a76c21584..9316a487204ffef716852b32196d1d79ff8d4215 100644 (file)
@@ -2,7 +2,9 @@
 LTLIBRARY_NAME    = libpcre.la
 LTLIBRARY_SOURCES = php_pcre.c
 LTLIBRARY_LIBADD  = $(PCRE_LIBADD)
+LTLIBRARY_SHARED_NAME = pcre.la
+LTLIBRARY_SHARED_LIBADD = $(PCRE_SHARED_LIBADD)
 
 SUBDIRS = $(PCRE_SUBDIRS)
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 32eb634a8a439ef4554dde3d43ecf59afeee1e17..076dde07523fc4320098d28401e53a6700ce271d 100644 (file)
@@ -4,70 +4,62 @@ dnl config.m4 for extension pcre
 dnl By default we'll compile and link against the bundled PCRE library
 dnl if DIR is supplied, we'll use that for linking
 
-AC_MSG_CHECKING(whether to include PCRE support)
-AC_ARG_WITH(pcre-regex,
+PHP_ARG_WITH(pcre-regex,whether to include PCRE support,
 [  --without-pcre-regex    Do not include Perl Compatible Regular Expressions 
                           support. Use --with-pcre-regex=DIR to specify DIR
                           where PCRE's include and library files are located,
-                          if not using bundled library.],
-[
-       case "$withval" in 
-               no)
-                       AC_MSG_RESULT(no)
-                       ;;
-               yes)
-                       EXTRA_LIBS="-L$abs_builddir/ext/pcre/pcrelib -lpcre $EXTRA_LIBS"
-                       PCRE_SUBDIR="pcrelib"
-                       AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ])
-                       AC_MSG_RESULT(yes)
-                       PHP_EXTENSION(pcre)
-                       PHP_FAST_OUTPUT(ext/pcre/pcrelib/Makefile)
-                       ;;
-               *)
-                       test -f $withval/pcre.h && PCRE_INCDIR="$withval"
-                       test -f $withval/include/pcre.h && PCRE_INCDIR="$withval/include"
+                          if not using bundled library.],yes)
 
-                       if test -n "$PCRE_INCDIR" ; then
-                               changequote({,})
-                               pcre_major=`grep PCRE_MAJOR $PCRE_INCDIR/pcre.h | sed -e 's/[^0-9]//g'`
-                               pcre_minor=`grep PCRE_MINOR $PCRE_INCDIR/pcre.h | sed -e 's/[^0-9]//g'`
-                               changequote([,])
-                               pcre_minor_length=`echo "$pcre_minor" | wc -c | sed -e 's/[^0-9]//g'`
-                               if test "$pcre_minor_length" -eq 2 ; then
-                                       pcre_minor="$pcre_minor"0
-                               fi
-                               pcre_version=$pcre_major$pcre_minor
-                               if test "$pcre_version" -ge 208; then
-                                       AC_ADD_INCLUDE($PCRE_INCDIR)
-                               else
-                                       AC_MSG_ERROR(PCRE extension requires PCRE library version >= 2.08)
-                               fi
-                       else
-                               AC_MSG_ERROR(Could not find pcre.h in $withval)
-                       fi
+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)
+    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
+    
+    if test -z "$PCRE_INCDIR"; then
+      AC_MSG_RESULT(Could not find pcre.h in $PHP_PCRE_REGEX)
+    fi
 
-                       test -f $withval/libpcre.a && PCRE_LIBDIR="$withval"
-                       test -f $withval/lib/libpcre.a && PCRE_LIBDIR="$withval/lib"
-                       if test -n "$PCRE_LIBDIR" ; then
-                               AC_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR)
-                       else
-                               AC_MSG_ERROR(Could not find libpcre.a in $withval)
-                       fi
+    changequote({,})
+    pcre_major=`grep PCRE_MAJOR $PCRE_INCDIR/pcre.h | sed -e 's/[^0-9]//g'`
+    pcre_minor=`grep PCRE_MINOR $PCRE_INCDIR/pcre.h | sed -e 's/[^0-9]//g'`
+    changequote([,])
+    pcre_minor_length=`echo "$pcre_minor" | wc -c | sed -e 's/[^0-9]//g'`
+    if test "$pcre_minor_length" -eq 2 ; then
+      pcre_minor="$pcre_minor"0
+    fi
+    pcre_version=$pcre_major$pcre_minor
+    if test "$pcre_version" -lt 208; then
+      AC_MSG_ERROR(The PCRE extension requires PCRE library version >= 2.08)
+    fi
+
+    test -f $PHP_PCRE_REGEX/libpcre.a && PCRE_LIBDIR="$PHP_PCRE_REGEX"
+    test -f $PHP_PCRE_REGEX/lib/libpcre.a && PCRE_LIBDIR="$PHP_PCRE_REGEX/lib"
+
+    if test -z "$PCRE_LIBDIR" ; then
+      AC_MSG_ERROR(Could not find libpcre.a in $PHP_PCRE_REGEX)
+    fi
+
+    if test "$ext_shared" = "yes"; then
+      PCRE_SHARED_LIBADD="-R$PCRE_LIBDIR -L$PCRE_LIBDIR -lpcre"
+    else
+      AC_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR)
+    fi
+    
+    AC_ADD_INCLUDE($PCRE_INCDIR)
+    AC_DEFINE(HAVE_PCRE, 1, [ ])
+  fi
+fi
+PHP_SUBST(PCRE_SHARED_LIBADD)
 
-                       AC_DEFINE(HAVE_PCRE, 1, [ ])
-                       AC_MSG_RESULT(yes)
-                       PHP_EXTENSION(pcre)
-                       ;;
-       esac
-],[
-  PCRE_LIBADD=pcrelib/libpcre.la
-  PCRE_SUBDIRS=pcrelib
-  AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ])
-  AC_MSG_RESULT(yes)
-  PHP_EXTENSION(pcre)
-  PHP_FAST_OUTPUT(ext/pcre/pcrelib/Makefile)
-]) 
-PHP_SUBST(PCRE_LIBADD)
-PHP_SUBST(PCRE_SUBDIRS)
 
 AC_CHECK_FUNC(memmove, [], [AC_DEFINE(USE_BCOPY, 1, [ ])])
index 32eb634a8a439ef4554dde3d43ecf59afeee1e17..076dde07523fc4320098d28401e53a6700ce271d 100644 (file)
@@ -4,70 +4,62 @@ dnl config.m4 for extension pcre
 dnl By default we'll compile and link against the bundled PCRE library
 dnl if DIR is supplied, we'll use that for linking
 
-AC_MSG_CHECKING(whether to include PCRE support)
-AC_ARG_WITH(pcre-regex,
+PHP_ARG_WITH(pcre-regex,whether to include PCRE support,
 [  --without-pcre-regex    Do not include Perl Compatible Regular Expressions 
                           support. Use --with-pcre-regex=DIR to specify DIR
                           where PCRE's include and library files are located,
-                          if not using bundled library.],
-[
-       case "$withval" in 
-               no)
-                       AC_MSG_RESULT(no)
-                       ;;
-               yes)
-                       EXTRA_LIBS="-L$abs_builddir/ext/pcre/pcrelib -lpcre $EXTRA_LIBS"
-                       PCRE_SUBDIR="pcrelib"
-                       AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ])
-                       AC_MSG_RESULT(yes)
-                       PHP_EXTENSION(pcre)
-                       PHP_FAST_OUTPUT(ext/pcre/pcrelib/Makefile)
-                       ;;
-               *)
-                       test -f $withval/pcre.h && PCRE_INCDIR="$withval"
-                       test -f $withval/include/pcre.h && PCRE_INCDIR="$withval/include"
+                          if not using bundled library.],yes)
 
-                       if test -n "$PCRE_INCDIR" ; then
-                               changequote({,})
-                               pcre_major=`grep PCRE_MAJOR $PCRE_INCDIR/pcre.h | sed -e 's/[^0-9]//g'`
-                               pcre_minor=`grep PCRE_MINOR $PCRE_INCDIR/pcre.h | sed -e 's/[^0-9]//g'`
-                               changequote([,])
-                               pcre_minor_length=`echo "$pcre_minor" | wc -c | sed -e 's/[^0-9]//g'`
-                               if test "$pcre_minor_length" -eq 2 ; then
-                                       pcre_minor="$pcre_minor"0
-                               fi
-                               pcre_version=$pcre_major$pcre_minor
-                               if test "$pcre_version" -ge 208; then
-                                       AC_ADD_INCLUDE($PCRE_INCDIR)
-                               else
-                                       AC_MSG_ERROR(PCRE extension requires PCRE library version >= 2.08)
-                               fi
-                       else
-                               AC_MSG_ERROR(Could not find pcre.h in $withval)
-                       fi
+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)
+    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
+    
+    if test -z "$PCRE_INCDIR"; then
+      AC_MSG_RESULT(Could not find pcre.h in $PHP_PCRE_REGEX)
+    fi
 
-                       test -f $withval/libpcre.a && PCRE_LIBDIR="$withval"
-                       test -f $withval/lib/libpcre.a && PCRE_LIBDIR="$withval/lib"
-                       if test -n "$PCRE_LIBDIR" ; then
-                               AC_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR)
-                       else
-                               AC_MSG_ERROR(Could not find libpcre.a in $withval)
-                       fi
+    changequote({,})
+    pcre_major=`grep PCRE_MAJOR $PCRE_INCDIR/pcre.h | sed -e 's/[^0-9]//g'`
+    pcre_minor=`grep PCRE_MINOR $PCRE_INCDIR/pcre.h | sed -e 's/[^0-9]//g'`
+    changequote([,])
+    pcre_minor_length=`echo "$pcre_minor" | wc -c | sed -e 's/[^0-9]//g'`
+    if test "$pcre_minor_length" -eq 2 ; then
+      pcre_minor="$pcre_minor"0
+    fi
+    pcre_version=$pcre_major$pcre_minor
+    if test "$pcre_version" -lt 208; then
+      AC_MSG_ERROR(The PCRE extension requires PCRE library version >= 2.08)
+    fi
+
+    test -f $PHP_PCRE_REGEX/libpcre.a && PCRE_LIBDIR="$PHP_PCRE_REGEX"
+    test -f $PHP_PCRE_REGEX/lib/libpcre.a && PCRE_LIBDIR="$PHP_PCRE_REGEX/lib"
+
+    if test -z "$PCRE_LIBDIR" ; then
+      AC_MSG_ERROR(Could not find libpcre.a in $PHP_PCRE_REGEX)
+    fi
+
+    if test "$ext_shared" = "yes"; then
+      PCRE_SHARED_LIBADD="-R$PCRE_LIBDIR -L$PCRE_LIBDIR -lpcre"
+    else
+      AC_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR)
+    fi
+    
+    AC_ADD_INCLUDE($PCRE_INCDIR)
+    AC_DEFINE(HAVE_PCRE, 1, [ ])
+  fi
+fi
+PHP_SUBST(PCRE_SHARED_LIBADD)
 
-                       AC_DEFINE(HAVE_PCRE, 1, [ ])
-                       AC_MSG_RESULT(yes)
-                       PHP_EXTENSION(pcre)
-                       ;;
-       esac
-],[
-  PCRE_LIBADD=pcrelib/libpcre.la
-  PCRE_SUBDIRS=pcrelib
-  AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ])
-  AC_MSG_RESULT(yes)
-  PHP_EXTENSION(pcre)
-  PHP_FAST_OUTPUT(ext/pcre/pcrelib/Makefile)
-]) 
-PHP_SUBST(PCRE_LIBADD)
-PHP_SUBST(PCRE_SUBDIRS)
 
 AC_CHECK_FUNC(memmove, [], [AC_DEFINE(USE_BCOPY, 1, [ ])])
index 9f99bb5ba86d5bbbab0739f9f6350a0e1d6ec798..5adf8a3f107e654b949b3992121e1d1a0fa10ec4 100644 (file)
@@ -2,5 +2,5 @@
 LTLIBRARY_NAME = libpcre.la
 LTLIBRARY_SOURCES = maketables.c get.c study.c pcre.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
 
index f8a19fb99cd95780e833129f019d6dbacd20a38e..2c5bc262a58b97a1cabe43ec24572e6f7aa27854 100644 (file)
@@ -1210,6 +1210,10 @@ zend_module_entry pcre_module_entry = {
                   STANDARD_MODULE_PROPERTIES
 };
 
+#ifdef COMPILE_DL_PCRE
+ZEND_DLEXPORT zend_module_entry *get_module(void) { return &pcre_module_entry; }
+#endif
+
 /* }}} */
 
 
index e8fa3fd9fde1968a29665a75e71cf60257c1aab2..8577f1f2ff0e5a22bca5a4816a1686757cc207cd 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libpdf.la
 LTLIBRARY_SOURCES = pdf.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index cf484da24195ec2b985a6f7ff0b2e7b9c2a1e6f4..26b3f94f4a4b25bfc86f33728fb2f5114aabd96f 100644 (file)
@@ -6,4 +6,4 @@ LTLIBRARY_SHARED_LIBADD = $(PGSQL_LFLAGS) $(PGSQL_LIBS)
 
 EXTRA_INCLUDES = $(PGSQL_INCLUDE)
        
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 61fdd01d206e9ce192459cf5e31cff0c96476bcb..82f169b2d01e634bb2351ba065b1a4d79afde74d 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libposix.la
 LTLIBRARY_SOURCES = posix.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 84006b07844a7bbaee161922c6210bfbb5d19f2d..da1c0c71794732a60baa7f9afbee0b19d459b11b 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libreadline.la
 LTLIBRARY_SOURCES = readline.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 715ae0319c1f2c0e28f07bcfba35de6a9368dc46..1e02abb3d94795d410de28c555e2e403e199c570 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = librecode.la
 LTLIBRARY_SOURCES = recode.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 26fab50d02e3e0ac38357a4b99c7be6fc71918bf..7d8960a34f69803371aab7f80e18b2c844ddea04 100644 (file)
@@ -11,7 +11,7 @@ EXTRA_INCLUDES = $(JAVA_INCLUDE)
 
 make_shared = yes
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
 
 php_java.jar : reflect.java
        @test -d net || mkdir net
index 26fab50d02e3e0ac38357a4b99c7be6fc71918bf..7d8960a34f69803371aab7f80e18b2c844ddea04 100644 (file)
@@ -11,7 +11,7 @@ EXTRA_INCLUDES = $(JAVA_INCLUDE)
 
 make_shared = yes
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
 
 php_java.jar : reflect.java
        @test -d net || mkdir net
index cda14be6da65f852f92af2d2983530f0f7472cd9..4893b1be1fcf58f1d49f4674cd0161a112c4bf37 100644 (file)
@@ -1,5 +1,7 @@
 
 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_LIBADD)
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 89017871aee1ab983840658948831175ad503348..8fdbcc4309c7432e1ff326dd863c7ee25ae47f64 100644 (file)
@@ -3,12 +3,12 @@ dnl $Id$
 PHP_ARG_WITH(mm,for mm support,
 [  --with-mm[=DIR]         Include mm support for session storage])
 
-PHP_ARG_ENABLE(session, whether to enable session support,
-[  --disable-session       Disable session support], yes)
-
 PHP_ARG_ENABLE(trans-sid,whether to enable transparent session id propagation,
 [  --enable-trans-sid      Enable transparent session id propagation])
 
+PHP_ARG_ENABLE(session, whether to enable session support,
+[  --disable-session       Disable session support], yes)
+
 if test "$PHP_MM" != "no"; then
   for i in /usr/local /usr $PHP_MM; do
     if test -f "$i/include/mm.h"; then
@@ -19,8 +19,13 @@ if test "$PHP_MM" != "no"; then
   if test -z "$MM_DIR" ; then
     AC_MSG_ERROR(cannot find mm library)
   fi
-
-  AC_ADD_LIBRARY_WITH_PATH(mm, $MM_DIR/lib)
+  
+  if test "$ext_shared" = "yes"; then
+    PHP_SUBST(SESSION_LIBADD)
+    SESSION_LIBADD="-R$MM_DIR/lib -L$MM_DIR/lib -lmm"
+  else
+    AC_ADD_LIBRARY_WITH_PATH(mm, $MM_DIR/lib)
+  fi
   AC_ADD_INCLUDE($MM_DIR/include)
   AC_DEFINE(HAVE_LIBMM, 1, [Whether you have libmm])
   PHP_MODULE_PTR(phpext_ps_mm_ptr)
@@ -30,6 +35,6 @@ if test "$PHP_TRANS_SID" = "yes"; then
   AC_DEFINE(TRANS_SID, 1, [Whether you want transparent session id propagation])
 fi
 
-if test "$PHP_SESSION" = "yes"; then
-  PHP_EXTENSION(session)
+if test "$PHP_SESSION" != "no"; then
+  PHP_EXTENSION(session,$ext_shared)
 fi
index 726310e69cc43b209e500c39ef5ca23cff51781d..2389584beb873a69e0868c8a4603dc788b57ae0f 100644 (file)
@@ -120,6 +120,10 @@ zend_module_entry session_module_entry = {
        STANDARD_MODULE_PROPERTIES
 };
 
+#ifdef COMPILE_DL_SESSION
+ZEND_DLEXPORT zend_module_entry *get_module(void) { return &session_module_entry; }
+#endif
+
 typedef struct {
        char *name;
        void (*func)(PSLS_D);
index a732d25b8b22e814f39278c4383fd7a2c0f220ec..d71ed95789c69db83b0623a5f3f6db7f36151e8d 100644 (file)
@@ -5,4 +5,4 @@ LTLIBRARY_SHARED_LIBADD = $(SNMP_LIBDIR) -lsnmp $(KSTAT_LIBS)
 
 EXTRA_INCLUDES = $(SNMP_INCLUDE)
        
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index e18866c0b4c49bcaabc999ab5855fb3611097713..221922f52cbe6c9de7ce09d1c822655006279745 100644 (file)
@@ -9,7 +9,7 @@ LTLIBRARY_SOURCES=\
        syslog.c type.c uniqid.c url.c url_scanner.c var.c output.c assert.c \
        strnatcmp.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
 
 parsedate.c: $(srcdir)/parsedate.y
 
index b15d1f694232a122fa984a8f820ac26c3764eb55..fbeaf882f459d7d36f28a4f7911494f355881e84 100644 (file)
@@ -1,5 +1,7 @@
 
 LTLIBRARY_NAME    = libswf.la
 LTLIBRARY_SOURCES = swf.c
+LTLIBRARY_SHARED_NAME   = swf.la
+LTLIBRARY_SHARED_LIBADD = $(SWF_SHARED_LIBADD)
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index cd728e6b243a1642552d59d786ec4227f97ba81f..117fe7c56803830c20364421492a67adbe0fffd3 100644 (file)
@@ -5,11 +5,11 @@ dnl This file is a modified version of config.m4
 dnl in php4/ext/mcrypt
 
 PHP_ARG_WITH(swf, for libswf support,
-[  --with-swf[=DIR]      Include swf support])
+[  --with-swf[=DIR]        Include swf support])
 
 if test "$PHP_SWF" != "no"; then
   for i in /usr/local /usr $PHP_SWF; do
-    if test -f $i/libswf.a; then
+    if test -r $i/libswf.a; then
       SWF_DIR=$i
     fi
   done
@@ -17,10 +17,16 @@ if test "$PHP_SWF" != "no"; then
   if test -z "$SWF_DIR"; then
     AC_MSG_ERROR(Please reinstall libswf.a - I cannot find libswf.a)
   fi
+
   AC_ADD_INCLUDE($SWF_DIR)
-  AC_ADD_LIBRARY_WITH_PATH(swf, $SWF_DIR)
 
+  if test "$ext_shared" = "yes"; then
+    SWF_SHARED_LIBADD="-R$SWF_DIR -L$SWF_DIR -lswf"
+    PHP_SUBST(SWF_SHARED_LIBADD)
+  else
+    AC_ADD_LIBRARY_WITH_PATH(swf, $SWF_DIR)
+  fi
   AC_DEFINE(HAVE_SWF,1,[ ])
 
-  PHP_EXTENSION(swf)
+  PHP_EXTENSION(swf, $ext_shared)
 fi
index f43dc8ef6e66647ce00bb2ed6325380154853bf5..96b9e2f8a253dcea496459281e02a420f31e689e 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef _PHP_SWF_H
 #define _PHP_SWF_H
 
-#if COMPILE_DL
+#ifdef COMPILE_DL_SWF
 #undef HAVE_SWF
 #define HAVE_SWF 1
 #endif
index 28150048c231643dd8385464510b4460991cbb43..560dd8442c8ac93d4c907060f7663578dcadee96 100644 (file)
@@ -106,6 +106,10 @@ zend_module_entry swf_module_entry = {
        STANDARD_MODULE_PROPERTIES
 };
 
+#ifdef COMPILE_DL_SWF
+ZEND_DLEXPORT zend_module_entry *get_module(void) { return &swf_module_entry; }
+#endif
+
 PHP_MINFO_FUNCTION(swf)
 {
        php_info_print_table_start();
@@ -1067,4 +1071,4 @@ PHP_FUNCTION(swf_posround)
 }
 /* }}} */
 
-#endif
\ No newline at end of file
+#endif
index 3b7437ab55ad735a1b24b39542b7d544b733828b..fd33146fe3596d7c08a2c1804b06a7233382c8d1 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libsybase.la
 LTLIBRARY_SOURCES = sybase.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 965741c79d6387a931f1966c5a6044c6b29368ec..4b495e4a855a413273c16def67c6ad7cca0de195 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libsybase_ct.la
 LTLIBRARY_SOURCES = php_sybase_ct.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 33a9bd541999057b581757f24fa556ba131bf5b3..b92500b47680eb950eb12791f13316035f3ddec3 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libsysvsem.la
 LTLIBRARY_SOURCES = sysvsem.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 599a11b1438e12974ef7268e41e05f6f7ac146d1..75e514c993a173ab443f02502e6f80b5c5b580b3 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libsysvshm.la
 LTLIBRARY_SOURCES = sysvshm.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 06865e6afa215bf71c567590c4914dc204da2d03..a5ec87c5fbf61d1f336dba4ad8c7181665104c9b 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libwddx.la
 LTLIBRARY_SOURCES = wddx.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index e6a97e7b240e6de1c5dce0cffa518d7703f06d4a..4a986da0c84c69cc695b4eb6e48d556d78020996 100644 (file)
@@ -7,4 +7,4 @@ LTLIBRARY_SHARED_LIBADD = $(XML_LIBS)
 
 SUBDIRS = expat
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index eb1e723273f1ba8bdb29825bebb9299cd86fa893..e48ec51592cc354393718bd508a5dfc6b5be089f 100644 (file)
@@ -12,25 +12,17 @@ else
   order=12
 fi
 
-AC_MSG_CHECKING(for XML support)
-AC_ARG_ENABLE(xml,
-[  --disable-xml           Disable XML support using bundled expat lib],[
-  PHP_XML=$enableval
-],[
-  PHP_XML=yes
-])
-AC_MSG_RESULT($PHP_XML)
+PHP_ARG_ENABLE(xml,for XML support,
+[  --disable-xml           Disable XML support using bundled expat lib], yes)
 
 if test "$PHP_XML" != "no"; then
   AC_DEFINE(HAVE_LIBEXPAT, 1, [ ])
   CPPFLAGS="$CPPFLAGS -DXML_BYTE_ORDER=$order"
-  if test "$PHP_XML" = "shared"; then
-    shared=yes
-  else
-    shared=
-  fi
-  PHP_EXTENSION(xml, $shared)
-  AC_ADD_INCLUDE(${ext_src_base}expat/xmltok)
-  AC_ADD_INCLUDE(${ext_src_base}expat/xmlparse)
-  PHP_FAST_OUTPUT(${ext_base}expat/Makefile ${ext_base}expat/xmlparse/Makefile ${ext_base}expat/xmltok/Makefile)
+  PHP_EXTENSION(xml, $ext_shared)
+  LIB_BUILD($ext_builddir/expat,$ext_shared,yes)
+  LIB_BUILD($ext_builddir/expat/xmlparse,$ext_shared,yes)
+  LIB_BUILD($ext_builddir/expat/xmltok,$ext_shared,yes)
+  AC_ADD_INCLUDE($ext_srcdir/expat/xmltok)
+  AC_ADD_INCLUDE($ext_srcdir/expat/xmlparse)
+  PHP_FAST_OUTPUT($ext_builddir/expat/Makefile $ext_builddir/expat/xmlparse/Makefile $ext_builddir/expat/xmltok/Makefile)
 fi
index ea7b11241753bc96ba6d91d6db6215a8830b42d4..6a109f1f98dacb1b6abaadf5b25e9324c807b1af 100644 (file)
@@ -5,4 +5,4 @@ LTLIBRARY_LIBADD        = $(LTLIBRARY_DEPENDENCIES)
 
 SUBDIRS = xmltok xmlparse
        
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 5275652913075d5239abf403015d38d596977af1..77df7598d07e965f18fd888eecbc94e6328b0a53 100644 (file)
@@ -4,4 +4,4 @@ LTLIBRARY_SOURCES       = xmlparse.c hashtable.c
 
 EXTRA_INCLUDES = -I$(srcdir)/../xmltok
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index f9f02c863f3478c8499db81bf80ff48579872c94..73d1cab428e288a3c296a60dafa6e7e000c8e206 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME          = libexpat_tok.la
 LTLIBRARY_SOURCES       = xmltok.c xmlrole.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 4fd1f482d3703faf96dc4742f24829d366299225..e7db81ffb592795b520751104c8bfe30521bd0e0 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libyp.la
 LTLIBRARY_SOURCES = yp.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk
index 62e7370a1fcb417fd94cf9993966075e6c101e4e..946ae5ce58544051eb63257aec22c04ab1670deb 100644 (file)
@@ -2,4 +2,4 @@
 LTLIBRARY_NAME    = libzlib.la
 LTLIBRARY_SOURCES = zlib.c
 
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/dynlib.mk