2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-16 13:22:11 +00:00
Files
build/v2/tools/sun.jam
Vladimir Prus d0cd12f7c5 Handle xdll-path property for sun, so that linker can find all
libraries in a chain. E.g. in app -> a.so -> b.so, we need to pass
the path to b.so to the linker so that it can verify that all symbols
asked by 'app' and 'b.so' are present.


[SVN r25003]
2004-09-10 12:33:42 +00:00

112 lines
3.6 KiB
Plaintext

# Copyright (C) Christopher Currie 2003. Permission to copy, use,
# modify, sell and distribute this software is granted provided this
# copyright notice appears in all copies. This software is provided
# "as is" without express or implied warranty, and with no claim as
# to its suitability for any purpose.
import property ;
import generators ;
import os ;
import toolset : flags ;
import feature ;
import type ;
import common ;
feature.extend toolset : sun ;
toolset.inherit sun : unix ;
feature.subfeature toolset sun : version ;
feature.extend stdlib : sun-stlport ;
feature.compose <stdlib>sun-stlport
: <cxxflags>-library=stlport4 <linkflags>-library=stlport4
;
rule init ( version ? : command * )
{
local condition = [
common.check-init-parameters sun : version $(version) ] ;
command = [ common.get-invocation-command sun : CC
: $(command) : "/opt/SUNWspro/bin" ] ;
command_c = $(command[1--2]) $(command[-1]:B=cc) ;
toolset.flags sun CONFIG_COMMAND $(condition) : $(command) ;
toolset.flags sun CONFIG_C_COMMAND $(condition) : $(command_c) ;
}
# Declare generators
generators.register-c-compiler sun.compile.c : C : OBJ : <toolset>sun ;
generators.register-c-compiler sun.compile.c++ : CPP : OBJ : <toolset>sun ;
# Declare flags and actions for compilation
flags sun.compile OPTIONS <debug-symbols>on : -g ;
flags sun.compile OPTIONS <profiling>on : -xprofile=tcov ;
flags sun.compile OPTIONS <optimization>speed : -fast -xarch=generic ;
flags sun.compile OPTIONS <optimization>space : -xO2 -xspace ;
flags sun.compile OPTIONS <threading>multi : -mt ;
flags sun.compile.c++ OPTIONS <inlining>off : +d ;
flags sun.compile OPTIONS <cflags> ;
flags sun.compile.c++ OPTIONS <cxxflags> ;
flags sun.compile DEFINES <define> ;
flags sun.compile INCLUDES <include> ;
actions compile.c
{
"$(CONFIG_C_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
}
actions compile.c++
{
"$(CONFIG_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
}
# Declare flags and actions for linking
flags sun.link OPTIONS <debug-symbols>on : -g ;
# Strip the binary when no debugging is needed
flags sun.link OPTIONS <debug-symbols>off : -s ;
flags sun.link OPTIONS <profiling>on : -xprofile=tcov ;
flags sun.link OPTIONS <threading>multi : -mt ;
flags sun.link OPTIONS <linkflags> ;
flags sun.link LINKPATH <library-path> ;
flags sun.link FINDLIBS-ST <find-static-library> ;
flags sun.link FINDLIBS-SA <find-shared-library> ;
flags sun.link LIBRARIES <library-file> ;
flags sun.link LINK-RUNTIME <link-runtime>static : static ;
flags sun.link LINK-RUNTIME <link-runtime>shared : dynamic ;
flags sun.link RPATH <dll-path> ;
# On gcc, there are separate options for dll path at runtime and
# link time. On Solaris, there's only one: -R, so we have to use
# it, even though it's bad idea.
flags sun.link RPATH <xdll-path> ;
rule link ( targets * : sources * : properties * )
{
SPACE on $(targets) = " " ;
}
actions link bind LIBRARIES
{
"$(CONFIG_COMMAND)" $(OPTIONS) -L"$(LINKPATH)" -R"$(RPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -Bdynamic -l$(FINDLIBS-SA) -Bstatic -l$(FINDLIBS-ST) -B$(LINK-RUNTIME)
}
# Slight mods for dlls
rule link.dll ( targets * : sources * : properties * )
{
SPACE on $(targets) = " " ;
}
actions link.dll bind LIBRARIES
{
"$(CONFIG_COMMAND)" $(OPTIONS) -L"$(LINKPATH)" -R"$(RPATH)" -o "$(<)" -h$(<[1]:D=) -G "$(>)" "$(LIBRARIES)" -Bdynamic -l$(FINDLIBS-SA) -Bstatic -l$(FINDLIBS-ST) -B$(LINK-RUNTIME)
}
# Declare action for creating static libraries
actions piecemeal archive
{
"$(CONFIG_COMMAND)" -xar -o "$(<)" "$(>)"
}