Permalink
Browse files

Please welcome the new build system.

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
  • Loading branch information...
1 parent 0e17eea commit 9d9d39a0de3bec962c343051011f5a2ed7d7b242 Sascha Schumann committed Mar 7, 2002
Showing with 796 additions and 1,010 deletions.
  1. +16 −0 Makefile.frag
  2. +71 −0 Makefile.global
  3. +0 −63 Makefile.in
  4. +12 −32 README.SELF-CONTAINED-EXTENSIONS
  5. +4 −0 TODO.BUILDv5
  6. +236 −62 acinclude.m4
  7. +0 −34 build/bsd_makefile
  8. +6 −24 build/build2.mk
  9. +0 −24 build/dynlib.mk
  10. +0 −80 build/fastgen.sh
  11. +0 −23 build/library.mk
  12. +0 −24 build/ltlib.mk
  13. +177 −106 build/shtool
  14. +0 −34 build/sysv_makefile
  15. +74 −44 configure.in
  16. +0 −88 dynlib.m4
  17. +0 −11 ext/bcmath/Makefile.in
  18. +7 −4 ext/bcmath/config.m4
  19. +0 −9 ext/bcmath/libbcmath/Makefile.in
  20. +0 −7 ext/bcmath/libbcmath/src/Makefile.in
  21. +1 −1 ext/domxml/config.m4
  22. +1 −15 ext/ext_skel
  23. +10 −0 ext/informix/Makefile.frag
  24. +19 −8 ext/mysql/config.m4
  25. +0 −2 ext/mysql/libmysql/mysql.m4
  26. +3 −9 ext/pcre/config.m4
  27. +3 −9 ext/pcre/config0.m4
  28. +6 −3 ext/pdf/config.m4
  29. +8 −8 ext/rpc/xmlrpc/config.m4
  30. +0 −2 ext/rpc/xmlrpc/libxmlrpc/xmlrpc.m4
  31. +0 −7 ext/session/Makefile.in
  32. +1 −1 ext/session/config.m4
  33. +8 −0 ext/standard/Makefile.frag
  34. +0 −22 ext/standard/Makefile.in
  35. +11 −1 ext/standard/config.m4
  36. +6 −17 ext/xml/config.m4
  37. +8 −8 ext/xmlrpc/config.m4
  38. +0 −2 ext/xmlrpc/libxmlrpc/xmlrpc.m4
  39. +16 −25 pear/{Makefile.in → Makefile.frag}
  40. +15 −7 pear/pear.m4
  41. +2 −4 pear/scripts/phpize.in
  42. +0 −4 sapi/Makefile.in
  43. +0 −17 sapi/README
  44. +0 −5 sapi/aolserver/Makefile.in
  45. +1 −2 sapi/aolserver/config.m4
  46. +0 −7 sapi/apache/Makefile.in
  47. +6 −8 sapi/apache/config.m4
  48. +0 −7 sapi/apache2filter/Makefile.in
  49. +1 −2 sapi/apache2filter/config.m4
  50. +0 −5 sapi/caudium/Makefile.in
  51. +1 −2 sapi/caudium/config.m4
  52. +0 −5 sapi/cgi/Makefile.in
  53. +1 −4 sapi/cgi/config.m4
  54. +0 −28 sapi/cli/Makefile.in
  55. +2 −1 sapi/cli/config.m4
  56. +0 −5 sapi/fastcgi/Makefile.in
  57. +1 −1 sapi/fastcgi/config.m4
  58. +0 −5 sapi/isapi/Makefile.in
  59. +1 −2 sapi/isapi/config.m4
  60. +0 −5 sapi/nsapi/Makefile.in
  61. +1 −2 sapi/nsapi/config.m4
  62. +0 −5 sapi/phttpd/Makefile.in
  63. +1 −2 sapi/phttpd/config.m4
  64. +0 −5 sapi/pi3web/Makefile.in
  65. +1 −2 sapi/pi3web/config.m4
  66. +0 −5 sapi/roxen/Makefile.in
  67. +1 −2 sapi/roxen/config.m4
  68. +19 −0 sapi/servlet/Makefile.frag
  69. +0 −30 sapi/servlet/Makefile.in
  70. +3 −1 sapi/servlet/config.m4
  71. +0 −5 sapi/thttpd/Makefile.in
  72. +1 −2 sapi/thttpd/config.m4
  73. +0 −5 sapi/tux/Makefile.in
  74. +1 −2 sapi/tux/config.m4
  75. +0 −5 sapi/webjames/Makefile.in
  76. +1 −2 sapi/webjames/config.m4
  77. +32 −0 scan_makefile_in.awk
View
@@ -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
View
@@ -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:
View
@@ -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:
@@ -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)
View
@@ -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
Oops, something went wrong.

0 comments on commit 9d9d39a

Please sign in to comment.