1 # Copyright Wind River 2017.
2 # Distributed under the Boost Software License, Version 1.0.
3 # (See accompanying file LICENSE_1_0.txt
4 # or copy at http://www.boost.org/LICENSE_1_0.txt)
7 import feature : feature ;
10 import toolset : flags ;
16 feature.extend-subfeature toolset intel : platform : vxworks ;
18 toolset.inherit-generators intel-vxworks
19 <toolset>intel <toolset-intel:platform>vxworks
21 # Don't inherit PCH generators. They were not tested, and probably
22 # don't work for this compiler.
23 : gcc.mingw.link gcc.mingw.link.dll gcc.compile.c.pch gcc.compile.c++.pch
26 generators.override intel-vxworks.prebuilt : builtin.lib-generator ;
27 generators.override intel-vxworks.prebuilt : builtin.prebuilt ;
28 generators.override intel-vxworks.searched-lib-generator : searched-lib-generator ;
30 toolset.inherit-rules intel-vxworks : gcc ;
31 toolset.inherit-flags intel-vxworks : gcc
32 : <inlining>off <inlining>on <inlining>full <optimization>space
33 <warnings>off <warnings>all <warnings>on
34 <architecture>x86/<address-model>32
35 <architecture>x86/<address-model>64
38 if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]
40 .debug-configuration = true ;
43 # Initializes the intel-vxworks toolset
44 # version in mandatory
45 # name (default icc) is used to invoke the specified intel compiler
46 # compile and link options allow you to specify addition command line options for each version
47 rule init ( version ? : command * : options * )
49 local condition = [ common.check-init-parameters intel-vxworks
50 : version $(version) ] ;
52 command = [ common.get-invocation-command intel-vxworks : icc
53 : $(command) : /opt/intel_cc_80/bin ] ;
55 common.handle-options intel-vxworks : $(condition) : $(command) : $(options) ;
57 # handle <library-path>
58 # local library-path = [ feature.get-values <library-path> : $(options) ] ;
59 # flags intel-vxworks.link USER_OPTIONS $(condition) : [ feature.get-values <dll-path> : $(options) ] ;
61 local root = [ feature.get-values <root> : $(options) ] ;
63 if $(command) || $(root)
65 bin ?= [ common.get-absolute-tool-path $(command[-1]) ] ;
70 # Libraries required to run the executable may be in either
71 # $(root)/lib (10.1 and earlier)
73 # $(root)/lib/architecture-name (11.0 and later:
74 local lib_path = $(root)/lib $(root:P)/lib/$(bin:B) ;
75 if $(.debug-configuration)
77 ECHO notice\: using intel libraries "::" $(condition) "::" $(lib_path) ;
79 flags intel-vxworks.link RUN_PATH $(condition) : $(lib_path) ;
83 local m = [ MATCH (..).* : $(version) ] ;
84 local n = [ MATCH (.)\\. : $(m) ] ;
92 flags intel-vxworks.compile OPTIONS $(condition)/<inlining>off : -inline-level=0 ;
93 flags intel-vxworks.compile OPTIONS $(condition)/<inlining>on : -inline-level=1 ;
94 flags intel-vxworks.compile OPTIONS $(condition)/<inlining>full : -inline-level=2 ;
96 flags intel-vxworks.link OPTIONS $(condition)/<runtime-link>static : [ os.environ LDFLAGS_STATIC ] ;
97 flags intel-vxworks.link OPTIONS $(condition)/<runtime-link>shared : [ os.environ LDFLAGS_DYNAMIC ] ;
98 flags intel-vxworks.compile OPTIONS $(condition)/<link>shared : -fPIC ;
100 local minor = [ MATCH ".*\\.(.).*" : $(version) ] ;
107 flags intel-vxworks.compile OPTIONS <cflags> ;
108 flags intel-vxworks.compile.c++ OPTIONS <cxxflags> ;
109 flags intel-vxworks.compile INCLUDES <include> ;
112 .cpu-type-em64t = prescott nocona core2 corei7 corei7-avx core-avx-i
113 conroe conroe-xe conroe-l allendale merom
114 merom-xe kentsfield kentsfield-xe penryn wolfdale
115 yorksfield nehalem sandy-bridge ivy-bridge haswell ;
116 .cpu-type-amd64 = k8 opteron athlon64 athlon-fx k8-sse3 opteron-sse3
117 athlon64-sse3 amdfam10 barcelona bdver1 bdver2 bdver3 btver1 btver2 ;
118 .cpu-type-x86-64 = $(.cpu-type-em64t) $(.cpu-type-amd64) ;
120 #flags intel-vxworks.compile OPTIONS <instruction-set>$(.cpu-type-x86-64)/<address-model>32 : -m32 ; # -mcmodel=small ;
121 #flags intel-vxworks.compile OPTIONS <instruction-set>$(.cpu-type-x86-64)/<address-model>64 : -m64 ; # -mcmodel=large ;
123 flags intel-vxworks.compile.c OPTIONS <warnings>off : -w0 ;
124 flags intel-vxworks.compile.c OPTIONS <warnings>on : -w1 ;
125 flags intel-vxworks.compile.c OPTIONS <warnings>all : -w2 ;
127 flags intel-vxworks.compile.c++ OPTIONS <warnings>off : -w0 ;
128 flags intel-vxworks.compile.c++ OPTIONS <warnings>on : -w1 ;
129 flags intel-vxworks.compile.c++ OPTIONS <warnings>all : -w2 ;
133 "$(CONFIG_COMMAND)" -xc $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
138 "$(CONFIG_COMMAND)" -xc++ $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
141 flags intel-vxworks ARFLAGS <archiveflags> ;
145 rule archive ( targets * : sources * : properties * )
147 # Always remove archive and start again.
150 local clean.a = $(targets[1])(clean) ;
151 TEMPORARY $(clean.a) ;
153 LOCATE on $(clean.a) = [ on $(targets[1]) return $(LOCATE) ] ;
154 DEPENDS $(clean.a) : $(sources) ;
155 DEPENDS $(targets) : $(clean.a) ;
156 common.RmTemps $(clean.a) : $(targets) ;
159 actions piecemeal archive
161 "$(.AR)" $(AROPTIONS) rc "$(<)" "$(>)"
164 flags intel-vxworks.link USER_OPTIONS <linkflags> ;
166 # Declare actions for linking
167 rule link ( targets * : sources * : properties * )
169 SPACE on $(targets) = " " ;
170 # Serialize execution of the 'link' action, since
171 # running N links in parallel is just slower.
172 JAM_SEMAPHORE on $(targets) = <s>intel-vxworks-link-semaphore ;
175 actions link bind LIBRARIES
177 "$(CONFIG_COMMAND)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS)
180 actions link.dll bind LIBRARIES
182 "$(CONFIG_COMMAND)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS)