Skip to content

Commit f0fe4e0

Browse files
author
foobar
committed
- Added PHP_VERSION_ID == PHP_VERSION as integer value.
1 parent 0eb0282 commit f0fe4e0

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

configure.in

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ MAJOR_VERSION=6
4343
MINOR_VERSION=0
4444
RELEASE_VERSION=0
4545
EXTRA_VERSION="-dev"
46-
VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
46+
PHP_VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
47+
PHP_VERSION_ID=`expr [$]MAJOR_VERSION \* 10000 + [$]MINOR_VERSION \* 100 + [$]RELEASE_VERSION`
4748

4849
dnl Define where extension directories are located in the configure context
4950
AC_DEFUN([PHP_EXT_BUILDDIR],[ext/$1])dnl
@@ -54,14 +55,14 @@ AC_DEFUN([PHP_ALWAYS_SHARED],[])dnl
5455
dnl Setting up the PHP version based on the information above.
5556
dnl -------------------------------------------------------------------------
5657

57-
PHP_VERSION=$VERSION
5858
echo "/* automatically generated by configure */" > php_version.h.new
5959
echo "/* edit configure.in to change version number */" >> php_version.h.new
6060
echo "#define PHP_MAJOR_VERSION $MAJOR_VERSION" >> php_version.h.new
6161
echo "#define PHP_MINOR_VERSION $MINOR_VERSION" >> php_version.h.new
6262
echo "#define PHP_RELEASE_VERSION $RELEASE_VERSION" >> php_version.h.new
6363
echo "#define PHP_EXTRA_VERSION \"$EXTRA_VERSION\"" >> php_version.h.new
6464
echo "#define PHP_VERSION \"$PHP_VERSION\"" >> php_version.h.new
65+
echo "#define PHP_VERSION_ID \"$PHP_VERSION_ID\"" >> php_version.h.new
6566
cmp php_version.h.new $srcdir/main/php_version.h >/dev/null 2>&1
6667
if test $? -ne 0 ; then
6768
rm -f $srcdir/main/php_version.h && mv php_version.h.new $srcdir/main/php_version.h && \
@@ -1145,6 +1146,7 @@ PHP_SUBST(OVERALL_TARGET)
11451146
PHP_SUBST(PHP_RPATHS)
11461147
PHP_SUBST(PHP_SAPI)
11471148
PHP_SUBST_OLD(PHP_VERSION)
1149+
PHP_SUBST_OLD(PHP_VERSION_ID)
11481150
PHP_SUBST(SHELL)
11491151
PHP_SUBST(SHARED_LIBTOOL)
11501152
PHP_SUBST(WARNING_LEVEL)

main/php_version.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
#define PHP_RELEASE_VERSION 0
66
#define PHP_EXTRA_VERSION "-dev"
77
#define PHP_VERSION "6.0.0-dev"
8+
#define PHP_VERSION_ID "60000"

scripts/man1/php-config.1.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ Full path to php CLI/CGI binary
4343
.B \-\-version
4444
PHP version
4545
.TP
46+
.PD 0
47+
.B \-\-vernum
48+
PHP version as integer
49+
.TP
4650
.PD 1
4751
.P
4852
.SH SEE ALSO

scripts/php-config.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
prefix="@prefix@"
44
exec_prefix="@exec_prefix@"
55
version="@PHP_VERSION@"
6+
version_id="@PHP_VERSION_ID@"
67
includedir="@includedir@/php"
78
includes="-I$includedir -I$includedir/main -I$includedir/TSRM -I$includedir/Zend -I$includedir/ext -I$includedir/ext/date/lib"
89
ldflags="@PHP_LDFLAGS@"
@@ -30,8 +31,10 @@ case "$1" in
3031
echo $php_binary;;
3132
--version)
3233
echo $version;;
34+
--vernum)
35+
echo $version_id;;
3336
*)
34-
echo "Usage: $0 [--prefix|--includes|--ldflags|--libs|--extension-dir|--include-dir|--php-binary|--version]"
37+
echo "Usage: $0 [--prefix|--includes|--ldflags|--libs|--extension-dir|--include-dir|--php-binary|--version|--vernum]"
3538
exit 1;;
3639
esac
3740

0 commit comments

Comments
 (0)