]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/tools/build/src/tools/diab.jam
import new upstream nautilus stable release 14.2.8
[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
92f5a8d4 49# unlike most compilers, Diab defaults to static linking.
b32b8144
FG
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
11fdf7f2 66flags diab.compile.c++ OPTIONS <exception-handling>off : -Xno-exceptions ;
b32b8144 67# So Dinkum STL knows when exceptions are disabled
11fdf7f2
TL
68flags diab.compile.c++ DEFINES <exception-handling>off : _NO_EX=1 ;
69flags diab.compile.c++ DEFINES <rtti>off : _NO_RTTI ;
b32b8144
FG
70flags diab.compile INCLUDES <include> ;
71flags diab.link OPTIONS <linkflags> ;
72
73flags diab.compile OPTIONS <link>shared : -Xpic ;
74#flags diab.compile OPTIONS <link>static : ;
92f5a8d4 75# get VxWorks link options from shell environment
b32b8144
FG
76flags diab.link OPTIONS <link>static : [ os.environ LDFLAGS_STATIC ] ;
77flags diab.link.dll OPTIONS : [ os.environ LDFLAGS_SO ] ;
78flags diab.link OPTIONS <link>shared : [ os.environ LDFLAGS_DYNAMIC ] ;
79
80flags diab.link LOPTIONS <link>shared : -Xdynamic -Xshared -Xpic ;
81
82flags diab.link LIBPATH <library-path> ;
83flags diab.link LIBRARIES <library-file> ;
84flags diab.link FINDLIBS-ST <find-static-library> ;
85flags diab.link FINDLIBS-SA <find-shared-library> ;
86
87actions link bind LIBRARIES
88{
89 $(CONFIG_COMMAND) $(OPTIONS) $(LOPTIONS) -o "$(<)" -L$(LIBPATH) "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA)
90}
91
92# When creating dynamic libraries, we don't want to be warned about unresolved
93# symbols, therefore all unresolved symbols are marked as expected by
94# '-expect_unresolved *'. This also mirrors the behaviour of the GNU tool
95# chain.
96
97actions link.dll bind LIBRARIES
98{
99 $(.root:E=)dplus $(OPTIONS) $(LOPTIONS) "$(LIBRARIES)" -o "$(<[1])" -L$(LIBPATH) "$(>)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA)
100}
101
102#rule compile.asm ( targets * : sources * : properties * )
103#{
104# setup-fpic $(targets) : $(sources) : $(properties) ;
105# setup-address-model $(targets) : $(sources) : $(properties) ;
106#}
107
108actions compile.asm
109{
110 "$(CONFIG_COMMAND)" $(LANG) $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
111}
112
113
114
115actions compile.c
116{
117 $(.root:E=)dcc -c $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -o "$(<)" "$(>)"
118}
119
120actions compile.c++
121{
122 $(.root:E=)dplus -c $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -o "$(<)" "$(>)"
123}
124
125# Always create archive from scratch. See the gcc toolet for rationale.
126RM = [ common.rm-command ] ;
127actions together piecemeal archive
128{
129 $(RM) "$(<)"
130 dar rc $(<) $(>)
131}