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

Commit 2d12144

Browse files
committed
Require V8 >= 5.4.420
1 parent f980e3a commit 2d12144

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

config.m4

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ if test "$PHP_V8" != "no"; then
101101
AC_LANG_SAVE
102102
AC_LANG_CPLUSPLUS
103103

104-
104+
# NOTE: it is possible to get version string from headers with simple regexp match
105105
AC_CACHE_CHECK(for V8 version, ac_cv_v8_version, [
106106
AC_TRY_RUN([
107107
#include <v8.h>
@@ -123,14 +123,20 @@ if test "$PHP_V8" != "no"; then
123123
], [ac_cv_v8_version=`cat ./conftestval|awk '{print $1}'`], [ac_cv_v8_version=NONE], [ac_cv_v8_version=NONE])
124124
])
125125

126+
V8_MIN_API_VERSION_STR=5.4.420
127+
126128
if test "$ac_cv_v8_version" != "NONE"; then
127129
ac_IFS=$IFS
128130
IFS=.
129131
set $ac_cv_v8_version
130132
IFS=$ac_IFS
131133
V8_API_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3`
132-
if test "$V8_API_VERSION" -lt 501000 ; then
133-
AC_MSG_ERROR([libv8 must be version 5.1.0 or greater])
134+
IFS=.
135+
set $V8_MIN_API_VERSION_STR
136+
IFS=$ac_IFS
137+
V8_MIN_API_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3`
138+
if test "$V8_API_VERSION" -lt $V8_MIN_API_VERSION ; then
139+
AC_MSG_ERROR([libv8 must be version $V8_MIN_API_VERSION_STR or greater])
134140
fi
135141
AC_DEFINE_UNQUOTED([PHP_V8_LIBV8_API_VERSION], $V8_API_VERSION, [ ])
136142
AC_DEFINE_UNQUOTED([PHP_V8_LIBV8_VERSION], "$ac_cv_v8_version", [ ])

0 commit comments

Comments
 (0)