File: configuration-macros.xml

package info (click to toggle)
php-doc 20100521-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 59,992 kB
  • ctags: 4,085
  • sloc: xml: 796,833; php: 21,338; cpp: 500; sh: 117; makefile: 58; awk: 28
file content (105 lines) | stat: -rw-r--r-- 4,815 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?xml version="1.0" encoding="utf-8"?>
 <!-- $Revision: 297078 $ -->
 <sect2 xml:id="internals2.ze1.zendapi.configuration-macros" xmlns="http://docbook.org/ns/docbook"> 
  <title>Reference: Some Configuration Macros</title> 
  <sect3 xml:id="internals2.ze1.zendapi.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="internals2.ze1.zendapi.tab.m4-macros"/>.
   </para>
   <table xml:id="internals2.ze1.zendapi.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> 
  </sect3> 
 </sect2>
<!-- 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:"~/.phpdoc/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
-->