2013-09-26 15:23:32 +00:00
|
|
|
|
|
|
|
ARG_WITH("v8js", "for V8 Javascript Engine", "no");
|
|
|
|
|
2016-03-08 21:48:09 +00:00
|
|
|
function v8js_zeroPad(num, places) {
|
|
|
|
var zero = places - num.toString().length + 1;
|
|
|
|
return Array(+(zero > 0 && zero)).join("0") + num;
|
|
|
|
}
|
|
|
|
|
2013-09-26 15:23:32 +00:00
|
|
|
if (PHP_V8JS != "no") {
|
2016-11-16 11:23:54 +00:00
|
|
|
if (CHECK_LIB("winmm.lib", "v8js") &&
|
2013-09-26 15:23:32 +00:00
|
|
|
CHECK_HEADER_ADD_INCLUDE("v8.h", "CFLAGS_V8JS")) {
|
|
|
|
|
2013-09-28 19:42:03 +00:00
|
|
|
ADD_FLAG("CFLAGS_V8JS", "/EHcs");
|
|
|
|
ADD_FLAG("CFLAGS_V8JS", "/D _ALLOW_KEYWORD_MACROS");
|
2014-11-12 23:24:39 +00:00
|
|
|
ADD_FLAG("CFLAGS_V8JS", "/D __STDC_LIMIT_MACROS");
|
2013-09-28 00:02:49 +00:00
|
|
|
|
2016-03-08 21:14:52 +00:00
|
|
|
// defaults
|
2018-11-06 12:20:30 +00:00
|
|
|
var v8major = 7;
|
|
|
|
var v8minor = 0;
|
|
|
|
var v8build = 276;
|
|
|
|
var v8patch = 11;
|
2016-03-08 21:14:52 +00:00
|
|
|
var v8pinc = search_paths("v8-version.h", php_usual_include_suspects, null);
|
|
|
|
if (typeof(v8pinc) == "string") {
|
|
|
|
var v8versionh = file_get_contents(v8pinc + '\\v8-version.h');
|
|
|
|
if (v8versionh.match(/#define V8_MAJOR_VERSION ([0-9]*)/i)) {
|
|
|
|
v8major = RegExp.$1;
|
|
|
|
}
|
|
|
|
if (v8versionh.match(/#define V8_MINOR_VERSION ([0-9]*)/i)) {
|
|
|
|
v8minor = RegExp.$1;
|
|
|
|
}
|
|
|
|
if (v8versionh.match(/#define V8_BUILD_NUMBER ([0-9]*)/i)) {
|
|
|
|
v8build = RegExp.$1;
|
|
|
|
}
|
|
|
|
if (v8versionh.match(/#define V8_PATCH_LEVEL ([0-9]*)/i)) {
|
|
|
|
v8patch = RegExp.$1;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
WARNING("Could not parse v8-version.h");
|
|
|
|
}
|
2016-03-09 10:42:14 +00:00
|
|
|
|
|
|
|
var v8api = v8major + v8js_zeroPad(v8minor, 3) + v8js_zeroPad(v8build, 3);
|
|
|
|
var v8ver = v8major + "." + v8minor + "." + v8build + "." + v8patch;
|
|
|
|
|
2017-02-02 00:28:51 +00:00
|
|
|
if (v8api >= 5005000) {
|
|
|
|
CHECK_LIB("v8.dll.lib", "v8js");
|
|
|
|
CHECK_LIB("v8_libplatform.dll.lib", "v8js");
|
|
|
|
CHECK_LIB("v8_libbase.dll.lib", "v8js");
|
|
|
|
ADD_FLAG("CFLAGS_V8JS", "/D BUILDING_V8_PLATFORM_SHARED");
|
|
|
|
// #define _STRING_ to disable #include <string> in v8-platform.h and avoid
|
|
|
|
// C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\string(671):
|
|
|
|
// error C2143: syntax error: missing ';' before 'namespace'
|
|
|
|
// (compiling source file ext\v8js\v8js_v8.cc)
|
|
|
|
ADD_FLAG("CFLAGS_V8JS", "/D _STRING_");
|
|
|
|
} else if (v8api >= 5002000) {
|
2016-11-16 11:23:54 +00:00
|
|
|
CHECK_LIB("v8.dll.lib", "v8js");
|
|
|
|
// created by 'cd obj\v8_libplatform && lib /out:v8_libplatform.lib *.obj'
|
|
|
|
CHECK_LIB("v8_libplatform.lib", "v8js");
|
|
|
|
// created by 'cd obj\v8_libbase && lib /out:v8_libbase.lib *.obj'
|
|
|
|
CHECK_LIB("v8_libbase.lib", "v8js");
|
|
|
|
} else {
|
|
|
|
CHECK_LIB("v8.lib", "v8js");
|
|
|
|
CHECK_LIB("v8_libplatform.lib", "v8js");
|
|
|
|
CHECK_LIB("v8_libbase.lib", "v8js");
|
|
|
|
}
|
2016-11-17 10:18:01 +00:00
|
|
|
if (v8api >= 5003000) {
|
|
|
|
// For SymLoadModule64 e.a.
|
|
|
|
// #include <dbghelp.h> in src\base\win32-headers.h
|
|
|
|
// Adds dependency on dbghelp.dll
|
|
|
|
CHECK_LIB("dbghelp.lib", "v8js");
|
|
|
|
}
|
|
|
|
if (v8api >= 5004000) {
|
|
|
|
// For PathRemoveFileSpecW in v8_libbase.lib(stack_trace_win)
|
|
|
|
CHECK_LIB("Shlwapi.lib", "v8js");
|
|
|
|
}
|
2016-11-16 11:23:54 +00:00
|
|
|
|
2016-03-08 21:14:52 +00:00
|
|
|
AC_DEFINE("PHP_V8_API_VERSION", v8api, "", false);
|
|
|
|
AC_DEFINE("PHP_V8_VERSION", v8ver, "", true);
|
2013-09-28 00:02:49 +00:00
|
|
|
|
2017-04-22 09:37:34 +00:00
|
|
|
// AC_DEFINE("PHP_V8_EXEC_PATH", "C:\\php\\bin\\v8.dll", "", true);
|
|
|
|
|
2017-03-12 16:26:39 +00:00
|
|
|
EXTENSION("v8js", "v8js_array_access.cc v8js_class.cc v8js_commonjs.cc v8js_convert.cc v8js_exceptions.cc v8js_generator_export.cc v8js_main.cc v8js_methods.cc v8js_object_export.cc v8js_timer.cc v8js_v8.cc v8js_v8object_class.cc v8js_variables.cc", "yes");
|
2017-09-11 01:34:13 +00:00
|
|
|
ADD_FLAG("CFLAGS_BD_EXT_V8JS", "/D ZEND_WIN32_KEEP_INLINE=1 /U ZEND_WIN32_FORCE_INLINE");
|
2013-09-26 15:23:32 +00:00
|
|
|
|
|
|
|
} else {
|
|
|
|
WARNING("v8js not enabled, headers or libs not found");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|