]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/tools/build/src/tools/diab.jam
update sources to v12.2.3
[ceph.git] / ceph / src / boost / tools / build / src / tools / diab.jam
CommitLineData
b32b8144
FG
1# Copyright 2015, Wind River Inc.
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#
6# Diab C++ Compiler
7#
8
9import feature generators common ;
10import toolset : flags ;
11import os ;
12
13feature.extend toolset : diab ;
14
15# Inherit from Unix toolset to get library ordering magic.
16toolset.inherit diab : unix ;
17
18generators.override diab.prebuilt : builtin.lib-generator ;
19generators.override diab.prebuilt : builtin.prebuilt ;
20generators.override diab.searched-lib-generator : searched-lib-generator ;
21
22
23rule init ( version ? : command * : options * )
24{
25 local condition = [ common.check-init-parameters diab : version $(version) ] ;
26
27 local command = [ common.get-invocation-command diab : dcc : $(command) ] ;
28
29 if $(command)
30 {
31 local root = [ common.get-absolute-tool-path $(command[-1]) ] ;
32
33 if $(root)
34 {
35 flags diab .root <host-os>linux : "\"$(root)\"/" ;
36 flags diab .root <host-os>windows : $(root:T)/ ;
37 }
38 }
39 # If we can't find 'CC' anyway, at least show 'CC' in the commands
40 command ?= CC ;
41
42 common.handle-options diab : $(condition) : $(command) : $(options) ;
43}
44
45generators.register-c-compiler diab.compile.c++ : CPP : OBJ : <toolset>diab ;
46generators.register-c-compiler diab.compile.c : C : OBJ : <toolset>diab ;
47
48
49# unlike most compliers, Diab defaults to static linking.
50# flags cxx LINKFLAGS <runtime-link>static : ;
51flags diab.compile OPTIONS <debug-symbols>on : -g ;
52flags diab.link OPTIONS <debug-symbols>on : -g ;
53
54flags diab.compile OPTIONS <optimization>off : ;
55flags diab.compile OPTIONS <optimization>speed : -speed ;
56flags diab.compile OPTIONS <optimization>space : -size ;
57
58# flags diab.compile OPTIONS <inlining>off : -Xinline=0 ;
59# flags diab.compile OPTIONS <inlining>on : -Xinline=10 ;
60# flags diab.compile OPTIONS <inlining>full : -Xinline=50 ;
61
62flags diab.compile OPTIONS <cflags> ;
63flags diab.compile.c++ OPTIONS <cxxflags> ;
64flags diab.compile DEFINES <define> ;
65
66flags diab.compile.c++ OPTIONS <exception-handling>off : -Xno-exceptions ;
67# So Dinkum STL knows when exceptions are disabled
68flags diab.compile DEFINES <exception-handling>off : _NO_EX=1 ;
69flags diab.compile INCLUDES <include> ;
70flags diab.link OPTIONS <linkflags> ;
71
72flags diab.compile OPTIONS <link>shared : -Xpic ;
73#flags diab.compile OPTIONS <link>static : ;
74# get VxWorks link options from shell enviorment
75flags diab.link OPTIONS <link>static : [ os.environ LDFLAGS_STATIC ] ;
76flags diab.link.dll OPTIONS : [ os.environ LDFLAGS_SO ] ;
77flags diab.link OPTIONS <link>shared : [ os.environ LDFLAGS_DYNAMIC ] ;
78
79flags diab.link LOPTIONS <link>shared : -Xdynamic -Xshared -Xpic ;
80
81flags diab.link LIBPATH <library-path> ;
82flags diab.link LIBRARIES <library-file> ;
83flags diab.link FINDLIBS-ST <find-static-library> ;
84flags diab.link FINDLIBS-SA <find-shared-library> ;
85
86actions link bind LIBRARIES
87{
88 $(CONFIG_COMMAND) $(OPTIONS) $(LOPTIONS) -o "$(<)" -L$(LIBPATH) "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA)
89}
90
91# When creating dynamic libraries, we don't want to be warned about unresolved
92# symbols, therefore all unresolved symbols are marked as expected by
93# '-expect_unresolved *'. This also mirrors the behaviour of the GNU tool
94# chain.
95
96actions link.dll bind LIBRARIES
97{
98 $(.root:E=)dplus $(OPTIONS) $(LOPTIONS) "$(LIBRARIES)" -o "$(<[1])" -L$(LIBPATH) "$(>)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA)
99}
100
101#rule compile.asm ( targets * : sources * : properties * )
102#{
103# setup-fpic $(targets) : $(sources) : $(properties) ;
104# setup-address-model $(targets) : $(sources) : $(properties) ;
105#}
106
107actions compile.asm
108{
109 "$(CONFIG_COMMAND)" $(LANG) $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
110}
111
112
113
114actions compile.c
115{
116 $(.root:E=)dcc -c $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -o "$(<)" "$(>)"
117}
118
119actions compile.c++
120{
121 $(.root:E=)dplus -c $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -o "$(<)" "$(>)"
122}
123
124# Always create archive from scratch. See the gcc toolet for rationale.
125RM = [ common.rm-command ] ;
126actions together piecemeal archive
127{
128 $(RM) "$(<)"
129 dar rc $(<) $(>)
130}