summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2016-11-18 18:21:49 +0100
committerAnatol Belski <ab@php.net>2016-11-18 18:21:49 +0100
commit019bf13a062b21de9a49be42250f07b4382edbbc (patch)
treee54f62f63fe3b8b5053ac267e600361c25eb6a33
parent8b597eb03eb9d1ea75222c8f48cb0a11c83593da (diff)
parent828f866e47808749e1033a76d99fa6ecb2d87a65 (diff)
downloadphp-git-019bf13a062b21de9a49be42250f07b4382edbbc.tar.gz
Merge branch 'PHP-7.1'
* PHP-7.1: don't fail miserably, when an unknown vc version is used
-rw-r--r--win32/build/confutils.js26
1 files changed, 22 insertions, 4 deletions
diff --git a/win32/build/confutils.js b/win32/build/confutils.js
index 8b3e420b28..3042e1f13f 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -2817,9 +2817,20 @@ function toolset_setup_compiler()
ERROR("Unsupported MS C++ Compiler, VC11 (2011) minimum is required");
}
- AC_DEFINE('COMPILER', COMPILER_NAME, "Detected compiler version");
- DEFINE("PHP_COMPILER_SHORT", VC_VERSIONS_SHORT[VCVERS]);
- AC_DEFINE('PHP_COMPILER_ID', VC_VERSIONS_SHORT[VCVERS], "Compiler compatibility ID");
+ if (undefined == COMPILER_NAME) {
+ var tmp = probe_binary(PHP_CL);
+ COMPILER_NAME = "MSVC " + tmp + ", untested";
+
+ WARNING("Using unknown MSVC version " + tmp);
+
+ AC_DEFINE('COMPILER', COMPILER_NAME, "Detected compiler version");
+ DEFINE("PHP_COMPILER_SHORT", tmp);
+ AC_DEFINE('PHP_COMPILER_ID', tmp, "Compiler compatibility ID");
+ } else {
+ AC_DEFINE('COMPILER', COMPILER_NAME, "Detected compiler version");
+ DEFINE("PHP_COMPILER_SHORT", VC_VERSIONS_SHORT[VCVERS]);
+ AC_DEFINE('PHP_COMPILER_ID', VC_VERSIONS_SHORT[VCVERS], "Compiler compatibility ID");
+ }
} else if (CLANG_TOOLSET) {
CLANGVERS = COMPILER_NUMERIC_VERSION;
@@ -2939,8 +2950,15 @@ function toolset_get_compiler_name()
var version;
if (VS_TOOLSET) {
+ var name = undefined;
+
version = probe_binary(PHP_CL).substr(0, 5).replace('.', '');
- return VC_VERSIONS[version];
+
+ if (undefined != VC_VERSIONS[version]) {
+ name = VC_VERSIONS[version];
+ }
+
+ return name;
} else if (CLANG_TOOLSET || ICC_TOOLSET) {
var command = 'cmd /c ""' + PHP_CL + '" -v"';
var full = execute(command + '" 2>&1"');