]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/src/tools/intel-darwin.jam
8c77834afba59d6e27e079e099e780c9ed1412ba
[ceph.git] / ceph / src / boost / tools / build / src / tools / intel-darwin.jam
1 # Copyright Vladimir Prus 2004.
2 # Copyright Noel Belcourt 2007.
3 # Distributed under the Boost Software License, Version 1.0.
4 # (See accompanying file LICENSE_1_0.txt
5 # or copy at http://www.boost.org/LICENSE_1_0.txt)
6
7 import intel ;
8 import feature : feature ;
9 import os ;
10 import toolset ;
11 import toolset : flags ;
12 import gcc ;
13 import common ;
14 import errors ;
15 import generators ;
16
17 feature.extend-subfeature toolset intel : platform : darwin ;
18
19 toolset.inherit-generators intel-darwin
20 <toolset>intel <toolset-intel:platform>darwin
21 : gcc
22 # Don't inherit PCH generators. They were not tested, and probably
23 # don't work for this compiler.
24 : gcc.mingw.link gcc.mingw.link.dll gcc.compile.c.pch gcc.compile.c++.pch
25 ;
26
27 generators.override intel-darwin.prebuilt : builtin.lib-generator ;
28 generators.override intel-darwin.prebuilt : builtin.prebuilt ;
29 generators.override intel-darwin.searched-lib-generator : searched-lib-generator ;
30
31 toolset.inherit-rules intel-darwin : gcc ;
32 toolset.inherit-flags intel-darwin : gcc
33 : <inlining>off <inlining>on <inlining>full <optimization>space
34 <warnings>off <warnings>all <warnings>on
35 <architecture>x86/<address-model>32
36 <architecture>x86/<address-model>64
37 ;
38
39 if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]
40 {
41 .debug-configuration = true ;
42 }
43
44 # vectorization diagnostics
45 feature vectorize : off on full ;
46
47 # Initializes the intel-darwin toolset
48 # version in mandatory
49 # name (default icc) is used to invoke the specified intel complier
50 # compile and link options allow you to specify addition command line options for each version
51 rule init ( version ? : command * : options * )
52 {
53 local condition = [ common.check-init-parameters intel-darwin
54 : version $(version) ] ;
55
56 command = [ common.get-invocation-command intel-darwin : icc
57 : $(command) : /opt/intel_cc_80/bin ] ;
58
59 common.handle-options intel-darwin : $(condition) : $(command) : $(options) ;
60
61 gcc.init-link-flags intel-darwin darwin $(condition) ;
62
63 # handle <library-path>
64 # local library-path = [ feature.get-values <library-path> : $(options) ] ;
65 # flags intel-darwin.link USER_OPTIONS $(condition) : [ feature.get-values <dll-path> : $(options) ] ;
66
67 local root = [ feature.get-values <root> : $(options) ] ;
68 local bin ;
69 if $(command) || $(root)
70 {
71 bin ?= [ common.get-absolute-tool-path $(command[-1]) ] ;
72 root ?= $(bin:D) ;
73
74 if $(root)
75 {
76 # Libraries required to run the executable may be in either
77 # $(root)/lib (10.1 and earlier)
78 # or
79 # $(root)/lib/architecture-name (11.0 and later:
80 local lib_path = $(root)/lib $(root:P)/lib/$(bin:B) ;
81 if $(.debug-configuration)
82 {
83 ECHO notice: using intel libraries :: $(condition) :: $(lib_path) ;
84 }
85 flags intel-darwin.link RUN_PATH $(condition) : $(lib_path) ;
86 }
87 }
88
89 local m = [ MATCH (..).* : $(version) ] ;
90 local n = [ MATCH (.)\\. : $(m) ] ;
91 if $(n) {
92 m = $(n) ;
93 }
94
95 local major = $(m) ;
96
97 if $(major) = "9" {
98 flags intel-darwin.compile OPTIONS $(condition)/<inlining>off : -Ob0 ;
99 flags intel-darwin.compile OPTIONS $(condition)/<inlining>on : -Ob1 ;
100 flags intel-darwin.compile OPTIONS $(condition)/<inlining>full : -Ob2 ;
101 flags intel-darwin.compile OPTIONS $(condition)/<vectorize>off : -vec-report0 ;
102 flags intel-darwin.compile OPTIONS $(condition)/<vectorize>on : -vec-report1 ;
103 flags intel-darwin.compile OPTIONS $(condition)/<vectorize>full : -vec-report5 ;
104 flags intel-darwin.link OPTIONS $(condition)/<runtime-link>static : -static -static-libcxa -lstdc++ -lpthread ;
105 flags intel-darwin.link OPTIONS $(condition)/<runtime-link>shared : -shared-libcxa -lstdc++ -lpthread ;
106 }
107 else {
108 flags intel-darwin.compile OPTIONS $(condition)/<inlining>off : -inline-level=0 ;
109 flags intel-darwin.compile OPTIONS $(condition)/<inlining>on : -inline-level=1 ;
110 flags intel-darwin.compile OPTIONS $(condition)/<inlining>full : -inline-level=2 ;
111 flags intel-darwin.compile OPTIONS $(condition)/<vectorize>off : -vec-report0 ;
112 flags intel-darwin.compile OPTIONS $(condition)/<vectorize>on : -vec-report1 ;
113 flags intel-darwin.compile OPTIONS $(condition)/<vectorize>full : -vec-report5 ;
114 flags intel-darwin.link OPTIONS $(condition)/<runtime-link>static : -static -static-intel -lstdc++ -lpthread ;
115 flags intel-darwin.link OPTIONS $(condition)/<runtime-link>shared : -shared-intel -lstdc++ -lpthread ;
116 }
117
118 local minor = [ MATCH ".*\\.(.).*" : $(version) ] ;
119
120 # wchar_t char_traits workaround for compilers older than 10.2
121 if $(major) = "9" || ( $(major) = "10" && ( $(minor) = "0" || $(minor) = "1" ) ) {
122 flags intel-darwin.compile DEFINES $(condition) : __WINT_TYPE__=int : unchecked ;
123 }
124 }
125
126 SPACE = " " ;
127
128 flags intel-darwin.compile OPTIONS <cflags> ;
129 flags intel-darwin.compile.c++ OPTIONS <cxxflags> ;
130 # flags intel-darwin.compile INCLUDES <include> ;
131
132 flags intel-darwin.compile OPTIONS <optimization>space : -O1 ; # no specific space optimization flag in icc
133
134 #
135 .cpu-type-em64t = prescott nocona core2 corei7 corei7-avx core-avx-i
136 conroe conroe-xe conroe-l allendale merom
137 merom-xe kentsfield kentsfield-xe penryn wolfdale
138 yorksfield nehalem sandy-bridge ivy-bridge haswell ;
139 .cpu-type-amd64 = k8 opteron athlon64 athlon-fx k8-sse3 opteron-sse3
140 athlon64-sse3 amdfam10 barcelona bdver1 bdver2 bdver3 btver1 btver2 ;
141 .cpu-type-x86-64 = $(.cpu-type-em64t) $(.cpu-type-amd64) ;
142
143 flags intel-darwin.compile OPTIONS <instruction-set>$(.cpu-type-x86-64)/<address-model>32 : -m32 ; # -mcmodel=small ;
144 flags intel-darwin.compile OPTIONS <instruction-set>$(.cpu-type-x86-64)/<address-model>64 : -m64 ; # -mcmodel=large ;
145
146 flags intel-darwin.compile.c OPTIONS <warnings>off : -w0 ;
147 flags intel-darwin.compile.c OPTIONS <warnings>on : -w1 ;
148 flags intel-darwin.compile.c OPTIONS <warnings>all : -w2 ;
149
150 flags intel-darwin.compile.c++ OPTIONS <warnings>off : -w0 ;
151 flags intel-darwin.compile.c++ OPTIONS <warnings>on : -w1 ;
152 flags intel-darwin.compile.c++ OPTIONS <warnings>all : -w2 ;
153
154 actions compile.c
155 {
156 "$(CONFIG_COMMAND)" -xc $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
157 }
158
159 actions compile.c++
160 {
161 "$(CONFIG_COMMAND)" -xc++ $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
162 }
163
164 flags intel-darwin ARFLAGS <archiveflags> ;
165
166 # Default value. Mostly for the sake of intel-linux
167 # that inherits from gcc, but does not has the same
168 # logic to set the .AR variable. We can put the same
169 # logic in intel-linux, but that's hardly worth the trouble
170 # as on Linux, 'ar' is always available.
171 .AR = ar ;
172
173 rule archive ( targets * : sources * : properties * )
174 {
175 # Always remove archive and start again. Here's rationale from
176 # Andre Hentz:
177 #
178 # I had a file, say a1.c, that was included into liba.a.
179 # I moved a1.c to a2.c, updated my Jamfiles and rebuilt.
180 # My program was crashing with absurd errors.
181 # After some debugging I traced it back to the fact that a1.o was *still*
182 # in liba.a
183 #
184 # Rene Rivera:
185 #
186 # Originally removing the archive was done by splicing an RM
187 # onto the archive action. That makes archives fail to build on NT
188 # when they have many files because it will no longer execute the
189 # action directly and blow the line length limit. Instead we
190 # remove the file in a different action, just before the building
191 # of the archive.
192 #
193 local clean.a = $(targets[1])(clean) ;
194 TEMPORARY $(clean.a) ;
195 NOCARE $(clean.a) ;
196 LOCATE on $(clean.a) = [ on $(targets[1]) return $(LOCATE) ] ;
197 DEPENDS $(clean.a) : $(sources) ;
198 DEPENDS $(targets) : $(clean.a) ;
199 common.RmTemps $(clean.a) : $(targets) ;
200 }
201
202 actions piecemeal archive
203 {
204 "$(.AR)" $(AROPTIONS) rc "$(<)" "$(>)"
205 "ranlib" -cs "$(<)"
206 }
207
208 flags intel-darwin.link USER_OPTIONS <linkflags> ;
209
210 # Declare actions for linking
211 rule link ( targets * : sources * : properties * )
212 {
213 SPACE on $(targets) = " " ;
214 # Serialize execution of the 'link' action, since
215 # running N links in parallel is just slower.
216 JAM_SEMAPHORE on $(targets) = <s>intel-darwin-link-semaphore ;
217 }
218
219 actions link bind LIBRARIES
220 {
221 "$(CONFIG_COMMAND)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS)
222 }
223
224 actions link.dll bind LIBRARIES
225 {
226 "$(CONFIG_COMMAND)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" -single_module -dynamiclib -install_name "$(<[1]:D=)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS)
227 }