1 # Copyright Brian Kuhl 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 get-values ;
10 import toolset : flags ;
17 feature.extend-subfeature toolset clang : platform : vxworks ;
19 toolset.inherit-generators clang-vxworks
20 <toolset>clang <toolset-clang:platform>vxworks
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
27 generators.override clang-vxworks.prebuilt : builtin.lib-generator ;
28 generators.override clang-vxworks.prebuilt : builtin.prebuilt ;
29 generators.override clang-vxworks.searched-lib-generator : searched-lib-generator ;
32 toolset.inherit-rules clang-vxworks : gcc ;
33 toolset.inherit-flags clang-vxworks : gcc
34 : <inlining>off <inlining>on <inlining>full <optimization>space
35 <warnings>off <warnings>all <warnings>on
36 <architecture>x86/<address-model>32
37 <architecture>x86/<address-model>64
40 if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]
42 .debug-configuration = true ;
45 # vectorization diagnostics
46 feature vectorize : off on full ;
48 # Initializes the clang-vxworks toolset
50 # compile and link options allow you to specify addition command line options for each version
51 rule init ( version ? : command * : options * )
53 command = [ common.get-invocation-command clang-vxworks : ccllvm
56 linker = [ get-values <linker> : $(options) ] ;
59 # Determine the version
60 local command-string = $(command:J=" ") ;
63 version ?= [ MATCH "^([0-9.]+)"
64 : [ SHELL "$(command-string) -dumpversion" ] ] ;
67 local condition = [ common.check-init-parameters clang-vxworks
68 : version $(version) ] ;
70 common.handle-options clang-vxworks : $(condition) : $(command) : $(options) ;
72 gcc.init-link-flags clang-vxworks vxworks $(condition) ;
74 toolset.flags clang-vxworks.link .LD : $(linker) ;
79 toolset.flags clang-vxworks.compile OPTIONS <cflags> ;
80 toolset.flags clang-vxworks.compile.c++ OPTIONS <cxxflags> ;
81 toolset.flags clang-vxworks.compile INCLUDES <include> ;
83 # Declare flags and action for compilation.
84 toolset.flags clang-vxworks.compile OPTIONS <optimization>off : -O0 ;
85 toolset.flags clang-vxworks.compile OPTIONS <optimization>speed : -O3 ;
86 toolset.flags clang-vxworks.compile OPTIONS <optimization>space : -Os ;
88 # For clang, 'on' and 'full' are identical
89 toolset.flags clang-vxworks.compile OPTIONS <inlining>off : -fno-inline ;
90 toolset.flags clang-vxworks.compile OPTIONS <inlining>on : -Wno-inline ;
91 toolset.flags clang-vxworks.compile OPTIONS <inlining>full : -Wno-inline ;
93 toolset.flags clang-vxworks.compile OPTIONS <warnings>off : -w ;
94 toolset.flags clang-vxworks.compile OPTIONS <warnings>on : -Wall ;
95 toolset.flags clang-vxworks.compile OPTIONS <warnings>all : -Wall -pedantic ;
96 toolset.flags clang-vxworks.compile OPTIONS <warnings-as-errors>on : -Werror ;
98 toolset.flags clang-vxworks.compile OPTIONS <debug-symbols>on : -g ;
99 toolset.flags clang-vxworks.compile OPTIONS <profiling>on : -pg ;
100 toolset.flags clang-vxworks.compile OPTIONS <rtti>off : -fno-rtti ;
102 toolset.flags clang-vxworks.compile OPTIONS <flags> ;
107 "$(CONFIG_COMMAND)" -x c $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
112 "$(CONFIG_COMMAND)" -x c++ $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
117 flags clang-vxworks ARFLAGS <archiveflags> ;
119 # Default value. Mostly for the sake of clang-linux
120 # that inherits from gcc, but does not has the same
121 # logic to set the .AR variable. We can put the same
122 # logic in clang-linux, but that's hardly worth the trouble
123 # as on Linux, 'ar' is always available.
127 actions piecemeal archive
129 "$(.AR)" $(AROPTIONS) rcu "$(<)" "$(>)"
132 flags clang-vxworks.link USER_OPTIONS <linkflags> ;
134 # Declare actions for linking
135 rule link ( targets * : sources * : properties * )
137 SPACE on $(targets) = " " ;
138 # Serialize execution of the 'link' action, since
139 # running N links in parallel is just slower.
140 JAM_SEMAPHORE on $(targets) = <s>clang-vxworks-link-semaphore ;
143 actions link bind LIBRARIES
145 "$(.LD)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" $(START-GROUP) $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS)
148 actions link.dll bind LIBRARIES
150 "$(.LD)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" $(START-GROUP) $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) -fpic -shared -non-static