<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = 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 => 'it',
  ),
  'this' => 
  array (
    0 => 'install.pecl.static.php',
    1 => 'Compiling PECL extensions statically into PHP',
    2 => 'Compiling PECL extensions statically into PHP',
  ),
  'up' => 
  array (
    0 => 'install.pecl.php',
    1 => 'Installation of PECL extensions',
  ),
  'prev' => 
  array (
    0 => 'install.pecl.php-config.php',
    1 => 'php-config',
  ),
  'next' => 
  array (
    0 => 'install.composer.intro.php',
    1 => 'Introduzione a Composer',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'install/pecl.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="install.pecl.static" class="sect1">
  <h2 class="title">Compiling PECL extensions statically into PHP</h2>
  <p class="simpara">
   It may be necessary to build a PECL extension statically into the PHP binary.
   To do this, the extension source will need to be placed under the
   <var class="filename">/path/to/php/src/dir/ext/</var>
   directory, and the PHP build system will be required to regenerate its
   configure script.
  </p>
  <p class="para">
   <div class="example-contents screen">
<div class="cdata"><pre>
$ cd /path/to/php/src/dir/ext
$ pecl download extname
$ gzip -d &lt; 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>
  <div class="example-contents screen">
<div class="cdata"><pre>
/path/to/php/src/dir/ext/extname
</pre></div>
  </div>
  <p class="simpara">
   From here, PHP needs to be forced to rebuild the configure script, and then
   it can be built as normal:
  </p>
  <div class="example-contents screen">
<div class="cdata"><pre>
$ cd /path/to/php/src/dir
$ rm configure
$ ./buildconf --force
$ ./configure --help
$ ./configure --with-extname --enable-someotherext --with-foobar
$ make
$ make install
</pre></div>
  </div>
  <blockquote class="note"><p><strong class="note">Nota</strong>: 
   <span class="simpara">
    To run the <strong class="command">buildconf</strong> script, the
    <strong class="command">autoconf</strong>
    <code class="literal">2.68</code>
    and
    <strong class="command">automake</strong>
    <code class="literal">1.4+</code>
    will be needed.
    Newer versions of <strong class="command">autoconf</strong> may work but are not
    supported.
   </span>
  </p></blockquote>
  <p class="simpara">
   Whether
   <strong class="option configure">--enable-extname</strong>
   or
   <strong class="option configure">--with-extname</strong>
   is used depends on the extension.
   Typically, an extension that does not require external libraries uses
   <strong class="option configure">--enable</strong>.
   To be sure, run the following after <strong class="command">buildconf</strong>:
  </p>
  <div class="example-contents screen">
<div class="cdata"><pre>
$ ./configure --help | grep extname
</pre></div>
  </div>
 </div><?php manual_footer($setup); ?>