cvs: pear /CodeGen_PECL/PECL Extension.php
| From: | Hartmut Holzgraefe | Date: | Thu, 23 Mar 2006 00:42:26 +0000 |
| Subject: | cvs: pear /CodeGen_PECL/PECL Extension.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-39263@lists.php.net to get a copy of this message | ||
hholzgra Thu Mar 23 00:42:26 2006 UTC
Modified files:
/pear/CodeGen_PECL/PECL Extension.php
Log:
bailout with error if global header or lib entries exist but no
--with option by the default name (the extension name)
http://cvs.php.net/viewcvs.cgi/pear/CodeGen_PECL/PECL/Extension.php?r1=1.45&r2=1.46&diff_format=u
Index: pear/CodeGen_PECL/PECL/Extension.php
diff -u pear/CodeGen_PECL/PECL/Extension.php:1.45 pear/CodeGen_PECL/PECL/Extension.php:1.46
--- pear/CodeGen_PECL/PECL/Extension.php:1.45 Wed Mar 22 06:53:03 2006
+++ pear/CodeGen_PECL/PECL/Extension.php Thu Mar 23 00:42:25 2006
@@ -15,7 +15,7 @@
* @author Hartmut Holzgraefe <hartmut@php.net>
* @copyright 2005 Hartmut Holzgraefe
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: Extension.php,v 1.45 2006/03/22 06:53:03 hholzgra Exp $
+ * @version CVS: $Id: Extension.php,v 1.46 2006/03/23 00:42:25 hholzgra Exp $
* @link http://pear.php.net/package/CodeGen_PECL
*/
@@ -1598,9 +1598,14 @@
echo " export OLD_CPPFLAGS=\"\$CPPFLAGS\"\n";
echo " export CPPFLAGS=\"\$CPPFLAGS \$INCLUDES
-DHAVE_".strtoupper($this->name)."\"\n";
+ if (count($this->headers)) {
+ if (!isset($this->with[$this->name])) {
+ $this->terminate("global headers not bound to a --with option found and no
--with option by the default name");
+ }
- foreach($this->headers as $header) {
- echo $header->configm4($this->name, $this->name);
+ foreach($this->headers as $header) {
+ echo $header->configm4($this->name, $this->name);
+ }
}
foreach ($this->resources as $resource) {
@@ -1610,8 +1615,9 @@
echo " export CPPFLAGS=\"\$OLD_CPPFLAGS\"\n";
if (count($this->libs)) {
- $first = true;
-
+ if (!isset($this->with[$this->name])) {
+ $this->terminate("global libs not bound to a --with option found and no
--with option by the default name");
+ }
foreach ($this->libs as $lib) {
echo $lib->configm4($this->name, $this->name);
}
@@ -2340,6 +2346,26 @@
';
}
+
+
+ /**
+ * Show error message and bailout
+ *
+ * @param string error message
+ */
+ function terminate($msg)
+ {
+ while (@ob_end_clean()); // purge output buffers
+
+ $stderr = fopen("php://stderr", "w");
+ if ($stderr) {
+ fprintf($stderr, "%s\n", $msg);
+ fclose($stderr);
+ } else {
+ echo "$msg\n";
+ }
+ exit(3);
+ }
}