]> granicus.if.org Git - php/commitdiff
basic support for Intel Composer
authorAnatol Belski <ab@php.net>
Thu, 6 Nov 2014 22:04:53 +0000 (23:04 +0100)
committerAnatol Belski <ab@php.net>
Fri, 7 Nov 2014 09:18:01 +0000 (10:18 +0100)
win32/build/config.w32
win32/build/confutils.js

index c06ae509b7ab1aad2ee5c4ff4f12be3a39e179e1..7305b480dcaeadf9fa47c7f1096d09715053bfb0 100644 (file)
@@ -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);
 }
 
index 33fcf7ce7386df978922c7b4e0463b93951afbfc..da548225de3c87a26ef2da457f14c9c4e1cdb12f 100644 (file)
@@ -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");