Skip to content
This repository was archived by the owner on Mar 29, 2024. It is now read-only.

Commit 015d5a6

Browse files
committed
Update version num check in config script
1 parent 4e51e77 commit 015d5a6

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

config.m4

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ if test "$PHP_V8" != "no"; then
88
SEARCH_PATH="/usr/local /usr"
99
SEARCH_FOR="include/v8.h"
1010

11-
DESIRED_V8_VERSION=5.7
11+
V8_MIN_API_VERSION_STR=5.7.202
12+
13+
DESIRED_V8_VERSION=`echo "${V8_MIN_API_VERSION_STR}" | $AWK 'BEGIN { FS = "."; } { printf "%s.%s", [$]1, [$]2;}'`
1214

1315
# Path where v8 from packages we recommend are installed, it's /opt/libv8-MAJOR.MINOR on Ubuntu
1416
# and /usr/local/opt/v8@MAJOR.MINOR on macOS
@@ -105,22 +107,15 @@ if test "$PHP_V8" != "no"; then
105107
], [ac_cv_v8_version=`cat ./conftestval|awk '{print $1}'`], [ac_cv_v8_version=NONE], [ac_cv_v8_version=NONE])
106108
])
107109

108-
V8_MIN_API_VERSION_STR=5.7.202
110+
V8_MIN_API_VERSION_NUM=`echo "${V8_MIN_API_VERSION_STR}" | $AWK 'BEGIN { FS = "."; } { printf "%d", [$]1 * 1000000 + [$]2 * 1000 + [$]3;}'`
109111

110112
if test "$ac_cv_v8_version" != "NONE"; then
111-
ac_IFS=$IFS
112-
IFS=.
113-
set $ac_cv_v8_version
114-
IFS=$ac_IFS
115-
V8_API_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3`
116-
IFS=.
117-
set $V8_MIN_API_VERSION_STR
118-
IFS=$ac_IFS
119-
V8_MIN_API_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3`
120-
if test "$V8_API_VERSION" -lt $V8_MIN_API_VERSION ; then
113+
V8_API_VERSION_NUM=`echo "${ac_cv_v8_version}" | $AWK 'BEGIN { FS = "."; } { printf "%d", [$]1 * 1000000 + [$]2 * 1000 + [$]3;}'`
114+
115+
if test "$V8_API_VERSION_NUM" -lt "$V8_MIN_API_VERSION_NUM" ; then
121116
AC_MSG_ERROR([libv8 must be version $V8_MIN_API_VERSION_STR or greater])
122117
fi
123-
AC_DEFINE_UNQUOTED([PHP_V8_LIBV8_API_VERSION], $V8_API_VERSION, [ ])
118+
AC_DEFINE_UNQUOTED([PHP_V8_LIBV8_API_VERSION], $V8_API_VERSION_NUM, [ ])
124119
AC_DEFINE_UNQUOTED([PHP_V8_LIBV8_VERSION], "$ac_cv_v8_version", [ ])
125120
else
126121
AC_MSG_ERROR([could not determine libv8 version])
@@ -132,13 +127,14 @@ if test "$PHP_V8" != "no"; then
132127
# php/Zend/zend_operators.h:128:18: warning: 'finite' is deprecated: first deprecated in macOS 10.9 [-Wdeprecated-declarations]
133128
# but as we want to track also deprecated methods from v8 we won't ignore -Wdeprecated-declarations warnings
134129
# We want to make building log cleaner, so let's suppress only -Wdeprecated-register warning
135-
ac_cv_suppress_register_warnings_flag="-Wno-deprecated-register"
136-
#ac_cv_suppress_register_warnings_flag="-Wno-deprecated-register -Wno-deprecated-declarations"
130+
PHP_V8_COMPILER_OPTIONS="-Wno-deprecated-register"
131+
#PHP_V8_COMPILER_OPTIONS="-Wno-deprecated-register -Wno-deprecated-declarations"
137132

138133
AC_DEFINE([V8_DEPRECATION_WARNINGS], [1], [Enable compiler warnings when using V8_DEPRECATED apis.])
139134
AC_DEFINE([V8_IMMINENT_DEPRECATION_WARNINGS], [1], [Enable compiler warnings to make it easier to see what v8 apis will be deprecated (V8_DEPRECATED) soon.])
140135

141136
AC_LANG_RESTORE
137+
LIBS=$old_LIBS
142138
#LDFLAGS=$old_LDFLAGS # we have to links some libraries
143139
CPPFLAGS=$old_CPPFLAGS
144140

@@ -222,7 +218,7 @@ if test "$PHP_V8" != "no"; then
222218
src/php_v8_named_property_handler_configuration.cc \
223219
src/php_v8_indexed_property_handler_configuration.cc \
224220
src/php_v8_access_type.cc \
225-
], $ext_shared, , "$ac_cv_suppress_register_warnings_flag -std="$ac_cv_v8_cstd -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
221+
], $ext_shared, , "$PHP_V8_COMPILER_OPTIONS -std="$ac_cv_v8_cstd -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
226222

227223
PHP_ADD_BUILD_DIR($ext_builddir/src)
228224

0 commit comments

Comments
 (0)