com php-src: Refactor AC_INIT in configure.ac and P HP versions: buildconf configure.ac scripts/phpize .m4 win32/build/confutils.js
| From: | Peter Kokot | Date: | Sun, 07 Apr 2019 03:52:14 +0000 |
| Subject: | com php-src: Refactor AC_INIT in configure.ac and P HP versions: buildconf configure.ac scripts/phpize .m4 win32/build/confutils.js | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-105548@lists.php.net to get a copy of this message | ||
Commit: afd52f9d9986d92dd0c63832a07ab1a16bf11d53
Author: Peter Kokot <peterkokot@gmail.com> Tue, 19 Mar 2019 23:49:26 +0100
Parents: 3eae4f677a604a547a1847a4fb0ba54e813c90c9
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=afd52f9d9986d92dd0c63832a07ab1a16bf11d53
Log:
Refactor AC_INIT in configure.ac and PHP versions
Since Autoconf 2.53 the AC_INIT call with only a single argument has
been made obsolete and now includes several other optional arguments to
make installation experience a bit better by providing program version
and links to the project in the
./configure -h output. This patch also
updates win build version. The phpize.m4 AC_INIT has been updated with
the call without arguments.
Changed paths:
M buildconf
M configure.ac
M scripts/phpize.m4
M win32/build/confutils.js
Diff:
diff --git a/buildconf b/buildconf
index 3248cd6..ad9febf 100755
--- a/buildconf
+++ b/buildconf
@@ -9,9 +9,9 @@ debug=0
# Go to project root.
cd $(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
-eval $(grep '^PHP_EXTRA_VERSION=' configure..ac)
-case "$PHP_EXTRA_VERSION" in
- *-dev)
+php_extra_version=$(grep '^AC_INIT(' configure.ac)
+case "$php_extra_version" in
+ *-dev*)
dev=1
;;
*)
diff --git a/configure.ac b/configure.ac
index 3e51518..6cce236 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,7 +8,8 @@ dnl Basic autoconf initialization, generation of config.nice.
dnl -------------------------------------------------------------------------
AC_PREREQ([2.68])
-AC_INIT([main/php_version.h])
+AC_INIT([PHP],[7.4.0-dev],[https://bugs.php.net],[php],[https://www.php.net])
+AC_CONFIG_SRCDIR([main/php_version.h])
AC_CONFIG_AUX_DIR([build])
AC_PRESERVE_HELP_ORDER
@@ -99,10 +100,13 @@ extern "C++" {
#endif /* PHP_CONFIG_H */
])
-PHP_MAJOR_VERSION=7
-PHP_MINOR_VERSION=4
-PHP_RELEASE_VERSION=0
-PHP_EXTRA_VERSION="-dev"
+ac_IFS=$IFS; IFS="."
+set $(echo AC_PACKAGE_VERSION | $SED 's/\([[0-9\.]]*\)\(.*\)/\1\.\2/')
+IFS=$ac_IFS
+PHP_MAJOR_VERSION=[$]1
+PHP_MINOR_VERSION=[$]2
+PHP_RELEASE_VERSION=[$]3
+PHP_EXTRA_VERSION=[$]4
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 +
[$]PHP_RELEASE_VERSION
diff --git a/scripts/phpize.m4 b/scripts/phpize.m4
index 9b89d1b..d3b471b 100644
--- a/scripts/phpize.m4
+++ b/scripts/phpize.m4
@@ -1,7 +1,8 @@
dnl This file becomes configure.ac for self-contained extensions.
AC_PREREQ([2..68])
-AC_INIT(config.m4)
+AC_INIT
+AC_CONFIG_SRCDIR([config.m4])
AC_CONFIG_AUX_DIR([build])
AC_PRESERVE_HELP_ORDER
diff --git a/win32/build/confutils.js b/win32/build/confutils.js
index f43572c..19a2504 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -105,24 +105,17 @@ var PHP_VERSION_STRING = "7.3.0";
function get_version_numbers()
{
var cin = file_get_contents("configure.ac");
+ var regex = /AC_INIT.+(\d+)\.(\d+)\.(\d+)([^\,^\]]*).+/g;
- if (cin.match(new RegExp("PHP_MAJOR_VERSION=(\\d+)"))) {
+ if (cin..match(new RegExp(regex))) {
PHP_VERSION = RegExp.$1;
+ PHP_MINOR_VERSION = RegExp.$2;
+ PHP_RELEASE_VERSION = RegExp.$3;
+ PHP_EXTRA_VERSION = RegExp.$4;
}
- if (cin.match(new RegExp("PHP_MINOR_VERSION=(\\d+)"))) {
- PHP_MINOR_VERSION = RegExp.$1;
- }
- if (cin.match(new RegExp("PHP_RELEASE_VERSION=(\\d+)"))) {
- PHP_RELEASE_VERSION = RegExp.$1;
- }
- PHP_VERSION_STRING = PHP_VERSION + "." + PHP_MINOR_VERSION + "." +
PHP_RELEASE_VERSION;
- if (cin.match(new RegExp("PHP_EXTRA_VERSION=\"([^\"]+)\""))) {
- PHP_EXTRA_VERSION = RegExp.$1;
- if (PHP_EXTRA_VERSION.length) {
- PHP_VERSION_STRING += PHP_EXTRA_VERSION;
- }
- }
+ PHP_VERSION_STRING = PHP_VERSION + "." + PHP_MINOR_VERSION + "." +
PHP_RELEASE_VERSION + PHP_EXTRA_VERSION;
+
DEFINE('PHP_VERSION_STRING', PHP_VERSION_STRING);
}