]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/src/tools/clang-vxworks.jam
update sources to v12.2.3
[ceph.git] / ceph / src / boost / tools / build / src / tools / clang-vxworks.jam
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)
5
6 import clang ;
7 import feature : feature get-values ;
8 import os ;
9 import toolset ;
10 import toolset : flags ;
11 import gcc ;
12 import common ;
13 import errors ;
14 import generators ;
15
16
17 feature.extend-subfeature toolset clang : platform : vxworks ;
18
19 toolset.inherit-generators clang-vxworks
20 <toolset>clang <toolset-clang:platform>vxworks
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 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 ;
30
31
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
38 ;
39
40 if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]
41 {
42 .debug-configuration = true ;
43 }
44
45 # vectorization diagnostics
46 feature vectorize : off on full ;
47
48 # Initializes the clang-vxworks toolset
49 # version in optional
50 # compile and link options allow you to specify addition command line options for each version
51 rule init ( version ? : command * : options * )
52 {
53 command = [ common.get-invocation-command clang-vxworks : ccllvm
54 : $(command) ] ;
55
56 linker = [ get-values <linker> : $(options) ] ;
57 linker ?= ld ;
58
59 # Determine the version
60 local command-string = $(command:J=" ") ;
61 if $(command)
62 {
63 version ?= [ MATCH "^([0-9.]+)"
64 : [ SHELL "$(command-string) -dumpversion" ] ] ;
65 }
66
67 local condition = [ common.check-init-parameters clang-vxworks
68 : version $(version) ] ;
69
70 common.handle-options clang-vxworks : $(condition) : $(command) : $(options) ;
71
72 gcc.init-link-flags clang-vxworks vxworks $(condition) ;
73
74 toolset.flags clang-vxworks.link .LD : $(linker) ;
75 }
76
77 SPACE = " " ;
78
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> ;
82
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 ;
87
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 ;
92
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 ;
97
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 ;
101
102 toolset.flags clang-vxworks.compile OPTIONS <flags> ;
103
104
105 actions compile.c
106 {
107 "$(CONFIG_COMMAND)" -x c $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
108 }
109
110 actions compile.c++
111 {
112 "$(CONFIG_COMMAND)" -x c++ $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
113 }
114
115
116
117 flags clang-vxworks ARFLAGS <archiveflags> ;
118
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.
124 .AR = ar ;
125
126
127 actions piecemeal archive
128 {
129 "$(.AR)" $(AROPTIONS) rcu "$(<)" "$(>)"
130 }
131
132 flags clang-vxworks.link USER_OPTIONS <linkflags> ;
133
134 # Declare actions for linking
135 rule link ( targets * : sources * : properties * )
136 {
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 ;
141 }
142
143 actions link bind LIBRARIES
144 {
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)
146 }
147
148 actions link.dll bind LIBRARIES
149 {
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
151 }