Bug #78197 [Opn]: PCRE2 version check in `configure` fails for "##.##-xxx" version strings

From: Date: Sun, 23 Jun 2019 11:20:09 +0000
Subject: Bug #78197 [Opn]: PCRE2 version check in `configure` fails for "##.##-xxx" version strings
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-221456@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78197&edit=1

 ID:                 78197
 Updated by:         cmb@php.net
 Reported by:        pgnet dot dev at gmail dot com
 Summary:            PCRE2 version check in configure fails for
                     "##.##-xxx" version strings
 Status:             Open
 Type:               Bug
 Package:            Compile Failure
 Operating System:   linux64
 PHP Version:        7.3.6
 Block user comment: N
 Private report:     N

 New Comment:

Thanks!  The fix would go to config0.m4[1].  I'm not sure whether
we should apply the fix, though, since PHP 7.4 dropped support for
pcre2-config in favor of pkg-config which is already supported by
PHP 7.3.  So having a properly pgk-config would be necessary in
the near future anyway.

[1] <https://github.com/php/php-src/blob/php-7.3.6/ext/pcre/config0.m4#L38>


Previous Comments:
------------------------------------------------------------------------
[2019-06-22 18:38:45] pgnet dot dev at gmail dot com

Description:
------------
Building PHP 7.3 against PCRE2/git

	which pcre2-config
		/usr/local/bin/pcre2-config
	pcre2-config --version
		10.34-RC1

php configure fails

	...
	checking for PCRE2 10.30 or greater... ./configure: line 19557: test: 1034-RC1: integer expression
expected
	...

in 'configure',

           ...
           PCRE2_CONF=$PHP_PCRE_REGEX/bin/pcre2-config
             ...
             PCRE2_VER=$PCRE2_CONF --version
19557        if test "echo $PCRE2_VER | sed 's,\.,,g'" -lt 1030;
then
             ...

The problem's in the PCRE2 version string -- the configure step chokes on the "-RC1"
in its version test.

-	19557        if test "echo $PCRE2_VER | sed 's,\.,,g'" -lt 1030;
then
+	19557        if test "echo $PCRE2_VER | sed 's,-.*,,g' | sed
's,\.,,g'" -lt 1030; then


does the trick

	...
	checking for PCRE2 10.30 or greater... 10.34-RC1
	...



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=78197&edit=1


Thread (5 messages)

« previous php.bugs (#221456) next »