]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/src/tools/mipspro.jam
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / tools / build / src / tools / mipspro.jam
1 # Copyright Noel Belcourt 2007.
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 os ;
9 import toolset : flags ;
10 import feature ;
11 import fortran ;
12 import type ;
13 import common ;
14
15 feature.extend toolset : mipspro ;
16 toolset.inherit mipspro : unix ;
17 generators.override mipspro.prebuilt : builtin.lib-generator ;
18 generators.override mipspro.searched-lib-generator : searched-lib-generator ;
19
20 # Documentation and toolchain description located
21 # http://www.sgi.com/products/software/irix/tools/
22
23 rule init ( version ? : command * : options * )
24 {
25 local condition = [
26 common.check-init-parameters mipspro : version $(version) ] ;
27
28 command = [ common.get-invocation-command mipspro : CC : $(command) ] ;
29
30 common.handle-options mipspro : $(condition) : $(command) : $(options) ;
31
32 command_c = $(command_c[1--2]) $(command[-1]:B=cc) ;
33
34 toolset.flags mipspro CONFIG_C_COMMAND $(condition) : $(command_c) ;
35
36 # fortran support
37 local command = [
38 common.get-invocation-command mipspro : f77 : $(command) : $(install_dir) ] ;
39
40 command_f = $(command_f[1--2]) $(command[-1]:B=f77) ;
41 toolset.flags mipspro CONFIG_F_COMMAND $(condition) : $(command_f) ;
42
43 # set link flags
44 flags mipspro.link FINDLIBS-ST : [
45 feature.get-values <find-static-library> : $(options) ] : unchecked ;
46
47 flags mipspro.link FINDLIBS-SA : [
48 feature.get-values <find-shared-library> : $(options) ] : unchecked ;
49 }
50
51 # Declare generators
52 generators.register-c-compiler mipspro.compile.c : C : OBJ : <toolset>mipspro ;
53 generators.register-c-compiler mipspro.compile.c++ : CPP : OBJ : <toolset>mipspro ;
54 generators.register-fortran-compiler mipspro.compile.fortran : FORTRAN : OBJ : <toolset>mipspro ;
55
56 cpu-arch-32 =
57 <architecture>/<address-model>
58 <architecture>/<address-model>32 ;
59
60 cpu-arch-64 =
61 <architecture>/<address-model>64 ;
62
63 flags mipspro.compile OPTIONS $(cpu-arch-32) : -n32 ;
64 flags mipspro.compile OPTIONS $(cpu-arch-64) : -64 ;
65
66 # Declare flags and actions for compilation
67 flags mipspro.compile OPTIONS <debug-symbols>on : -g ;
68 # flags mipspro.compile OPTIONS <profiling>on : -xprofile=tcov ;
69 flags mipspro.compile OPTIONS <warnings>off : -w ;
70 flags mipspro.compile OPTIONS <warnings>on : -ansiW -diag_suppress 1429 ; # suppress long long is nonstandard warning
71 flags mipspro.compile OPTIONS <warnings>all : -fullwarn ;
72 flags mipspro.compile OPTIONS <optimization>speed : -Ofast ;
73 flags mipspro.compile OPTIONS <optimization>space : -O2 ;
74 flags mipspro.compile OPTIONS <cflags> : -LANG:std ;
75 flags mipspro.compile.c++ OPTIONS <inlining>off : -INLINE:none ;
76 flags mipspro.compile.c++ OPTIONS <cxxflags> ;
77 flags mipspro.compile DEFINES <define> ;
78 flags mipspro.compile INCLUDES <include> ;
79
80
81 flags mipspro.compile.fortran OPTIONS <fflags> ;
82
83 actions compile.c
84 {
85 "$(CONFIG_C_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
86 }
87
88 actions compile.c++
89 {
90 "$(CONFIG_COMMAND)" -FE:template_in_elf_section -ptused $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
91 }
92
93 actions compile.fortran
94 {
95 "$(CONFIG_F_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
96 }
97
98 # Declare flags and actions for linking
99 flags mipspro.link OPTIONS <debug-symbols>on : -g ;
100 # Strip the binary when no debugging is needed
101 # flags mipspro.link OPTIONS <debug-symbols>off : -s ;
102 # flags mipspro.link OPTIONS <profiling>on : -xprofile=tcov ;
103 # flags mipspro.link OPTIONS <threading>multi : -mt ;
104
105 flags mipspro.link OPTIONS $(cpu-arch-32) : -n32 ;
106 flags mipspro.link OPTIONS $(cpu-arch-64) : -64 ;
107
108 flags mipspro.link OPTIONS <optimization>speed : -Ofast ;
109 flags mipspro.link OPTIONS <optimization>space : -O2 ;
110 flags mipspro.link OPTIONS <linkflags> ;
111 flags mipspro.link LINKPATH <library-path> ;
112 flags mipspro.link FINDLIBS-ST <find-static-library> ;
113 flags mipspro.link FINDLIBS-SA <find-shared-library> ;
114 flags mipspro.link FINDLIBS-SA <threading>multi : pthread ;
115 flags mipspro.link LIBRARIES <library-file> ;
116 flags mipspro.link LINK-RUNTIME <runtime-link>static : static ;
117 flags mipspro.link LINK-RUNTIME <runtime-link>shared : dynamic ;
118 flags mipspro.link RPATH <dll-path> ;
119
120 rule link ( targets * : sources * : properties * )
121 {
122 SPACE on $(targets) = " " ;
123 }
124
125 actions link bind LIBRARIES
126 {
127 "$(CONFIG_COMMAND)" -FE:template_in_elf_section -ptused $(OPTIONS) -L"$(LINKPATH)" -R"$(RPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -Bdynamic -l$(FINDLIBS-SA) -Bstatic -l$(FINDLIBS-ST) -B$(LINK-RUNTIME) -lm
128 }
129
130 # Slight mods for dlls
131 rule link.dll ( targets * : sources * : properties * )
132 {
133 SPACE on $(targets) = " " ;
134 }
135
136 actions link.dll bind LIBRARIES
137 {
138 "$(CONFIG_COMMAND)" $(OPTIONS) -L"$(LINKPATH)" -R"$(RPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -Bdynamic -l$(FINDLIBS-SA) -Bstatic -l$(FINDLIBS-ST) -B$(LINK-RUNTIME)
139 }
140
141 # Declare action for creating static libraries
142 actions piecemeal archive
143 {
144 ar -cr "$(<)" "$(>)"
145 }