php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79841 Syntax error in configure / unescaped "[]" in php.m4
Submitted: 2020-07-13 06:44 UTC Modified: 2020-07-13 07:42 UTC
From: rainer dot jung at kippdata dot de Assigned: nikic (profile)
Status: Closed Package: *Compile Issues
PHP Version: 8.0.0alpha2 OS: Any using "configure"
Private report: No CVE-ID: None
 [2020-07-13 06:44 UTC] rainer dot jung at kippdata dot de
Description:
------------
"configure" warns:

./configure: line 5571: -z: command not found

The script contains wrong syntax:

 5571      -z "$php_bison_version"  && php_bison_version=0.0.0
...
 5676      -z "$php_re2c_version"  && php_re2c_version=0.0.0

The root cause is in file build/php.m4 introduced in commit https://github.com/php/php-src/commit/fe2afef36fc78c267133ddd403f48e0ee799efbc (#78750, GH-5681):

1787     [ -z "$php_bison_version" ] && php_bison_version=0.0.0
...
1852     [ -z "$php_re2c_version" ] && php_re2c_version=0.0.0

The square brackets need escaping in the m4 macro files. Directly below those lines a different syntax is used. Therefore I suggest to replace the two lines as follows:

    if test -z "$php_bison_version" ; then
      php_bison_version=0.0.0
    fi

and

    if test -z "$php_re2c_version" ; then
      php_re2c_version=0.0.0
    fi

Note that the problematic change also was back-ported to PHP 7.4 after 7.4.8 (https://github.com/php/php-src/pull/5681/commits/94c76e5e964aceb7e40fc6a15cf0ce247585c154). It should be fixed there as well before the next PHP 7.4 release.



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-07-13 07:41 UTC] nikic@php.net
Automatic comment on behalf of nikita.ppv@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=86e2b7bb70131b48636cded57e5bc62b81b79865
Log: Fixed bug #79841
 [2020-07-13 07:41 UTC] nikic@php.net
-Status: Open +Status: Closed
 [2020-07-13 07:42 UTC] nikic@php.net
-Assigned To: +Assigned To: nikic
 [2020-07-13 07:42 UTC] nikic@php.net
I've fixed this in master, but I'm not seeing any any autoconf code using [ -z ] on 7.4.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC