]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/tools/build/src/tools/sun.jam
update sources to v12.2.3
[ceph.git] / ceph / src / boost / tools / build / src / tools / sun.jam
CommitLineData
7c673cae
FG
1# Copyright (C) Christopher Currie 2003. Permission to copy, use,
2# modify, sell and distribute this software is granted provided this
3# copyright notice appears in all copies. This software is provided
4# "as is" without express or implied warranty, and with no claim as
5# to its suitability for any purpose.
6
7import property ;
8import generators ;
9import os ;
10import toolset : flags ;
11import feature ;
12import type ;
13import common ;
14
15feature.extend toolset : sun ;
16toolset.inherit sun : unix ;
17generators.override sun.prebuilt : builtin.lib-generator ;
18generators.override sun.prebuilt : builtin.prebuilt ;
19generators.override sun.searched-lib-generator : searched-lib-generator ;
20
21#
22# There are no less than 5 standard library options:
23# 1) The default, which uses an old version of the Rogue Wave std lib,
24# also available via -std=sun03.
25# 2) C++03 mode + STLport, selected via the -library option.
26# 3) C++03 mode plus the Apache std lib, selected via the -library option.
27# 4) C++03 or C++11 in g++ compatibility mode, and GNU libstdc++3, selected via -std=c++03/11.
28#
29# Note that the -std, -library and -compat compiler switches appear to be largely mutually
30# incompatible, and that going forward the -std switch seems to be the prefered one.
31#
32# See http://docs.oracle.com/cd/E37069_01/html/E37075/bkamw.html#OSSCPgnaof
33#
34feature.extend stdlib : sun-stlport ;
35feature.compose <stdlib>sun-stlport
b32b8144
FG
36 : <cxxflags>-library=stlport4 <cxxflags>-compat=5 <cxxflags>-features=zla
37 <linkflags>-library=stlport4 <linkflags>-compat=5
7c673cae
FG
38 ;
39feature.extend stdlib : apache ;
40feature.compose <stdlib>apache
b32b8144
FG
41 : <cxxflags>-library=stdcxx4 <cxxflags>-compat=5 <cxxflags>-features=zla
42 <linkflags>-library=stdcxx4 <cxxflags>-compat=5
7c673cae
FG
43 ;
44feature.extend stdlib : gnu ;
45feature.compose <stdlib>gnu
46 : <cxxflags>-std=c++03 <linkflags>-std=c++03
47 ;
48
49rule init ( version ? : command * : options * )
50{
51 local condition = [
52 common.check-init-parameters sun : version $(version) ] ;
53
54 command = [ common.get-invocation-command sun : CC
55 : $(command) : "/opt/SUNWspro/bin" ] ;
56
57 # Even if the real compiler is not found, put CC to
58 # command line so that user see command line that would have being executed.
59 command ?= CC ;
60
61 common.handle-options sun : $(condition) : $(command) : $(options) ;
62
63 command_c = $(command[1--2]) $(command[-1]:B=cc) ;
64
65 toolset.flags sun CONFIG_C_COMMAND $(condition) : $(command_c) ;
66}
67
68# Declare generators
69generators.register-c-compiler sun.compile.c : C : OBJ : <toolset>sun ;
70generators.register-c-compiler sun.compile.c++ : CPP : OBJ : <toolset>sun ;
71
72# Declare flags and actions for compilation
73flags sun.compile OPTIONS <debug-symbols>on : -g ;
74flags sun.compile OPTIONS <profiling>on : -xprofile=tcov ;
75flags sun.compile OPTIONS <optimization>speed : -xO4 ;
76flags sun.compile OPTIONS <optimization>space : -xO2 -xspace ;
77flags sun.compile OPTIONS <threading>multi : -mt ;
78flags sun.compile OPTIONS <warnings>off : -erroff ;
79flags sun.compile OPTIONS <warnings>on : -erroff=%none ;
80flags sun.compile OPTIONS <warnings>all : -erroff=%none ;
81flags sun.compile OPTIONS <warnings-as-errors>on : -errwarn ;
82
83flags sun.compile.c++ OPTIONS <inlining>off : +d ;
84
85# The -m32 and -m64 options are supported starting
86# with Sun Studio 12. On earlier compilers, the
87# 'address-model' feature is not supported and should not
88# be used. Instead, use -xarch=generic64 command line
89# option.
90# See http://svn.boost.org/trac/boost/ticket/1186
91# for details.
92flags sun OPTIONS <address-model>32 : -m32 ;
93flags sun OPTIONS <address-model>64 : -m64 ;
94# On sparc, there's a difference between -Kpic
95# and -KPIC. The first is slightly more efficient,
96# but has the limits on the size of GOT table.
97# For minimal fuss on user side, we use -KPIC here.
98# See http://svn.boost.org/trac/boost/ticket/1186#comment:6
99# for detailed explanation.
100flags sun OPTIONS <link>shared : -KPIC ;
101
102flags sun.compile OPTIONS <cflags> ;
103flags sun.compile.c++ OPTIONS <cxxflags> ;
104flags sun.compile DEFINES <define> ;
105flags sun.compile INCLUDES <include> ;
106
107actions compile.c
108{
109 "$(CONFIG_C_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
110}
111
112actions compile.c++
113{
114 "$(CONFIG_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
115}
116
117# Declare flags and actions for linking
118flags sun.link OPTIONS <debug-symbols>on : -g ;
119# Strip the binary when no debugging is needed
120flags sun.link OPTIONS <debug-symbols>off : -s ;
121flags sun.link OPTIONS <profiling>on : -xprofile=tcov ;
122flags sun.link OPTIONS <threading>multi : -mt ;
123flags sun.link OPTIONS <linkflags> ;
124flags sun.link LINKPATH <library-path> ;
125flags sun.link FINDLIBS-ST <find-static-library> ;
126flags sun.link FINDLIBS-SA <find-shared-library> ;
127flags sun.link LIBRARIES <library-file> ;
128flags sun.link LINK-RUNTIME <runtime-link>static : static ;
129flags sun.link LINK-RUNTIME <runtime-link>shared : dynamic ;
130flags sun.link RPATH <dll-path> ;
131# On gcc, there are separate options for dll path at runtime and
132# link time. On Solaris, there's only one: -R, so we have to use
133# it, even though it's bad idea.
134flags sun.link RPATH <xdll-path> ;
135
136# The POSIX real-time library is always needed (nanosleep, clock_gettime etc.)
137flags sun.link FINDLIBS-SA : rt ;
138
139rule link ( targets * : sources * : properties * )
140{
141 SPACE on $(targets) = " " ;
142}
143
144actions link bind LIBRARIES
145{
146 "$(CONFIG_COMMAND)" $(OPTIONS) -L"$(LINKPATH)" -R"$(RPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -Bdynamic -l$(FINDLIBS-SA) -Bstatic -l$(FINDLIBS-ST) -B$(LINK-RUNTIME)
147}
148
149# Slight mods for dlls
150rule link.dll ( targets * : sources * : properties * )
151{
152 SPACE on $(targets) = " " ;
153}
154
155actions link.dll bind LIBRARIES
156{
157 "$(CONFIG_COMMAND)" $(OPTIONS) -L"$(LINKPATH)" -R"$(RPATH)" -o "$(<)" -h$(<[1]:D=) -G "$(>)" "$(LIBRARIES)" -Bdynamic -l$(FINDLIBS-SA) -Bstatic -l$(FINDLIBS-ST) -B$(LINK-RUNTIME)
158}
159
160# Declare action for creating static libraries
161actions piecemeal archive
162{
163 "$(CONFIG_COMMAND)" -xar -o "$(<)" "$(>)"
164}
165