forked from phpv8/v8js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.w32
58 lines (47 loc) · 1.94 KB
/
config.w32
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
ARG_WITH("v8js", "for V8 Javascript Engine", "no");
function v8js_zeroPad(num, places) {
var zero = places - num.toString().length + 1;
return Array(+(zero > 0 && zero)).join("0") + num;
}
if (PHP_V8JS != "no") {
if (CHECK_LIB("v8_libplatform.lib", "v8js") &&
CHECK_LIB("v8_libbase.lib", "v8js") &&
CHECK_LIB("winmm.lib", "v8js") &&
CHECK_LIB("v8.lib", "v8js") &&
CHECK_HEADER_ADD_INCLUDE("v8.h", "CFLAGS_V8JS")) {
ADD_FLAG("CFLAGS_V8JS", "/EHcs");
ADD_FLAG("CFLAGS_V8JS", "/D _ALLOW_KEYWORD_MACROS");
ADD_FLAG("CFLAGS_V8JS", "/D ZEND_WIN32_FORCE_INLINE");
ADD_FLAG("CFLAGS_V8JS", "/D __STDC_LIMIT_MACROS");
// defaults
var v8major = 4;
var v8minor = 7;
var v8build = 75;
var v8patch = 0;
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");
}
var v8api = v8major + v8js_zeroPad(v8minor, 3) + v8js_zeroPad(v8build, 3);
var v8ver = v8major + "." + v8minor + "." + v8build + "." + v8patch;
AC_DEFINE("PHP_V8_API_VERSION", v8api, "", false);
AC_DEFINE("PHP_V8_VERSION", v8ver, "", true);
EXTENSION("v8js", "v8js_array_access.cc v8js.cc v8js_class.cc v8js_commonjs.cc v8js_convert.cc v8js_exceptions.cc v8js_generator_export.cc v8js_methods.cc v8js_object_export.cc v8js_timer.cc v8js_v8.cc v8js_v8object_class.cc v8js_variables.cc", "yes");
} else {
WARNING("v8js not enabled, headers or libs not found");
}
}