From: Anatol Belski Date: Thu, 6 Nov 2014 22:04:53 +0000 (+0100) Subject: basic support for Intel Composer X-Git-Tag: PRE_PHP7_REMOVALS~65 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cd2aa28a7d1d7049f48b66084f629d6b1552128e;p=php basic support for Intel Composer --- diff --git a/win32/build/config.w32 b/win32/build/config.w32 index c06ae509b7..7305b480dc 100644 --- a/win32/build/config.w32 +++ b/win32/build/config.w32 @@ -3,11 +3,15 @@ // "Master" config file; think of it as a configure.in // equivalent. -ARG_WITH("toolset", "Toolset to use for the compilation, supported: vs, clang", "vs"); +ARG_WITH("toolset", "Toolset to use for the compilation, supported: vs, clang, intel", "vs"); if ("clang" == PHP_TOOLSET) { VS_TOOLSET = false; CLANG_TOOLSET = true; INTEL_TOOLSET = false; +} else if ("intel" == PHP_TOOLSET) { + VS_TOOLSET = false; + CLANG_TOOLSET = false; + INTEL_TOOLSET = true; } else { /* Visual Studio is the default toolset. */ PHP_TOOLSET = "no" == PHP_TOOLSET ? "vs" : PHP_TOOLSET; @@ -56,8 +60,11 @@ if (VS_TOOLSET) { AC_DEFINE('PHP_COMPILER_ID', "clang"); /* XXX something better were to write here */ } else if (INTEL_TOOLSET) { - //INTELVERS = compiler_ver; - // .... + INTELVERS = COMPILER_NUMERIC_VERSION; + + AC_DEFINE('COMPILER', COMPILER_NAME, "Detected compiler version"); + DEFINE("PHP_COMPILER_SHORT", "icc"); + AC_DEFINE('PHP_COMPILER_ID', "icc"); /* XXX something better were to write here */ } STDOUT.WriteLine(" Detected compiler " + COMPILER_NAME); @@ -427,7 +434,7 @@ ADD_SOURCES("win32", "inet.c fnmatch.c sockets.c"); if (VS_TOOLSET && VCVERS <= 1300) { ADD_SOURCES("win32", "strtoi64.c"); } -if (VS_TOOLSET && VCVERS >= 1400) { +if (VS_TOOLSET && VCVERS >= 1400 || INTEL_TOOLSET) { AC_DEFINE('HAVE_STRNLEN', 1); } diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 33fcf7ce73..da548225de 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -2328,7 +2328,7 @@ function toolset_get_compiler_version() var command = 'cmd /c ""' + PHP_CL + '" -v"'; var full = execute(command + '" 2>&1"'); - if (full.match(/Version (\d\.\d\.\d)/)) { + if (full.match(/Version (\d+\.\d+\.\d+)/)) { version = RegExp.$1; version = version.replace(/\./g, ''); version = version/100 < 1 ? version*10 : version; @@ -2337,7 +2337,7 @@ function toolset_get_compiler_version() } } - ERROR("Wrong toolset"); + ERROR("Failed to parse compiler out for compiler version"); } function toolset_get_compiler_name() @@ -2368,7 +2368,9 @@ function toolset_is_64() var vs_cl = PATH_PROG('cl', null, 'PHP_CL') return probe_binary(vs_cl, 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); } ERROR("Wrong toolset");