]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/src/tools/pathscale.jam
94abcf1c832c9e4ca470c77e8762e5427a588dc9
[ceph.git] / ceph / src / boost / tools / build / src / tools / pathscale.jam
1 # Copyright 2006 Noel Belcourt
2 # Distributed under the Boost Software License, Version 1.0.
3 # (See accompanying file LICENSE_1_0.txt or copy at
4 # http://www.boost.org/LICENSE_1_0.txt)
5
6 import property ;
7 import generators ;
8 import toolset : flags ;
9 import feature ;
10 import type ;
11 import os ;
12 import common ;
13 import fortran ;
14
15 feature.extend toolset : pathscale ;
16 toolset.inherit pathscale : unix ;
17 generators.override pathscale.prebuilt : builtin.prebuilt ;
18 generators.override pathscale.searched-lib-generator : searched-lib-generator ;
19
20 # Documentation and toolchain description located
21 # http://www.pathscale.com/docs.html
22
23 rule init ( version ? : command * : options * )
24 {
25 command = [ common.get-invocation-command pathscale : pathCC : $(command)
26 : /opt/ekopath/bin ] ;
27
28 # Determine the version
29 local command-string = $(command:J=" ") ;
30 if $(command)
31 {
32 version ?= [ MATCH "^([0-9.]+)"
33 : [ SHELL "$(command-string) -dumpversion" ] ] ;
34 }
35
36 local condition = [ common.check-init-parameters pathscale
37 : version $(version) ] ;
38
39 common.handle-options pathscale : $(condition) : $(command) : $(options) ;
40
41 toolset.flags pathscale.compile.fortran90 OPTIONS $(condition) :
42 [ feature.get-values <fflags> : $(options) ] : unchecked ;
43
44 command_c = $(command_c[1--2]) $(command[-1]:B=pathcc) ;
45
46 toolset.flags pathscale CONFIG_C_COMMAND $(condition) : $(command_c) ;
47
48 # fortran support
49 local f-command = [ common.get-invocation-command pathscale : pathf90 : $(command) ] ;
50 local command_f = $(command_f[1--2]) $(f-command[-1]:B=pathf90) ;
51 local command_f90 = $(command_f[1--2]) $(f-command[-1]:B=pathf90) ;
52
53 toolset.flags pathscale CONFIG_F_COMMAND $(condition) : $(command_f) ;
54 toolset.flags pathscale CONFIG_F90_COMMAND $(condition) : $(command_f90) ;
55
56 # always link lib rt to resolve clock_gettime()
57 flags pathscale.link FINDLIBS-SA : rt : unchecked ;
58
59 switch [ os.name ]
60 {
61 case SOLARIS :
62 toolset.flags pathscale.link RPATH_OPTION $(condition) : -Wl,-R, -Wl, : unchecked ;
63
64 case * : # GNU
65 toolset.flags pathscale.link RPATH_OPTION $(condition) : -Wl,-rpath= : unchecked ;
66 }
67 }
68
69 # Declare generators
70 generators.register-c-compiler pathscale.compile.c : C : OBJ : <toolset>pathscale ;
71 generators.register-c-compiler pathscale.compile.c++ : CPP : OBJ : <toolset>pathscale ;
72 generators.register-fortran-compiler pathscale.compile.fortran : FORTRAN : OBJ : <toolset>pathscale ;
73 generators.register-fortran90-compiler pathscale.compile.fortran90 : FORTRAN90 : OBJ : <toolset>pathscale ;
74
75 # Declare flags and actions for compilation
76 flags pathscale.compile OPTIONS <optimization>off : -O0 ;
77 flags pathscale.compile OPTIONS <optimization>speed : -O3 ;
78 flags pathscale.compile OPTIONS <optimization>space : -Os ;
79
80 flags pathscale.compile OPTIONS <inlining>off : -noinline ;
81 flags pathscale.compile OPTIONS <inlining>on : -inline ;
82 flags pathscale.compile OPTIONS <inlining>full : -inline ;
83
84 flags pathscale.compile OPTIONS <warnings>off : -woffall ;
85 flags pathscale.compile OPTIONS <warnings>on : -Wall ;
86 flags pathscale.compile OPTIONS <warnings>all : -Wall -pedantic ;
87 flags pathscale.compile OPTIONS <warnings-as-errors>on : -Werror ;
88
89 flags pathscale.compile OPTIONS <debug-symbols>on : -ggdb ;
90 flags pathscale.compile OPTIONS <profiling>on : -pg ;
91 flags pathscale.compile OPTIONS <link>shared : -fPIC ;
92 flags pathscale.compile OPTIONS <address-model>32 : -m32 ;
93 flags pathscale.compile OPTIONS <address-model>64 : -m64 ;
94
95 flags pathscale.compile USER_OPTIONS <cflags> ;
96 flags pathscale.compile.c++ USER_OPTIONS <cxxflags> ;
97 flags pathscale.compile DEFINES <define> ;
98 flags pathscale.compile INCLUDES <include> ;
99
100 flags pathscale.compile.fortran USER_OPTIONS <fflags> ;
101 flags pathscale.compile.fortran90 USER_OPTIONS <fflags> ;
102
103 actions compile.c
104 {
105 "$(CONFIG_C_COMMAND)" $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
106 }
107
108 actions compile.c++
109 {
110 "$(CONFIG_COMMAND)" $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
111 }
112
113 actions compile.fortran
114 {
115 "$(CONFIG_F_COMMAND)" $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
116 }
117
118 rule compile.fortran90 ( targets * : sources * : properties * )
119 {
120 # the space rule inserts spaces between targets and it's necessary
121 SPACE on $(targets) = " " ;
122 # Serialize execution of the compile.fortran90 action
123 # F90 source must be compiled in a particular order so we
124 # serialize the build as a parallel F90 compile might fail
125 JAM_SEMAPHORE on $(targets) = <s>pathscale-f90-semaphore ;
126 }
127
128 actions compile.fortran90
129 {
130 "$(CONFIG_F90_COMMAND)" $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -module $(<[1]:D) -c -o "$(<)" "$(>)"
131 }
132
133 # Declare flags and actions for linking
134 flags pathscale.link OPTIONS <debug-symbols>on : -ggdb -rdynamic ;
135 # Strip the binary when no debugging is needed
136 flags pathscale.link OPTIONS <debug-symbols>off : -g0 ;
137 flags pathscale.link OPTIONS <profiling>on : -pg ;
138 flags pathscale.link USER_OPTIONS <linkflags> ;
139 flags pathscale.link LINKPATH <library-path> ;
140 flags pathscale.link FINDLIBS-ST <find-static-library> ;
141 flags pathscale.link FINDLIBS-SA <find-shared-library> ;
142 flags pathscale.link FINDLIBS-SA <threading>multi : pthread ;
143 flags pathscale.link LIBRARIES <library-file> ;
144 flags pathscale.link LINK-RUNTIME <runtime-link>static : static ;
145 flags pathscale.link LINK-RUNTIME <runtime-link>shared : dynamic ;
146 flags pathscale.link RPATH <dll-path> ;
147 # On gcc, there are separate options for dll path at runtime and
148 # link time. On Solaris, there's only one: -R, so we have to use
149 # it, even though it's bad idea.
150 flags pathscale.link RPATH <xdll-path> ;
151
152 rule link ( targets * : sources * : properties * )
153 {
154 SPACE on $(targets) = " " ;
155 }
156
157 actions link bind LIBRARIES
158 {
159 "$(CONFIG_COMMAND)" $(OPTIONS) $(USER_OPTIONS) -L"$(LINKPATH)" $(RPATH_OPTION:E=-Wl,-rpath=)"$(RPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST)
160 }
161
162 # Slight mods for dlls
163 rule link.dll ( targets * : sources * : properties * )
164 {
165 SPACE on $(targets) = " " ;
166 }
167
168 actions link.dll bind LIBRARIES
169 {
170 "$(CONFIG_COMMAND)" $(OPTIONS) $(USER_OPTIONS) -L"$(LINKPATH)" $(RPATH_OPTION:E=-Wl,-rpath=)"$(RPATH)" -o "$(<)" -Wl,-soname$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST)
171 }
172
173 # Declare action for creating static libraries
174 # "$(CONFIG_COMMAND)" -ar -o "$(<)" "$(>)"
175 actions piecemeal archive
176 {
177 ar $(ARFLAGS) ru "$(<)" "$(>)"
178 }