Skip to content

Commit 508fffe

Browse files
committed
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.
1 parent 8b94042 commit 508fffe

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

README.RELEASE_PROCESS

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ credits files in ext/standard.
6565

6666
4. Checkout the release branch for this release (e.g., PHP-5.4.2) from the main branch.
6767

68-
5. Bump the version numbers in ``main/php_version.h``, ``Zend/zend.h``, ``configure.ac`` and possibly ``NEWS``.
68+
5. Bump the version numbers in ``main/php_version.h``, ``Zend/zend.h``, ``configure.ac``, ``scripts/phpize.m4`` and possibly ``NEWS``.
6969
Do not use abbreviations for alpha and beta. Do not use dashes, you should
7070
``#define PHP_VERSION "5.4.22RC1"`` and not ``#define PHP_VERSION "5.4.22-RC1"``
7171

@@ -79,7 +79,7 @@ Do not use abbreviations for alpha and beta. Do not use dashes, you should
7979
9. Tag the repository release branch with the version, e.g.:
8080
``git tag -u YOURKEYID php-5.4.2RC2``
8181

82-
10. Bump the version numbers in ``main/php_version.h``, ``Zend/zend.h``, ``configure.ac`` and ``NEWS``
82+
10. Bump the version numbers in ``main/php_version.h``, ``Zend/zend.h``, ``configure.ac``, ``scripts/phpize.m4`` and ``NEWS``
8383
in the *main* branch (PHP-5.4 for example) to prepare for the **next** version.
8484
F.e. if the RC is "5.4.1RC1" then the new one should be "5.4.2-dev" - regardless if we get
8585
a new RC or not. This is to make sure ``version_compare()`` can correctly work.
@@ -162,7 +162,7 @@ Rolling a stable release
162162
------------------------
163163

164164
1. Checkout your release branch, you should have created when releasing previous RC
165-
and bump the version numbers in ``main/php_version.h``, ``Zend/zend.h``, ``configure.ac`` and possibly ``NEWS``.
165+
and bump the version numbers in ``main/php_version.h``, ``Zend/zend.h``, ``configure.ac``, ``scripts/phpize.m4`` and possibly ``NEWS``.
166166

167167
2. If a CVE commit needs to be merged to the release, then have it committed to
168168
the base branches and merged upwards as usual (f.e commit the CVE fix to 5.3,
@@ -336,7 +336,7 @@ Forking a new release branch
336336

337337
2. Just prior to cutting X.Y.0beta1, create the new branch locally.
338338
Add a commit on master after the branch point clearing the NEWS, UPGRADING
339-
and UPGRADING.INTERNALS files, updating the version in configure.ac (run
339+
and UPGRADING.INTERNALS files, updating the version in configure.ac and scripts/phpize.m4 (run
340340
./configure to automatically update main/php_versions.h, too) and Zend/zend.h.
341341
Also list the new branch in README.GIT-RULES.
342342
Example: http://git.php.net/?p=php-src.git;a=commit;h=a63c99b

buildconf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ debug=0
99
# Go to project root.
1010
cd $(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
1111

12-
eval $(grep '^PHP_EXTRA_VERSION=' configure.ac)
13-
case "$PHP_EXTRA_VERSION" in
14-
*-dev)
12+
php_extra_version=$(grep '^AC_INIT(\[' configure.ac)
13+
case "$php_extra_version" in
14+
*-dev*)
1515
dev=1
1616
;;
1717
*)

configure.ac

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ dnl Basic autoconf initialization, generation of config.nice.
88
dnl -------------------------------------------------------------------------
99

1010
AC_PREREQ([2.68])
11-
AC_INIT(README.GIT-RULES)
11+
AC_INIT([PHP], [7.4.0-dev], [https://bugs.php.net], [php], [https://php.net])
12+
AC_CONFIG_SRCDIR([main/php_version.h])
1213
AC_CONFIG_AUX_DIR([build])
1314
AC_PRESERVE_HELP_ORDER
1415

@@ -99,11 +100,15 @@ extern "C++" {
99100
#endif /* PHP_CONFIG_H */
100101
])
101102

102-
PHP_MAJOR_VERSION=7
103-
PHP_MINOR_VERSION=4
104-
PHP_RELEASE_VERSION=0
105-
PHP_EXTRA_VERSION="-dev"
106-
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
103+
PHP_VERSION=AC_PACKAGE_VERSION
104+
php_tmp_version=$(echo $PHP_VERSION | $SED 's/\([[0-9\.]]*\)\(.*\)/\1\.\2/')
105+
ac_IFS=$IFS; IFS="."
106+
set $php_tmp_version
107+
IFS=$ac_IFS
108+
PHP_MAJOR_VERSION=[$]1
109+
PHP_MINOR_VERSION=[$]2
110+
PHP_RELEASE_VERSION=[$]3
111+
PHP_EXTRA_VERSION=[$]4
107112
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
108113

109114
dnl Allow version values to be used in Makefile

scripts/phpize.m4

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
dnl This file becomes configure.ac for self-contained extensions.
22

33
AC_PREREQ([2.68])
4-
AC_INIT(config.m4)
4+
AC_INIT([PHP], [7.4.0-dev], [https://bugs.php.net], [php], [https://php.net])
5+
AC_CONFIG_SRCDIR([config.m4])
56
AC_CONFIG_AUX_DIR([build])
67
AC_PRESERVE_HELP_ORDER
78

0 commit comments

Comments
 (0)