summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2006-07-27 08:53:16 +0000
committerfoobar <sniper@php.net>2006-07-27 08:53:16 +0000
commit7625313f9c2e62b8b46adaeedbdc247ad3c8c90c (patch)
tree564bb6c7004a8497be3bdd0521cdd4aa3dacabb5
parentee97ffd887441557db8aa3cb8d78c02c07274755 (diff)
downloadphp-git-7625313f9c2e62b8b46adaeedbdc247ad3c8c90c.tar.gz
MFH: - Added PHP_VERSION_ID == PHP_VERSION as integer.
-rw-r--r--configure.in6
-rw-r--r--main/php_version.h1
-rw-r--r--scripts/man1/php-config.1.in4
-rw-r--r--scripts/php-config.in5
4 files changed, 13 insertions, 3 deletions
diff --git a/configure.in b/configure.in
index d826e1eadc..685b875cf0 100644
--- a/configure.in
+++ b/configure.in
@@ -45,7 +45,8 @@ MAJOR_VERSION=5
MINOR_VERSION=2
RELEASE_VERSION=0
EXTRA_VERSION="RC2-dev"
-VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
+PHP_VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
+PHP_VERSION_ID=`expr [$]MAJOR_VERSION \* 10000 + [$]MINOR_VERSION \* 100 + [$]RELEASE_VERSION`
dnl Define where extension directories are located in the configure context
AC_DEFUN([PHP_EXT_BUILDDIR],[ext/$1])dnl
@@ -56,7 +57,6 @@ AC_DEFUN([PHP_ALWAYS_SHARED],[])dnl
dnl Setting up the PHP version based on the information above.
dnl -------------------------------------------------------------------------
-PHP_VERSION=$VERSION
echo "/* automatically generated by configure */" > php_version.h.new
echo "/* edit configure.in to change version number */" >> php_version.h.new
echo "#define PHP_MAJOR_VERSION $MAJOR_VERSION" >> php_version.h.new
@@ -64,6 +64,7 @@ echo "#define PHP_MINOR_VERSION $MINOR_VERSION" >> php_version.h.new
echo "#define PHP_RELEASE_VERSION $RELEASE_VERSION" >> php_version.h.new
echo "#define PHP_EXTRA_VERSION \"$EXTRA_VERSION\"" >> php_version.h.new
echo "#define PHP_VERSION \"$PHP_VERSION\"" >> php_version.h.new
+echo "#define PHP_VERSION_ID $PHP_VERSION_ID" >> php_version.h.new
cmp php_version.h.new $srcdir/main/php_version.h >/dev/null 2>&1
if test $? -ne 0 ; then
rm -f $srcdir/main/php_version.h && mv php_version.h.new $srcdir/main/php_version.h && \
@@ -1196,6 +1197,7 @@ PHP_SUBST(OVERALL_TARGET)
PHP_SUBST(PHP_RPATHS)
PHP_SUBST(PHP_SAPI)
PHP_SUBST_OLD(PHP_VERSION)
+PHP_SUBST_OLD(PHP_VERSION_ID)
PHP_SUBST(SHELL)
PHP_SUBST(SHARED_LIBTOOL)
PHP_SUBST(WARNING_LEVEL)
diff --git a/main/php_version.h b/main/php_version.h
index f1d078a3d5..0529097dc3 100644
--- a/main/php_version.h
+++ b/main/php_version.h
@@ -5,3 +5,4 @@
#define PHP_RELEASE_VERSION 0
#define PHP_EXTRA_VERSION "RC2-dev"
#define PHP_VERSION "5.2.0RC2-dev"
+#define PHP_VERSION_ID 50200
diff --git a/scripts/man1/php-config.1.in b/scripts/man1/php-config.1.in
index 78d2b4b1fd..9355b4bc29 100644
--- a/scripts/man1/php-config.1.in
+++ b/scripts/man1/php-config.1.in
@@ -43,6 +43,10 @@ Full path to php CLI/CGI binary
.B \-\-version
PHP version
.TP
+.PD 0
+.B \-\-vernum
+PHP version as integer
+.TP
.PD 1
.P
.SH SEE ALSO
diff --git a/scripts/php-config.in b/scripts/php-config.in
index b53facbdbc..7937779b13 100644
--- a/scripts/php-config.in
+++ b/scripts/php-config.in
@@ -3,6 +3,7 @@
prefix="@prefix@"
exec_prefix="@exec_prefix@"
version="@PHP_VERSION@"
+version_id="@PHP_VERSION_ID@"
includedir="@includedir@/php"
includes="-I$includedir -I$includedir/main -I$includedir/TSRM -I$includedir/Zend -I$includedir/ext -I$includedir/ext/date/lib"
ldflags="@PHP_LDFLAGS@"
@@ -30,8 +31,10 @@ case "$1" in
echo $php_binary;;
--version)
echo $version;;
+--vernum)
+ echo $version_id;;
*)
- echo "Usage: $0 [--prefix|--includes|--ldflags|--libs|--extension-dir|--include-dir|--php-binary|--version]"
+ echo "Usage: $0 [--prefix|--includes|--ldflags|--libs|--extension-dir|--include-dir|--php-binary|--version|--vernum]"
exit 1;;
esac