<?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 => 'zh',
  ),
  'this' => 
  array (
    0 => 'install.pecl.static.php',
    1 => '将 PECL 扩展库静态编译入 PHP',
    2 => '将 PECL 扩展库静态编译入 PHP',
  ),
  'up' => 
  array (
    0 => 'install.pecl.php',
    1 => 'PECL 扩展安装',
  ),
  'prev' => 
  array (
    0 => 'install.pecl.php-config.php',
    1 => 'php-config',
  ),
  'next' => 
  array (
    0 => 'install.composer.intro.php',
    1 => 'Composer 简介',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    '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">将 PECL 扩展库静态编译入 PHP</h2>
  <p class="simpara">
   可能需要将扩展库静态编译到 PHP 中。这需要将扩展库源码放入
   <var class="filename">/path/to/php/src/dir/ext/</var> 目录中，去使用 PHP
   编译系统来重新生成其 configure 脚本。
  </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">
   这将产生以下目录：
  </p>
  <div class="example-contents screen">
<div class="cdata"><pre>
/path/to/php/src/dir/ext/extname
</pre></div>
  </div>
  <p class="simpara">
   此时 PHP 需要强制重新生成配置脚本，然后正常编译 PHP：
  </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">注意</strong>: 
   <span class="simpara">
    要运行 <strong class="command">buildconf</strong> 脚本，需要 <strong class="command">autoconf</strong>
    <code class="literal">2.68</code> 和 <strong class="command">automake</strong>
    <code class="literal">1.4+</code>。更高版本的
    <strong class="command">autoconf</strong> 也许能工作，但不被支持。
   </span>
  </p></blockquote>
  <p class="simpara">
   是否用 <strong class="option configure">--enable-extname</strong> 或 <strong class="option configure">--with-extname</strong>
   取决于扩展库。通常不需要外部库文件的扩展库使用
   <strong class="option configure">--enable</strong>。当然，在 <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); ?>