|
|
|
|
| Tutorial |
302 Chapter 9 Extending PHP 4.0: Hacking the Core of PHP
Listing 9.1 The default Makefile.in.
# $Id: Extending_Zend.xml,v 1.22 2000/05/22 20:02:58 till Exp $
LTLIBRARY_NAME = libmy_module.la
LTLIBRARY_SOURCES = my_module.c
LTLIBRARY_SHARED_NAME = my_module.la
include $(top_srcdir)/build/dynlib.mk
There’s not much to tell about this one: It contains the names of the input and output
files.You could also specify build instructions for other files if your module is built
from multiple source files.
The default config.m4 shown in Listing 9.2 is a bit more complex:
Listing 9.2 The default config.m4.
dnl $Id: Extending_Zend.xml,v 1.22 2000/05/22 20:02:58 till Exp $
dnl config.m4 for extension my_module
dnl don’t forget to call PHP_EXTENSION(my_module)
dnl If your extension references something external, use with:
PHP_ARG_WITH(my_module, for my_module support,
dnl Make sure that the comment is aligned:
[ --with-my_module Include my_module support])
dnl Otherwise use enable:
PHP_ARG_ENABLE(my_module, whether to enable my_module support,
dnl Make sure that the comment is aligned:
[ --enable-my_module Enable my_module support])
if test “$PHP_MY_MODULE” != “no”; then
dnl Action..
PHP_EXTENSION(my_module, $ext_shared)
fi
If you’re unfamiliar with M4 files (now is certainly a good time to get familiar), this
might be a bit confusing at first; but it’s actually quite easy.
Note: Everything prefixed with dnl is treated as a comment and is not parsed.
The config.m4 file is responsible for parsing the command-line options passed to
configure at configuration time.This means that it has to check for required external
files and do similar configuration and setup tasks.
|
|
|
|
|
|
| Link Partners: Asia florist, Flowers to India, Hong kong flowers, Site submit, Cheap web hosting, China florist, Japan florist |
|