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)
9 import feature generators common ;
10 import toolset : flags ;
13 feature.extend toolset : diab ;
15 # Inherit from Unix toolset to get library ordering magic.
16 toolset.inherit diab : unix ;
18 generators.override diab.prebuilt : builtin.lib-generator ;
19 generators.override diab.prebuilt : builtin.prebuilt ;
20 generators.override diab.searched-lib-generator : searched-lib-generator ;
23 rule init ( version ? : command * : options * )
25 local condition = [ common.check-init-parameters diab : version $(version) ] ;
27 local command = [ common.get-invocation-command diab : dcc : $(command) ] ;
31 local root = [ common.get-absolute-tool-path $(command[-1]) ] ;
35 flags diab .root <host-os>linux : "\"$(root)\"/" ;
36 flags diab .root <host-os>windows : $(root:T)/ ;
39 # If we can't find 'CC' anyway, at least show 'CC' in the commands
42 common.handle-options diab : $(condition) : $(command) : $(options) ;
45 generators.register-c-compiler diab.compile.c++ : CPP : OBJ : <toolset>diab ;
46 generators.register-c-compiler diab.compile.c : C : OBJ : <toolset>diab ;
49 # unlike most compliers, Diab defaults to static linking.
50 # flags cxx LINKFLAGS <runtime-link>static : ;
51 flags diab.compile OPTIONS <debug-symbols>on : -g ;
52 flags diab.link OPTIONS <debug-symbols>on : -g ;
54 flags diab.compile OPTIONS <optimization>off : ;
55 flags diab.compile OPTIONS <optimization>speed : -speed ;
56 flags diab.compile OPTIONS <optimization>space : -size ;
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 ;
62 flags diab.compile OPTIONS <cflags> ;
63 flags diab.compile.c++ OPTIONS <cxxflags> ;
64 flags diab.compile DEFINES <define> ;
66 flags diab.compile.c++ OPTIONS <exception-handling>off : -Xno-exceptions ;
67 # So Dinkum STL knows when exceptions are disabled
68 flags diab.compile DEFINES <exception-handling>off : _NO_EX=1 ;
69 flags diab.compile INCLUDES <include> ;
70 flags diab.link OPTIONS <linkflags> ;
72 flags diab.compile OPTIONS <link>shared : -Xpic ;
73 #flags diab.compile OPTIONS <link>static : ;
74 # get VxWorks link options from shell enviorment
75 flags diab.link OPTIONS <link>static : [ os.environ LDFLAGS_STATIC ] ;
76 flags diab.link.dll OPTIONS : [ os.environ LDFLAGS_SO ] ;
77 flags diab.link OPTIONS <link>shared : [ os.environ LDFLAGS_DYNAMIC ] ;
79 flags diab.link LOPTIONS <link>shared : -Xdynamic -Xshared -Xpic ;
81 flags diab.link LIBPATH <library-path> ;
82 flags diab.link LIBRARIES <library-file> ;
83 flags diab.link FINDLIBS-ST <find-static-library> ;
84 flags diab.link FINDLIBS-SA <find-shared-library> ;
86 actions link bind LIBRARIES
88 $(CONFIG_COMMAND) $(OPTIONS) $(LOPTIONS) -o "$(<)" -L$(LIBPATH) "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA)
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
96 actions link.dll bind LIBRARIES
98 $(.root:E=)dplus $(OPTIONS) $(LOPTIONS) "$(LIBRARIES)" -o "$(<[1])" -L$(LIBPATH) "$(>)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA)
101 #rule compile.asm ( targets * : sources * : properties * )
103 # setup-fpic $(targets) : $(sources) : $(properties) ;
104 # setup-address-model $(targets) : $(sources) : $(properties) ;
109 "$(CONFIG_COMMAND)" $(LANG) $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
116 $(.root:E=)dcc -c $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -o "$(<)" "$(>)"
121 $(.root:E=)dplus -c $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -o "$(<)" "$(>)"
124 # Always create archive from scratch. See the gcc toolet for rationale.
125 RM = [ common.rm-command ] ;
126 actions together piecemeal archive