| 1 | # Intel Compiler (on Windows, using the Microsoft Standard Library) |
|---|
| 2 | |
|---|
| 3 | # (C) Copyright David Abrahams 2001. |
|---|
| 4 | # Distributed under the Boost Software License, Version 1.0. |
|---|
| 5 | # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) |
|---|
| 6 | |
|---|
| 7 | # The following #// line will be used by the regression test table generation |
|---|
| 8 | # program as the column heading for HTML tables. Must not include version number. |
|---|
| 9 | #//<a href="http://developer.intel.com/software/products/compilers/">Intel<br>C++</a> |
|---|
| 10 | |
|---|
| 11 | # singleton variables... |
|---|
| 12 | set-as-singleton INTELC ; |
|---|
| 13 | |
|---|
| 14 | # compute INTEL tool path. You can either use the environment variable |
|---|
| 15 | # setup that comes with the Intel compiler, or you can set the |
|---|
| 16 | # INTEL_PATH or INTELC (in order to respect FTJam setup) environment |
|---|
| 17 | # variables to point at the intel-win32 installation directory |
|---|
| 18 | INTEL_PATH ?= $(INTELC) ; |
|---|
| 19 | INTEL_TOOL_PATH ?= "$(INTEL_PATH)"\\bin\\ ; |
|---|
| 20 | |
|---|
| 21 | # if you have vc6 and vc7 installed, you may want your intel compiler |
|---|
| 22 | # to use the VC7 libraries. In that case, you might set |
|---|
| 23 | # INTEL_BASE_MSVC_TOOLSET = vc7 |
|---|
| 24 | # instead. |
|---|
| 25 | |
|---|
| 26 | INTEL_BASE_MSVC_TOOLSET ?= msvc ; |
|---|
| 27 | |
|---|
| 28 | extends-toolset $(INTEL_BASE_MSVC_TOOLSET) ; |
|---|
| 29 | |
|---|
| 30 | VC_TOOL_PATH = $(INTEL_TOOL_PATH) ; |
|---|
| 31 | VC_STDLIB_PATH = "$(INTEL_PATH)"\\bin ; |
|---|
| 32 | VC_COMPILER = icl ; |
|---|
| 33 | VC_LINKER = xilink ; |
|---|
| 34 | |
|---|
| 35 | # Extract the compiler version from its installation path |
|---|
| 36 | local version = $(INTEL_VERSION) ; |
|---|
| 37 | # Syntax < 9 |
|---|
| 38 | version ?= [ MATCH .*[\\/][Cc][Oo][Mm][Pp][Ii][Ll][Ee][Rr]([0-9])[0-9][\\/].* : $(INTEL_TOOL_PATH) ] ; |
|---|
| 39 | # Syntax >= 9.0 |
|---|
| 40 | version ?= [ MATCH .*[\\/][Cc][\+][\+][\\/]([0-9])\.[0-9][\\/].* : $(INTEL_TOOL_PATH) ] ; |
|---|
| 41 | |
|---|
| 42 | # Reduce the number of spurious error messages |
|---|
| 43 | C++FLAGS += /Qwn5 /Qwd985 ; |
|---|
| 44 | |
|---|
| 45 | # Detect illegal conversions in this program: |
|---|
| 46 | # |
|---|
| 47 | # # include <vector> |
|---|
| 48 | # # include <algorithm> |
|---|
| 49 | # int main() |
|---|
| 50 | # { |
|---|
| 51 | # char* a[20]; |
|---|
| 52 | # std::vector<int> v(20); |
|---|
| 53 | # std::copy(v.begin(), v.end(), a); |
|---|
| 54 | # return 0; |
|---|
| 55 | # } |
|---|
| 56 | C++FLAGS += /Qwe556 ; |
|---|
| 57 | |
|---|
| 58 | # Enable ADL |
|---|
| 59 | C++FLAGS += -Qoption,c,--arg_dep_lookup ; #"c" works for C++, too |
|---|
| 60 | |
|---|
| 61 | if $(version) <= 5 |
|---|
| 62 | { |
|---|
| 63 | # remove options unrecognized by Intel5 |
|---|
| 64 | C++FLAGS = [ difference $(C++FLAGS) : /Zc:wchar_t,forScope ] ; |
|---|
| 65 | } |
|---|
| 66 | else |
|---|
| 67 | { |
|---|
| 68 | C++FLAGS += /Zc:forScope ; # Add support for correct for loop scoping |
|---|
| 69 | } |
|---|
| 70 | |
|---|
| 71 | # Add options recognized only by intel7 |
|---|
| 72 | if $(version) >= 7 |
|---|
| 73 | { |
|---|
| 74 | C++FLAGS += /Qansi_alias ; |
|---|
| 75 | } |
|---|
| 76 | |
|---|
| 77 | # tell the compiler about the base toolset. |
|---|
| 78 | if [ MATCH (vc-7_1).* : $(INTEL_BASE_MSVC_TOOLSET) ] |
|---|
| 79 | { |
|---|
| 80 | C++FLAGS += /Qvc7.1 ; |
|---|
| 81 | } |
|---|
| 82 | else if [ MATCH (vc7).* : $(INTEL_BASE_MSVC_TOOLSET) ] |
|---|
| 83 | { |
|---|
| 84 | C++FLAGS += /Qvc7 ; |
|---|
| 85 | } |
|---|
| 86 | else if [ MATCH (msvc).* : $(INTEL_BASE_MSVC_TOOLSET) ] |
|---|
| 87 | { |
|---|
| 88 | C++FLAGS += /Qvc6 ; |
|---|
| 89 | } |
|---|
| 90 | |
|---|
| 91 | if $(INTEL_BASE_MSVC_TOOLSET) = msvc |
|---|
| 92 | { |
|---|
| 93 | # no wchar_t support in vc6 dinkum library. Furthermore, in vc6 |
|---|
| 94 | # compatibility-mode, wchar_t is not a distinct type from unsigned |
|---|
| 95 | # short |
|---|
| 96 | C++FLAGS += -DBOOST_NO_INTRINSIC_WCHAR_T ; |
|---|
| 97 | } |
|---|
| 98 | else if $(version) > 5 |
|---|
| 99 | { |
|---|
| 100 | # Add support for wchar_t |
|---|
| 101 | C++FLAGS += /Zc:wchar_t |
|---|
| 102 | # Tell the dinkumware library about it. |
|---|
| 103 | -D_NATIVE_WCHAR_T_DEFINED |
|---|
| 104 | ; |
|---|
| 105 | } |
|---|
| 106 | |
|---|
| 107 | # remove any duplicates caused by the additions above |
|---|
| 108 | C++FLAGS = [ unique $(C++FLAGS) ] ; |
|---|
| 109 | |
|---|
| 110 | if $(VC_SETUP) |
|---|
| 111 | { |
|---|
| 112 | if $(version) <= 7 |
|---|
| 113 | { |
|---|
| 114 | VC_SETUP = "CALL \"$(INTEL_TOOL_PATH)ICCVARS.BAT\" > nul" ; |
|---|
| 115 | } |
|---|
| 116 | else |
|---|
| 117 | { |
|---|
| 118 | VC_SETUP = "CALL \"$(INTEL_TOOL_PATH)ICLVARS.BAT\" > nul" ; |
|---|
| 119 | } |
|---|
| 120 | } |
|---|