File: sun.jam

package info (click to toggle)
boost-build 2.0-m11-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,624 kB
  • ctags: 2,387
  • sloc: ansic: 12,978; python: 5,209; xml: 4,782; cpp: 555; yacc: 456; sh: 237; makefile: 71
file content (120 lines) | stat: -rw-r--r-- 4,037 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#  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 ;
generators.override sun.prebuilt : builtin.lib-generator ;
generators.override sun.searched-lib-generator : searched-lib-generator ;

feature.extend stdlib : sun-stlport ;
feature.compose <stdlib>sun-stlport
    : <cxxflags>-library=stlport4 <linkflags>-library=stlport4
    ;

rule init ( version ? : command * : options * ) 
{
    local condition = [ 
      common.check-init-parameters sun : version $(version) ] ;
    
    command = [ common.get-invocation-command sun : CC 
        : $(command) : "/opt/SUNWspro/bin" ] ;

    # Even if the real compiler is not found, put CC to
    # command line so that user see command line that would have being executed.
    command ?= CC ;

    common.handle-options sun : $(condition) : $(command) : $(options) ;
    
    command_c = $(command[1--2]) $(command[-1]:B=cc) ;

    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 ;
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 <runtime-link>static : static ;
flags sun.link LINK-RUNTIME <runtime-link>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> ;

# The POSIX real-time library is always needed (nanosleep, clock_gettime etc.)
flags sun.link FINDLIBS-SA : rt ;

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 "$(<)" "$(>)"
}