1 | # (C) Copyright David Abrahams 2001. |
---|
2 | # Distributed under the Boost Software License, Version 1.0. |
---|
3 | # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) |
---|
4 | |
---|
5 | # Adapted from gcc-tools.jam by Joerg Walter |
---|
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 |
---|
9 | # number. |
---|
10 | #//<a href="http://www.intel.com/software/products/compilers/">Intel<br>C++</a> |
---|
11 | |
---|
12 | set-as-singleton INTEL_PATH ; |
---|
13 | |
---|
14 | INTEL_VERSION ?= $(INTEL_LINUX_VERSION) ; # For backwards compatibility |
---|
15 | INTEL_CC ?= icc ; |
---|
16 | INTEL_CXX ?= icpc ; |
---|
17 | |
---|
18 | # Attempt to look in the PATH if no variables have been set up. |
---|
19 | if ! $(INTEL_VERSION) && ! $(INTEL_PATH) |
---|
20 | { |
---|
21 | local paths = [ MATCH ^(.*/(compiler[567]0/ia32|intel_cc_[0-9]+))/ : [ GLOB $(PATH) : iccvars.sh ] ] ; |
---|
22 | INTEL_PATH ?= $(paths[0]) ; |
---|
23 | } |
---|
24 | |
---|
25 | INTEL_VERSION ?= 80 ; |
---|
26 | |
---|
27 | # In case the path is unspecified, try to deduce it from the version |
---|
28 | if $(INTEL_VERSION) in 50 60 70 |
---|
29 | { |
---|
30 | INTEL_PATH ?= /opt/intel/compiler$(INTEL_VERSION)/ia32 ; |
---|
31 | } |
---|
32 | else |
---|
33 | { |
---|
34 | INTEL_PATH ?= /opt/intel_cc_$(INTEL_VERSION) ; |
---|
35 | } |
---|
36 | |
---|
37 | # Root directory |
---|
38 | flags intel-linux INTEL_LINUX_ROOT : $(INTEL_PATH) ; |
---|
39 | # Setup script |
---|
40 | flags intel-linux INTEL_LINUX_SETUP : ". "$(INTEL_LINUX_ROOT)"/bin/iccvars.sh" ; |
---|
41 | # Additional DLL directory |
---|
42 | flags intel-linux INTEL_LINUX_RUN_LD_LIBRARY_PATH : $(INTEL_LINUX_ROOT)"/lib" ; |
---|
43 | |
---|
44 | |
---|
45 | #### compiler and linker switches #### |
---|
46 | |
---|
47 | # debugging |
---|
48 | flags intel-linux CFLAGS <debug-symbols>on : -g ; |
---|
49 | flags intel-linux LINKFLAGS <debug-symbols>on : -g ; |
---|
50 | flags intel-linux LINKFLAGS <debug-symbols>off : -Xlinker -s ; |
---|
51 | |
---|
52 | # optimizations |
---|
53 | flags intel-linux CFLAGS <optimization>off : -O0 ; |
---|
54 | flags intel-linux CFLAGS <optimization>space : -O2 ; |
---|
55 | flags intel-linux CFLAGS <optimization>speed : -O3 ; |
---|
56 | |
---|
57 | # standard library |
---|
58 | flags intel-linux CFLAGS <stdlib>gcc : -cxxlib-gcc ; |
---|
59 | flags intel-linux LINKFLAGS <stdlib>gcc : -cxxlib-gcc ; |
---|
60 | |
---|
61 | # inlining |
---|
62 | # results using -ip are worse than without? |
---|
63 | # flags intel-linux CFLAGS <inlining>full : -ip ; |
---|
64 | |
---|
65 | # threading |
---|
66 | flags intel-linux CFLAGS <threading>multi : -openmp ; |
---|
67 | flags intel-linux LINKFLAGS <threading>multi : -openmp ; |
---|
68 | |
---|
69 | # profiling |
---|
70 | flags intel-linux CFLAGS <profiling>on : -p ; |
---|
71 | flags intel-linux LINKFLAGS <profiling>on : -p ; |
---|
72 | |
---|
73 | # position independent code |
---|
74 | flags intel-linux CFLAGS <shared-linkable>true : -KPIC ; |
---|
75 | flags intel-linux LINKFLAGS <shared-linkable>true : -KPIC ; |
---|
76 | |
---|
77 | # dynamic link library |
---|
78 | flags intel-linux LINKFLAGS <target-type>$(SHARED_TYPES) : -shared ; |
---|
79 | |
---|
80 | # library linking |
---|
81 | flags intel-linux LINKFLAGS <runtime-link>static : -static ; |
---|
82 | |
---|
83 | # required libraries |
---|
84 | flags intel-linux FINDLIBS : rt ; |
---|
85 | flags intel-linux FINDLIBS <runtime-link>static : pthread ; |
---|
86 | |
---|
87 | |
---|
88 | #### standard settings #### |
---|
89 | |
---|
90 | flags intel-linux UNDEFS <undef> ; |
---|
91 | flags intel-linux DEFINES <define> ; |
---|
92 | flags intel-linux CFLAGS <cflags> ; |
---|
93 | flags intel-linux C++FLAGS <cxxflags> ; |
---|
94 | |
---|
95 | flags intel-linux HDRS <include> ; |
---|
96 | flags intel-linux LIBPATH <library-path> ; |
---|
97 | |
---|
98 | flags intel-linux NEEDLIBS <library-file> ; |
---|
99 | flags intel-linux FINDLIBS <find-library> ; |
---|
100 | |
---|
101 | flags intel-linux STDHDRS <sysinclude> ; |
---|
102 | flags intel-linux LINKFLAGS <linkflags> ; |
---|
103 | |
---|
104 | flags intel-linux ARFLAGS <arflags> ; |
---|
105 | |
---|
106 | if ! $(ARFLAGS) |
---|
107 | { |
---|
108 | flags intel-linux ARFLAGS : "" ; |
---|
109 | } |
---|
110 | |
---|
111 | flags intel-linux DLLVERSION <dllversion> ; |
---|
112 | DLLVERSION = $(DLLVERSION[1]) ; |
---|
113 | DLLVERSION ?= $(BOOST_VERSION) ; |
---|
114 | |
---|
115 | flags intel-linux TARGET_TYPE <target-type> ; |
---|
116 | |
---|
117 | #### Cc #### |
---|
118 | |
---|
119 | rule Cc-action |
---|
120 | { |
---|
121 | intel-linux-Cc-action $(<) : $(>) ; |
---|
122 | } |
---|
123 | |
---|
124 | actions intel-linux-Cc-action |
---|
125 | { |
---|
126 | $(INTEL_LINUX_SETUP) |
---|
127 | $(INTEL_CC) -c -w1 -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" |
---|
128 | } |
---|
129 | |
---|
130 | #### C++ #### |
---|
131 | |
---|
132 | rule C++-action |
---|
133 | { |
---|
134 | intel-linux-C++-action $(<) : $(>) ; |
---|
135 | } |
---|
136 | |
---|
137 | actions intel-linux-C++-action |
---|
138 | { |
---|
139 | $(INTEL_LINUX_SETUP) |
---|
140 | $(INTEL_CXX) -c -w1 -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" |
---|
141 | } |
---|
142 | |
---|
143 | #### Archive #### |
---|
144 | |
---|
145 | rule Archive-action |
---|
146 | { |
---|
147 | intel-linux-Archive-action $(<) : $(>) ; |
---|
148 | } |
---|
149 | |
---|
150 | actions updated together piecemeal intel-linux-Archive-action |
---|
151 | { |
---|
152 | ar ru$(ARFLAGS) "$(<)" "$(>)" |
---|
153 | } |
---|
154 | |
---|
155 | #### Link #### |
---|
156 | |
---|
157 | rule Link-action |
---|
158 | { |
---|
159 | local result ; |
---|
160 | gRUN_LD_LIBRARY_PATH($(<)) += $(INTEL_LINUX_RUN_LD_LIBRARY_PATH) ; |
---|
161 | SPACE on $(<) = " " ; |
---|
162 | if $(DLLVERSION) && $(TARGET_TYPE) in $(SHARED_TYPES) |
---|
163 | { |
---|
164 | OUTTAG on $(<) = ".$(DLLVERSION)" ; |
---|
165 | SOTAG on $(<) = ".$(DLLVERSION)" ; |
---|
166 | ACTION_1 on $(<) = "" ; |
---|
167 | result += "$(<[1]:D=).$(DLLVERSION)" ; |
---|
168 | } |
---|
169 | else |
---|
170 | { |
---|
171 | OUTTAG on $(<) = "" ; |
---|
172 | SOTAG on $(<) = ; |
---|
173 | ACTION_1 on $(<) = ; |
---|
174 | } |
---|
175 | intel-linux-Link-action $(<) : $(>) ; |
---|
176 | return $(result) ; |
---|
177 | } |
---|
178 | |
---|
179 | # for icc, we repeat all libraries so that dependencies are always resolved |
---|
180 | actions intel-linux-Link-action bind NEEDLIBS NEEDIMPS |
---|
181 | { |
---|
182 | $(INTEL_LINUX_SETUP) |
---|
183 | $(INTEL_CXX) $(LINKFLAGS) -o "$(<[1])$(OUTTAG)" -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" $(NEEDLIBS) $(NEEDLIBS) -l$(FINDLIBS) "$(IMPLIB_FLAGS)$(NEEDIMPS)" "-Qoption,link,-soname,$(<[1]:D=)$(SOTAG)" |
---|
184 | $(ACTION_1)$(LN)$(SPACE)-fs$(SPACE)"$(<[1]:D=)$(OUTTAG)"$(SPACE)"$(<[1])" |
---|
185 | } |
---|
186 | |
---|
187 | |
---|
188 | |
---|