build-modules: builds and copies dynamic modules into
install-cli: installs the CLI only, so that the install-sapi target does only what its name says
It became more and more apparent that there is a severe need for addressing the portability concerns and improving the chance that your build is correct (how often have you been told to
make clean? When this is done, you won’t need to anymore).
You, as a user of PHP, will notice no changes. Of course, the build system will be faster, look better and work smarter.
Makefile.ins are abandoned. The files which are to be compiled are specified in the
config.m4 now using the following macro:
E.g. this enables the extension foo which consists of three source-code modules, two in C and one in C++. And, depending on the user’s wishes, the extension will even be built as a dynamic module.
The full syntax:
Please have a look at
build/php.m4 for the gory details and meanings of the other parameters.
And that’s basically it for the extension side.
If you previously built sub-libraries for this module, add the source-code files here as well. If you need to specify separate include directories, do it this way:
E.g. this builds the three files which are located relative to the extension source directory and compiles all three files with the special include directive (
@ext_srcdir@ is automatically replaced).
Now, you need to tell the build system that you want to build files in a directory called
Make sure to call this after
$ext_builddir is only set by the latter.
If you have a complex extension, you might to need add special Make rules. You can do this by calling
PHP_ADD_MAKEFILE_FRAGMENT in your
This will read a file in the source-dir of your extension called
Makefile.frag. In this file,
$(srcdir) will be replaced by the values which are correct for your extension and which are again determined by the
Make sure to prefix all relative paths correctly with either
$(srcdir). Because the build system does not change the working directory anymore, we must use either absolute paths or relative ones to the top build-directory. Correct prefixing ensures that.
Instead of using
PHP_SAPI=foo/PHP_BUILD_XYZ, you will need to type
I.e. specify the source-code files as above and also pass the information regarding how PHP is supposed to be built (shared module, program, etc).
For example for APXS:
The foundation for the new system is the flexible handling of sources and their contexts. With the help of macros you can define special flags for each source-file, where it is located, in which target context it can work, etc.
Have a look at the well documented macros