[PHP4BETA] new build procedure

From: Date: Sat, 17 Apr 1999 17:22:02 +0000
Subject: [PHP4BETA] new build procedure
Groups: php.version4 
Request: Send a blank email to php-version4+get-153@lists.php.net to get a copy of this message
It was a bit late last night, I forgot to mail you the new build procedure. First of all, to build stuff from scratch, you need to have both autoconf and automake installed. Automake is used to generate makefiles for the extensions. The steps: ./scripts/preconfig automake --add-missing # only need this option the first time aclocal autoconf ./configure --enable-debug --with-apache=../apache_1.3.6 Libzend is integrated into the build process now, so there is no need to run configure or make in the libzend directory, it all happens automatically. To make a new extension (or move one from functions/), create a directory for it in ext. This directory should contain the following: config.m4: Contains this extension's part of configure.in. For an extension that only needs the standard AC_ARG_WITH or AC_ARG_ENABLE functions, they can be included directly. However, configure.in is has five parts, called diversions. The first, divert(0) runs configure in subdirectories, divert(1) does standard header file/library and environment checks, divert(2) contains compile-time options to PHP itself, divert(3) contains extension-specific options, and divert(4) generates output files and cleans up. By default, everything in config.m4 ends up in divert(3). But if you need to do something in one of the others, you must specify where the stubs go. Example: divert(3) dnl extension options AC_ARG_WITH(foobar, .....) divert(4) if test "$BINNAME" = "php"; then echo "Warning: the foobar extension really sucks with the CGI version" fi Finally, and this is the most important thing, if an extension is to be compiled at all, you need to call PHP_EXTENSION(NN) in config.m4, where NN is the extension name (name of ext/ subdir). See the config.m4 files in ext/standard and ext/gd for more examples. setup.stub: Will be sourced from the top-level setup script, so put the "define_option" call for this extension in this file. See ext/gd/setup.stub. Makefile.am: Automake's Makefile template. Must contain: INCLUDES=@INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend noinst_LIBRARIES=libphpext_NN.a libphpext_NN_a_SOURCES=NN.c where NN is the extension name. To add more source files, just add them to libphp_NN_a_SOURCES. Finally, it's useful to include a .cvsignore file: .deps Makefile.in Makefile Right now, the hooks in internal_functions.c are not generated automatically, that is the next step (if you don't have GD, you have to comment out GD's line in that file right now). - Stig -- PHP 4 Beta

« previous php.version4 (#153) next »