diff options
author | Sascha Schumann <sas@php.net> | 2000-05-01 02:42:55 +0000 |
---|---|---|
committer | Sascha Schumann <sas@php.net> | 2000-05-01 02:42:55 +0000 |
commit | a481fddfb363d13ed28036bf94974c968197ca2b (patch) | |
tree | a22e7dd88d624ee9c6cec95a3a3090cf37e098bc /dynlib.m4 | |
parent | ce38236221274ba91b33f694e619ecf7c3f04ce5 (diff) | |
download | php-git-a481fddfb363d13ed28036bf94974c968197ca2b.tar.gz |
Improved in-tree shared libraries build system
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.
Diffstat (limited to 'dynlib.m4')
-rw-r--r-- | dynlib.m4 | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/dynlib.m4 b/dynlib.m4 new file mode 100644 index 0000000000..fb3c70a701 --- /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 +]) |