Source of: /manual/en/install.pecl.static.php
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/install.pecl.inc";
$setup = array (
'home' =>
array (
0 => 'index.php',
1 => 'PHP Manual',
),
'head' =>
array (
0 => 'UTF-8',
1 => 'en',
),
'this' =>
array (
0 => 'install.pecl.static.php',
1 => 'Compiling PECL extensions statically into PHP',
),
'up' =>
array (
0 => 'install.pecl.php',
1 => 'Installation of PECL extensions',
),
'prev' =>
array (
0 => 'install.pecl.phpize.php',
1 => 'Compiling shared PECL extensions with phpize',
),
'next' =>
array (
0 => 'install.problems.php',
1 => 'Problems?',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<div id="install.pecl.static" class="sect1">
<h2 class="title">Compiling PECL extensions statically into PHP</h2>
<p class="simpara">
You might find that you need to build a PECL extension statically into your
PHP binary. To do this, you'll need to place the extension source under
the <var class="filename">php-src/ext/</var> directory and tell the PHP build
system to regenerate its configure script.
</p>
<p class="para">
<div class="example-contents screen">
<div class="cdata"><pre>
$ cd /your/phpsrcdir/ext
$ pecl download extname
$ gzip -d < extname.tgz | tar -xvf -
$ mv extname-x.x.x extname
</pre></div>
</div>
</p>
<p class="simpara">
This will result in the following directory:
</p>
<p class="para">
<div class="example-contents screen"><br />
/your/phpsrcdir/ext/extname<br />
</div>
</p>
<p class="simpara">
From here, force PHP to rebuild the configure script, and then build PHP as normal:
</p>
<p class="para">
<div class="example-contents screen"><br />
$ cd /your/phpsrcdir <br />
$ rm configure<br />
$ ./buildconf --force<br />
$ ./configure --help<br />
$ ./configure --with-extname --enable-someotherext --with-foobar<br />
$ make<br />
$ make install<br />
</div>
</p>
<blockquote><p><b class="note">Note</b>:
<span class="simpara">
To run the 'buildconf' script you need autoconf 2.13 and automake 1.4+
(newer versions of autoconf may work, but are not supported).
</span>
</p></blockquote>
<p class="simpara">
Whether <i>--enable-extname</i> or <i>--with-extname
</i> is used depends on the extension. Typically an extension that
does not require external libraries uses <i>--enable</i>. To be
sure, run the following after buildconf:
</p>
<p class="para">
<div class="example-contents screen"><br />
$ ./configure --help | grep extname<br />
</div>
</p>
</div><?php manual_footer(); ?>