/usr/share/boost-build/src/tools
Edit: /usr/share/boost-build/src/tools/diab.jam (4307B)
# Copyright 2015, Wind River Inc.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
#
# Diab C++ Compiler
#
import feature generators common ;
import toolset : flags ;
import os ;
feature.extend toolset : diab ;
# Inherit from Unix toolset to get library ordering magic.
toolset.inherit diab : unix ;
generators.override diab.prebuilt : builtin.lib-generator ;
generators.override diab.prebuilt : builtin.prebuilt ;
generators.override diab.searched-lib-generator : searched-lib-generator ;
rule init ( version ? : command * : options * )
{
local condition = [ common.check-init-parameters diab : version $(version) ] ;
local command = [ common.get-invocation-command diab : dcc : $(command) ] ;
if $(command)
{
local root = [ common.get-absolute-tool-path $(command[-1]) ] ;
if $(root)
{
flags diab .root
linux : "\"$(root)\"/" ;
flags diab .root windows : $(root:T)/ ;
}
}
# If we can't find 'CC' anyway, at least show 'CC' in the commands
command ?= CC ;
common.handle-options diab : $(condition) : $(command) : $(options) ;
}
generators.register-c-compiler diab.compile.c++ : CPP : OBJ : diab ;
generators.register-c-compiler diab.compile.c : C : OBJ : diab ;
# unlike most compilers, Diab defaults to static linking.
# flags cxx LINKFLAGS static : ;
flags diab.compile OPTIONS on : -g ;
flags diab.link OPTIONS on : -g ;
flags diab.compile OPTIONS off : ;
flags diab.compile OPTIONS speed : -speed ;
flags diab.compile OPTIONS space : -size ;
# flags diab.compile OPTIONS off : -Xinline=0 ;
# flags diab.compile OPTIONS on : -Xinline=10 ;
# flags diab.compile OPTIONS full : -Xinline=50 ;
flags diab.compile OPTIONS ;
flags diab.compile.c++ OPTIONS ;
flags diab.compile DEFINES ;
flags diab.compile.c++ OPTIONS off : -Xno-exceptions ;
# So Dinkum STL knows when exceptions are disabled
flags diab.compile.c++ DEFINES off : _NO_EX=1 ;
flags diab.compile.c++ DEFINES off : _NO_RTTI ;
flags diab.compile INCLUDES ;
flags diab.link OPTIONS ;
flags diab.compile OPTIONS shared : -Xpic ;
#flags diab.compile OPTIONS static : ;
# get VxWorks link options from shell environment
flags diab.link OPTIONS static : [ os.environ LDFLAGS_STATIC ] ;
flags diab.link.dll OPTIONS : [ os.environ LDFLAGS_SO ] ;
flags diab.link OPTIONS shared : [ os.environ LDFLAGS_DYNAMIC ] ;
flags diab.link LOPTIONS shared : -Xdynamic -Xshared -Xpic ;
flags diab.link LIBPATH ;
flags diab.link LIBRARIES ;
flags diab.link FINDLIBS-ST ;
flags diab.link FINDLIBS-SA ;
actions link bind LIBRARIES
{
$(CONFIG_COMMAND) $(OPTIONS) $(LOPTIONS) -o "$(<)" -L$(LIBPATH) "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA)
}
# When creating dynamic libraries, we don't want to be warned about unresolved
# symbols, therefore all unresolved symbols are marked as expected by
# '-expect_unresolved *'. This also mirrors the behaviour of the GNU tool
# chain.
actions link.dll bind LIBRARIES
{
$(.root:E=)dplus $(OPTIONS) $(LOPTIONS) "$(LIBRARIES)" -o "$(<[1])" -L$(LIBPATH) "$(>)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA)
}
#rule compile.asm ( targets * : sources * : properties * )
#{
# setup-fpic $(targets) : $(sources) : $(properties) ;
# setup-address-model $(targets) : $(sources) : $(properties) ;
#}
actions compile.asm
{
"$(CONFIG_COMMAND)" $(LANG) $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
}
actions compile.c
{
$(.root:E=)dcc -c $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -o "$(<)" "$(>)"
}
actions compile.c++
{
$(.root:E=)dplus -c $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -o "$(<)" "$(>)"
}
# Always create archive from scratch. See the gcc toolet for rationale.
RM = [ common.rm-command ] ;
actions together piecemeal archive
{
$(RM) "$(<)"
dar rc $(<) $(>)
}