Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/tools/build/v1/mipspro-tools.jam @ 12

Last change on this file since 12 was 12, checked in by landauf, 17 years ago

added boost

File size: 8.3 KB
Line 
1# This file was originally based on gcc-tools.jam by David Abrahams.
2#
3# It has been written for and tested with MIPSpro 7.3 on IRIX 6.5
4# with a variety of setups.
5#
6# TODO list (in no particular order):
7#
8# - Add support for the dllversion free-feature using MIPSpro's
9#   soname support.
10# - Factor out repetitive code.
11# - Decide if `$(<[1])' is better than `$(<)'.
12# - Make further use of the `architecture' free feature by using
13#   `-TARG' and others.
14# - A free feature `mipspro-woff' so users can specify woff
15#   values at the command-line.
16# - Figure out what to do with the so_locations file.
17# - Figure out what to do with the ii_files directory.
18
19# The following #// line will be used by the regression test table generation
20# program as the column heading for HTML tables. Must not include version number.
21#//<a href="http://www.sgi.com/developers/devtools/languages/mipspro.html">SGI<br>MIPSpro</a>
22
23# compute directories for invoking MIPSpro: first try ROOT and
24# TOOLROOT, which are traditionally used for this purpose.
25MIPSPRO_ROOT_DIRECTORY ?= "$(ROOT)/usr" ;
26MIPSPRO_TOOLROOT_DIRECTORY ?= "$(TOOLROOT)/usr" ;
27
28# Either ROOT or TOOLROOT missing? Fall back to the default.
29MIPSPRO_ROOT_DIRECTORY ?= "/usr" ;
30MIPSPRO_TOOLROOT_DIRECTORY ?= "/usr" ;
31
32# For most users, either ROOT/TOOLROOT or
33# MIPSPRO_ROOT_DIRECTORY/MIPSPRO_TOOLROOT_DIRECTORY should be
34# sufficient. Users needing to further customize the executable
35# directory or include directory can use MIPSPRO_BIN_DIRECTORY,
36# MIPSPRO_INCLUDE_DIRECTORY, and MIPSPRO_C++INCLUDE_DIRECTORY.
37
38MIPSPRO_BIN_DIRECTORY ?= "$(MIPSPRO_TOOLROOT_DIRECTORY)/bin" ;
39
40MIPSPRO_INCLUDE_DIRECTORY ?= "$(MIPSPRO_TOOLROOT_DIRECTORY)/include"
41                             "$(MIPSPRO_ROOT_DIRECTORY)/include" ;
42
43MIPSPRO_C++INCLUDE_DIRECTORY ?= "$(MIPSPRO_INCLUDE_DIRECTORY)/CC" ;
44
45# Because we have special logic for finding directories based on
46# the ABI and ISA, it is difficult to have a separate user-definable
47# variable to specify the library paths. As mentioned above,
48# MIPSPRO_ROOT_DIRECTORY should be good enough for most users.
49
50local MIPSPRO_STDLIB_ROOTS = "$(MIPSPRO_TOOLROOT_DIRECTORY)"
51                             "$(MIPSPRO_ROOT_DIRECTORY)"
52                           ;
53local MIPSPRO_STDLIB_MIPS3_SUBDIRECTORIES = "mips3" "" ;
54local MIPSPRO_STDLIB_MIPS4_SUBDIRECTORIES = "mips4" "" ;
55
56flags mipspro LINKFLAGS : -nostdlib ;
57flags mipspro LINKFLAGS <target-type>$(SHARED_TYPES) : -shared ;
58flags mipspro LINKFLAGS <debug-symbols>off : -s ;
59
60# We better link the maths library unconditionally.
61flags mipspro FINDLIBS : m ;
62
63flags mipspro DEFINES <threading>multi : _SGI_MP_SOURCE ;
64flags mipspro FINDLIBS <threading>multi : pthread ;
65
66flags mipspro CFLAGS : -nostdinc
67                       -LANG:std -OPT:Olimit=0 -OPT:IEEE_NaN_inf=ON -no_auto_include
68                     ;
69
70flags mipspro CFLAGS <address-model>default : -n32 ;
71flags mipspro CFLAGS <address-model>32 : -n32 ;
72flags mipspro CFLAGS <address-model>64 : -64 ;
73flags mipspro CFLAGS <architecture>native : -mips3 ;
74flags mipspro CFLAGS <architecture>mips3 : -mips3 ;
75flags mipspro CFLAGS <architecture>mips4 : -mips4 ;
76
77flags mipspro CFLAGS <optimization>off   : -O0 ;
78flags mipspro CFLAGS <optimization>speed : -O3 ;
79flags mipspro CFLAGS <optimization>space : -O2 ;
80
81flags mipspro CFLAGS <debug-symbols>off : -g0 ;
82flags mipspro CFLAGS <debug-symbols>on/<optimization>off   : -g  ;
83flags mipspro CFLAGS <debug-symbols>on/<optimization>speed : -g3 ;
84flags mipspro CFLAGS <debug-symbols>on/<optimization>space : -g3 ;
85
86# Uncomment the following to enable various SGI extensions.
87
88#flags mipspro DEFINES : _SGI_SOURCE ;
89
90# If you want more warnings, uncomment the following lines. These are
91# a few warning numbers that you'll probably want to disable.
92# 1375: The destructor for base class is not virtual.
93# 1424: Template parameter not used in declaring the argument types of function template.
94# 1234: Access control is not specified.
95
96#flags mipspro CFLAGS : -fullwarn -woff 1375,1424,1234 ;
97
98# For some C++ apps, adding -IPA can make a big difference. However, because
99# it does global optimizations such as inlining code between compilation
100# units, it introduces a lot of dependancies that this build system is
101# unable to track. When using -IPA here, be sure to run the `clean' target
102# before each build to ensure that everything is rebuilt properly.
103
104#flags mipspro CFLAGS <optimization>speed : -IPA ;
105#flags mipspro LINKFLAGS <optimization>speed : -IPA ;
106
107# An option for <inlining>full is -INLINE:all, however that may cause
108# too much to be inlined. I don't think that level of inlining is what
109# is meant by <inlining>full.
110
111flags mipspro CFLAGS <inlining>off : -INLINE:none ;
112flags mipspro CFLAGS <inlining>on : -INLINE ;
113flags mipspro CFLAGS <inlining>full : -INLINE ;
114
115flags mipspro C++FLAGS <exception-handling>off : -LANG:exceptions=OFF ;
116
117flags mipspro STDHDRS : "$(MIPSPRO_INCLUDE_DIRECTORY)" ;
118flags mipspro STDC++HDRS : "$(MIPSPRO_C++INCLUDE_DIRECTORY)"
119                           "$(BOOST_ROOT)/boost/compatibility/cpp_c_headers"
120                         ;
121
122flags mipspro STDLIBPATH <address-model>default/<architecture>mips3 <architecture>native :
123     "$(MIPSPRO_STDLIB_ROOTS)/lib32/$(MIPSPRO_STDLIB_MIPS3_SUBDIRECTORIES)"
124      ;
125flags mipspro STDLIBPATH <address-model>default/<architecture>mips4 :
126     "$(MIPSPRO_STDLIB_ROOTS)/lib32/$(MIPSPRO_STDLIB_MIPS4_SUBDIRECTORIES)"
127      ;
128flags mipspro STDLIBPATH <address-model>32/<architecture>mips3 <architecture>native :
129     "$(MIPSPRO_STDLIB_ROOTS)/lib32/$(MIPSPRO_STDLIB_MIPS3_SUBDIRECTORIES)"
130      ;
131flags mipspro STDLIBPATH <address-model>32/<architecture>mips4 :
132     "$(MIPSPRO_STDLIB_ROOTS)/lib32/$(MIPSPRO_STDLIB_MIPS4_SUBDIRECTORIES)"
133      ;
134flags mipspro STDLIBPATH <address-model>64/<architecture>mips3 <architecture>native :
135     "$(MIPSPRO_STDLIB_ROOTS)/lib64/$(MIPSPRO_STDLIB_MIPS3_SUBDIRECTORIES)"
136      ;
137flags mipspro STDLIBPATH <address-model>64/<architecture>mips4 :
138     "$(MIPSPRO_STDLIB_ROOTS)/lib64/$(MIPSPRO_STDLIB_MIPS4_SUBDIRECTORIES)"
139      ;
140
141flags mipspro HDRS <include> ;
142flags mipspro UNDEFS <undef> ;
143flags mipspro DEFINES <define> ;
144flags mipspro CFLAGS <cflags> ;
145flags mipspro C++FLAGS <cxxflags> ;
146flags mipspro LIBPATH <library-path> ;
147flags mipspro NEEDLIBS <library-file> ;
148flags mipspro FINDLIBS <find-library> ;
149flags mipspro SYSHDRS <sysinclude> ;
150flags mipspro LINKFLAGS <linkflags> ;
151flags mipspro ARFLAGS <arflags> ;
152
153#### Link (for C++) ####
154
155rule Link-action
156{
157    mipspro-Link-action "$(<)" : "$(>)" ;
158}
159
160# for mipspro, we repeat all libraries so that dependencies are always resolved
161actions mipspro-Link-action bind NEEDLIBS
162{
163    "$(MIPSPRO_BIN_DIRECTORY)/CC" \
164        -o "$(<)" \
165        "$(>)" \
166        "-U$(UNDEFS)" \
167        "-D$(DEFINES)" \
168        "$(CFLAGS)" \
169        "$(C++FLAGS)" \
170        "-I$(HDRS)" \
171        "-I$(STDC++HDRS)" \
172        "-I$(STDHDRS)" \
173        "-I$(SYSHDRS)" \
174        "$(LINKFLAGS)" \
175        "$(NEEDLIBS)" \
176        "$(NEEDLIBS)" \
177        "-L$(LIBPATH)" \
178        "-L$(STDLIBPATH)" \
179        "-l$(FINDLIBS)"
180}
181
182#### Cc #####
183
184rule Cc-action
185{
186    mipspro-Cc-action "$(<)" : "$(>)" ;
187}
188
189actions mipspro-Cc-action
190{
191    "$(MIPSPRO_BIN_DIRECTORY)/cc" -c \
192        "-U$(UNDEFS)" \
193        "-D$(DEFINES)" \
194        "$(CFLAGS)" \
195        "-I$(HDRS)" \
196        "-I$(STDHDRS)" \
197        "-I$(SYSHDRS)" \
198        -o "$(<)" \
199        "$(>)"
200}
201
202#### C++ ####
203
204rule C++-action
205{
206    mipspro-C++-action "$(<)" : "$(>)" ;
207}
208
209actions mipspro-C++-action
210{
211    "$(MIPSPRO_BIN_DIRECTORY)/CC" -c \
212        "-U$(UNDEFS)" \
213        "-D$(DEFINES)" \
214        "$(CFLAGS)" \
215        "$(C++FLAGS)" \
216        "-I$(HDRS)" \
217        "-I$(STDC++HDRS)" \
218        "-I$(STDHDRS)" \
219        "-I$(SYSHDRS)" \
220        -o "$(<)" \
221        "$(>)"
222}
223
224#### Archive ####
225
226rule Archive-action
227{
228    mipspro-Archive-action "$(<)" : "$(>)" ;
229}
230
231# For MIPSpro, we don't use update piecemeal together because we're
232# not using the command `ar' directly. We use `CC -ar' so that the
233# prelinker gets run, however when we do this, we loose the ability
234# to update individual compilation units in an archive.
235
236actions mipspro-Archive-action
237{
238    "$(MIPSPRO_BIN_DIRECTORY)/CC" -ar \
239        "-U$(UNDEFS)" \
240        "-D$(DEFINES)" \
241        "$(CFLAGS)" \
242        "$(C++FLAGS)" \
243        "-I$(HDRS)" \
244        "-I$(STDC++HDRS)" \
245        "-I$(STDHDRS)" \
246        "-I$(SYSHDRS)" \
247        "-WR,$(ARFLAGS)" \
248        -o "$(<)" \
249        "$(>)"
250}
Note: See TracBrowser for help on using the repository browser.