php-doc-en/internals/zendapi/configuration-macros.xml
Gabor Hojtsy 811a7db395 New internals documentation section added:
- PHP 3 development appendix moved to this part
 - Streams API docs moved to this part
 - ZendAPI docs with figures integrated in this part

More info: http://news.php.net/php.doc/969369673


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@194089 c90b9560-bf6c-de11-be94-00142212c4b1
2005-08-21 16:27:09 +00:00

105 lines
4.6 KiB
XML

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- $Revision: 1.1 $ -->
<sect1 id="zend.configuration-macros">
<title>Reference: Some Configuration Macros</title>
<sect2 id="zend.configuration-macros.config-m4">
<title><filename>config.m4</filename></title>
<para>
The file <filename>config.m4</filename> is processed by
<filename>buildconf</filename> and must contain all the instructions to be
executed during configuration. For example, these can include tests for required
external files, such as header files, libraries, and so on. PHP defines a set of macros
that can be used in this process, the most useful of which are described in
<xref linkend='tab.m4-macros'/>.
</para>
<table id='tab.m4-macros'>
<title>M4 Macros for <filename>config.m4</filename></title>
<tgroup cols="2">
<colspec colnum="1" colname="col1" colwidth="1.63*"/>
<colspec colnum="2" colname="col2" colwidth="1.00*"/>
<tbody>
<row>
<entry colname="col1">Macro</entry>
<entry colname="col2">Description</entry>
</row>
<row>
<entry colname="col1"><literal>AC_MSG_CHECKING(message)</literal></entry>
<entry colname="col2">Prints a "checking &lt;message&gt;" text
during <filename>configure</filename>.</entry>
</row>
<row>
<entry colname="col1"><literal>AC_MSG_RESULT(value)</literal></entry>
<entry colname="col2">Gives the result to <literal>AC_MSG_CHECKING</literal>;
should specify either <literal>yes</literal> or <literal>no</literal> as <envar>value</envar>.</entry>
</row>
<row>
<entry colname="col1"><literal>AC_MSG_ERROR(message)</literal></entry>
<entry colname="col2">Prints <envar>message</envar> as error message
during <filename>configure</filename> and aborts the script.</entry>
</row>
<row>
<entry colname="col1"><literal>AC_DEFINE(name,value,description)</literal></entry>
<entry colname="col2">Adds
<literal>#define</literal> to <filename>php_config.h</filename> with the value of
<envar>value</envar> and a comment that says <envar>description</envar> (this
is useful for conditional compilation of your module).</entry>
</row>
<row>
<entry colname="col1"><literal>AC_ADD_INCLUDE(path)</literal></entry>
<entry colname="col2">Adds a compiler include path; for example, used if the
module needs to add search paths for header files.</entry>
</row>
<row>
<entry colname="col1"><literal>AC_ADD_LIBRARY_WITH_PATH(libraryname,librarypath)</literal></entry>
<entry colname="col2">Specifies an additional library to link.</entry>
</row>
<row>
<entry colname="col1"><literal>AC_ARG_WITH(modulename,description,unconditionaltest,conditionaltest)</literal></entry>
<entry colname="col2">Quite a powerful macro, adding the
module with <envar>description</envar> to the
<filename>configure --help</filename> output. PHP checks
whether the option
<literal>--with-&lt;modulename&gt;</literal> is given to the
<filename>configure</filename> script. If so, it runs the
script <literal>unconditionaltest</literal> (for example,
<literal>--with-myext=yes</literal>), in which case the value
of the option is contained in the variable
<envar>$withval</envar>. Otherwise, it executes
<literal>conditionaltest</literal>.
</entry>
</row>
<row>
<entry colname="col1"><literal>PHP_EXTENSION(modulename,
[shared])</literal></entry>
<entry colname="col2">This macro is a <emphasis>must</emphasis> to call for PHP
to configure your extension. You can supply a second argument
in addition to your module name, indicating whether you intend compilation as a
shared module. This will result in a definition at compile time for your
source as <literal>COMPILE_DL_&lt;modulename&gt;</literal>.</entry>
</row>
</tbody>
</tgroup>
</table>
</sect2>
</sect1>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->