From: Anatol Belski Date: Thu, 6 Nov 2014 22:15:56 +0000 (+0100) Subject: fix x64 recognition for clang and icc X-Git-Tag: PRE_PHP7_REMOVALS~64 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac71c5812b9246edbae7c9fe8281c1186c1b9a4a;p=php fix x64 recognition for clang and icc --- diff --git a/win32/build/confutils.js b/win32/build/confutils.js index da548225de..c2bb4b0fbd 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -2361,16 +2361,17 @@ function toolset_get_compiler_name() function toolset_is_64() { if (VS_TOOLSET) { - return probe_binary(PHP_CL, 64, null, 'PHP_CL'); + return probe_binary(PHP_CL, 64); } else if (CLANG_TOOLSET) { - /* Seems to be impossible to get it from the clang binary, so lets use the normal cl.exe, - as clang should be running in VS environment. */ - var vs_cl = PATH_PROG('cl', null, 'PHP_CL') - return probe_binary(vs_cl, 64); + var command = 'cmd /c ""' + PHP_CL + '" -v"'; + var full = execute(command + '" 2>&1"'); + + return null != full.match(/x86_64/); } else if (INTEL_TOOLSET) { - /*seems the easiest way as well for now */ - var vs_cl = PATH_PROG('cl', null, 'PHP_CL') - return probe_binary(vs_cl, 64); + var command = 'cmd /c ""' + PHP_CL + '" -v"'; + var full = execute(command + '" 2>&1"'); + + return null != full.match(/Intel\(R\) 64/); } ERROR("Wrong toolset");