@@ -8,7 +8,9 @@ if test "$PHP_V8" != "no"; then
8
8
SEARCH_PATH="/usr/local /usr"
9
9
SEARCH_FOR="include/v8.h"
10
10
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;}'`
12
14
13
15
# Path where v8 from packages we recommend are installed, it's /opt/libv8-MAJOR.MINOR on Ubuntu
14
16
# and /usr/local/opt/v8@MAJOR.MINOR on macOS
@@ -105,22 +107,15 @@ if test "$PHP_V8" != "no"; then
105
107
] , [ ac_cv_v8_version=`cat ./conftestval|awk '{print $1 }'`] , [ ac_cv_v8_version=NONE] , [ ac_cv_v8_version=NONE] )
106
108
] )
107
109
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;}'`
109
111
110
112
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
121
116
AC_MSG_ERROR ( [ libv8 must be version $V8_MIN_API_VERSION_STR or greater] )
122
117
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 , [ ] )
124
119
AC_DEFINE_UNQUOTED ( [ PHP_V8_LIBV8_VERSION] , "$ac_cv_v8_version" , [ ] )
125
120
else
126
121
AC_MSG_ERROR ( [ could not determine libv8 version] )
@@ -132,13 +127,14 @@ if test "$PHP_V8" != "no"; then
132
127
# php/Zend/zend_operators.h:128:18: warning: 'finite' is deprecated: first deprecated in macOS 10.9 [-Wdeprecated-declarations]
133
128
# but as we want to track also deprecated methods from v8 we won't ignore -Wdeprecated-declarations warnings
134
129
# 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"
137
132
138
133
AC_DEFINE ( [ V8_DEPRECATION_WARNINGS] , [ 1] , [ Enable compiler warnings when using V8_DEPRECATED apis.] )
139
134
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.] )
140
135
141
136
AC_LANG_RESTORE
137
+ LIBS=$old_LIBS
142
138
# LDFLAGS=$old_LDFLAGS # we have to links some libraries
143
139
CPPFLAGS=$old_CPPFLAGS
144
140
@@ -222,7 +218,7 @@ if test "$PHP_V8" != "no"; then
222
218
src/php_v8_named_property_handler_configuration.cc \
223
219
src/php_v8_indexed_property_handler_configuration.cc \
224
220
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)
226
222
227
223
PHP_ADD_BUILD_DIR($ext_builddir/src)
228
224
0 commit comments