I found out the hard way that phpize won't build some extensions like
ext/openssl because they have no config.m4, only a config0.m4. I could not
find a reason why this shouldn't work and propose the patch below for phpize
to support config0.m4 as well as config9.m4.

This will generate a standalone extension configure with all the same
extension options as a static builds. If extensions expressly rely on the
fact that phpize doesn't support these then we have a problem. I could not
find any historical discussion on the topic.

With this patch the following standard extensions can now be build via
phpize which couldn't before:

ext/libxml
ext/openssl
ext/pcre
ext/zlib

-lucas

Index: phpize.in
===================================================================
RCS file: /repository/php-src/scripts/phpize.in,v
retrieving revision 1.28.2.3.2.1
diff -u -r1.28.2.3.2.1 phpize.in
--- phpize.in   29 Jun 2007 01:10:35 -0000      1.28.2.3.2.1
+++ phpize.in   21 Jan 2008 10:40:52 -0000
@@ -28,7 +28,7 @@
     clean=" --clean"
   fi
 
-  echo "Cannot find config.m4. "
+  echo "Cannot find a config.m4."
   echo "Make sure that you run '$0$clean' in the top level source directory
of the module"
   echo 
 }
@@ -47,8 +47,8 @@
 
 phpize_check_configm4()
 {
-  if test ! -r config.m4; then
-     phpize_no_configm4 $@
+  if test ! -r config.m4 && test ! -r config0.m4 && test ! -r config9.m4;
then
+    phpize_no_configm4 $@
     exit 1
   fi
 
Index: phpize.m4
===================================================================
RCS file: /repository/php-src/scripts/phpize.m4,v
retrieving revision 1.17.2.3.2.5
diff -u -r1.17.2.3.2.5 phpize.m4
--- phpize.m4   14 Aug 2007 08:43:41 -0000      1.17.2.3.2.5
+++ phpize.m4   21 Jan 2008 10:40:52 -0000
@@ -3,7 +3,7 @@
 divert(1)
 
 AC_PREREQ(2.13)
-AC_INIT(config.m4)
+AC_INIT(configure.in)
 
 PHP_CONFIG_NICE(config.nice)
 
@@ -65,7 +65,9 @@
 PHP_PROG_RE2C
 PHP_PROG_AWK
     
+sinclude(config0.m4)
 sinclude(config.m4)
+sinclude(config9.m4)
 
 enable_static=no
 enable_shared=yes

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to