[php-maint] Bug#542906: current version of autoconf makes php5 FTBFS

Russ Allbery rra at debian.org
Sat Aug 22 19:55:27 UTC 2009


tags 542906 patch
thanks

Andreas Barth <aba at not.so.argh.org> writes:

> php5 started to FTBFS with the versions of autoconf in testing and
> unstable. It builds correctly with the version of autoconf in stable.

> Please see
> https://buildd.debian.org/fetch.cgi?&pkg=php5&ver=5.2.10.dfsg.1-2%2Bb1&arch=i386&stamp=1250588329&file=log
> for the full buildlog.

> As I don't know if this is improper usage on side of php, or if autoconf
> broke expected functionality here, I'm reporting against both packages.

Definitely PHP's fault.  It's using divert in its Autoconf scripts and
clobbering all over the diversions used by Autoconf, resulting in a
configure script with huge hunks missing.  divert is a low-level M4
feature, and it's not safe (and has never really been safe) to play with
them behind Autoconf's back.

See the Autoconf manual:

|    To make diversion management easier, M4sugar uses the concept of
| named diversions.  Rather than using diversion numbers directly, it is
| nicer to associate a name with each diversion; the diversion number
| associated with a particular diversion name is an implementation
| detail, so you should only use diversion names.

[...]

|    For now, the named diversions of Autoconf and Autoheader, and the
| remaining diversions of Autotest, are not documented.  In other words,
| intentionally outputting text into an undocumented diversion is subject
| to breakage in a future release of Autoconf.

Furthermore, the diversions don't seem to be doing anything for PHP
anyway.  The following patch, which just comments out all the diversions
and moves an include below AC_INIT (this may not be needed, but it's good
form), seems to fix the problem.

--- php5-5.2.10.dfsg.1.orig/configure.in
+++ php5-5.2.10.dfsg.1/configure.in
@@ -1,7 +1,7 @@
 ## $Id: configure.in,v 1.579.2.52.2.139 2009/06/17 12:22:41 iliaa Exp $ -*- autoconf -*-
 dnl ## Process this file with autoconf to produce a configure script.
 
-divert(1)
+dnl divert(1)
 
 dnl ## Diversion 1 is the autoconf + automake setup phase. We also
 dnl ## set the PHP version, deal with platform-specific compile
@@ -23,16 +23,16 @@
 dnl ## All of these are normally in the extension directories.
 dnl ## Diversion 5 is the last one.  Here we generate files and clean up.
 
-dnl include Zend specific macro definitions first
-dnl -------------------------------------------------------------------------
-sinclude(Zend/acinclude.m4)
-
 dnl Basic autoconf + automake initialization, generation of config.nice.
 dnl -------------------------------------------------------------------------
 
 AC_PREREQ(2.13)
 AC_INIT(README.CVS-RULES)
 
+dnl include Zend specific macro definitions first
+dnl -------------------------------------------------------------------------
+sinclude(Zend/acinclude.m4)
+
 PHP_CONFIG_NICE(config.nice)
 
 PHP_CANONICAL_HOST_TARGET
@@ -264,7 +264,7 @@
 
 sinclude(main/suhosin_patch.m4)
 
-divert(2)
+dnl divert(2)
 
 dnl ## Diversion 2 is where we set PHP-specific options and come up
 dnl ## with reasonable default values for them. We check for pthreads here
@@ -303,7 +303,7 @@
   PTHREADS_FLAGS
 fi
 
-divert(3)
+dnl divert(3)
 
 dnl ## In diversion 3 we check for compile-time options to the PHP
 dnl ## core and how to deal with different system dependencies.
@@ -662,7 +662,7 @@
   PHP_CRYPT_R_STYLE
 fi
 
-divert(4)
+dnl divert(4)
 
 dnl ## In diversion 4 we check user-configurable general settings.
 
@@ -903,7 +903,7 @@
   AC_MSG_RESULT([using system default])
 fi
 
-divert(5)
+dnl divert(5)
 
 dnl ## In diversion 5 we check which extensions should be compiled.
 dnl ## All of these are normally in the extension directories.
--- php5-5.2.10.dfsg.1.orig/ext/standard/config.m4
+++ php5-5.2.10.dfsg.1/ext/standard/config.m4
@@ -1,6 +1,6 @@
 dnl $Id: config.m4,v 1.80.2.3.2.3 2007/07/11 11:56:03 jani Exp $ -*- autoconf -*-
 
-divert(3)dnl
+dnl divert(3)dnl
 
 dnl
 dnl Check if flush should be called explicitly after buffered io
@@ -205,7 +205,7 @@
 AC_CHECK_FUNCS(getcwd getwd asinh acosh atanh log1p hypot glob strfmon nice fpclass isinf isnan)
 AC_FUNC_FNMATCH	
 
-divert(5)dnl
+dnl divert(5)dnl
 
 dnl
 dnl Check for regex library type
--- php5-5.2.10.dfsg.1.orig/scripts/phpize.m4
+++ php5-5.2.10.dfsg.1/scripts/phpize.m4
@@ -1,6 +1,6 @@
 dnl This file becomes configure.in for self-contained extensions.
 
-divert(1)
+dnl divert(1)
 
 AC_PREREQ(2.13)
 AC_INIT(config.m4)

-- 
Russ Allbery (rra at debian.org)               <http://www.eyrie.org/~eagle/>





More information about the pkg-php-maint mailing list