diff options
| author | Anatol Belski <ab@php.net> | 2016-11-18 18:21:28 +0100 |
|---|---|---|
| committer | Anatol Belski <ab@php.net> | 2016-11-18 18:21:28 +0100 |
| commit | 828f866e47808749e1033a76d99fa6ecb2d87a65 (patch) | |
| tree | 071dc40f9fdedcaf1bfeda48680cb7d3cc7affb5 /win32 | |
| parent | 6c53fe3413c3065430efee7f8ab97db3e1e86a73 (diff) | |
| parent | 5b9d7160c519a6d49a9d703a20c9c6104cd3b0bf (diff) | |
| download | php-git-828f866e47808749e1033a76d99fa6ecb2d87a65.tar.gz | |
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
don't fail miserably, when an unknown vc version is used
Diffstat (limited to 'win32')
| -rw-r--r-- | win32/build/confutils.js | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/win32/build/confutils.js b/win32/build/confutils.js index c0897b166c..d9fef5f996 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -2795,9 +2795,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; @@ -2917,8 +2928,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"'); |
