]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/tools/build/src/tools/borland.jam
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / tools / build / src / tools / borland.jam
CommitLineData
7c673cae
FG
1# Copyright 2005 Dave Abrahams
2# Copyright 2003 Rene Rivera
3# Copyright 2003, 2004, 2005 Vladimir Prus
4# Distributed under the Boost Software License, Version 1.0.
5# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
6
92f5a8d4
TL
7#| tag::doc[]
8
9[[bbv2.reference.tools.compiler.borland]]
10= Borland C++ Compiler
11
12The `borland` module supports the command line C++ compiler included in
13http://www.borland.com/us/products/cbuilder/index.html[C++ Builder 2006]
14product and earlier version of it, running on Microsoft Windows.
15
16The supported products are listed below. The version reported by the
17command lines tools is also listed for reference.:
18
19* C++ Builder 2006 -- 5.8.2
20* CBuilderX -- 5.6.5, 5.6.4 (depending on release)
21* CBuilder6 -- 5.6.4
22* Free command line tools -- 5.5.1
23
24The module is initialized using the following syntax:
25
26----
27using borland : [version] : [c++-compile-command] : [compiler options] ;
28----
29
30This statement may be repeated several times, if you want to configure
31several versions of the compiler.
32
33If the command is not specified, Boost.Build will search for a binary
34named `bcc32` in PATH.
35
36The following options can be provided, using
37_`<option-name>option-value syntax`_:
38
39`cflags`::
40Specifies additional compiler flags that will be used when compiling C
41sources.
42
43`cxxflags`::
44Specifies additional compiler flags that will be used when compiling C++
45sources.
46
47`compileflags`::
48Specifies additional compiler flags that will be used when compiling both C
49and C++ sources.
50
51`linkflags`::
52Specifies additional command line options that will be passed to the linker.
53
54|# # end::doc[]
55
7c673cae
FG
56# Support for the Borland's command line compiler
57
58import property ;
59import generators ;
60import os ;
61import toolset : flags ;
62import feature : get-values ;
63import type ;
64import common ;
65
66feature.extend toolset : borland ;
67
68rule init ( version ? : command * : options * )
69{
70 local condition = [ common.check-init-parameters borland :
71 version $(version) ] ;
72
73 local command = [ common.get-invocation-command borland : bcc32.exe
74 : $(command) ] ;
75
76 common.handle-options borland : $(condition) : $(command) : $(options) ;
77
78 if $(command)
79 {
80 command = [ common.get-absolute-tool-path $(command[-1]) ] ;
81 }
82 root = $(command:D) ;
83
84 flags borland.compile STDHDRS $(condition) : $(root)/include/ ;
85 flags borland.link STDLIBPATH $(condition) : $(root)/lib ;
86 flags borland.link RUN_PATH $(condition) : $(root)/bin ;
87 flags borland .root $(condition) : $(root)/bin/ ;
88}
89
90
91# A borland-specific target type
92type.register BORLAND.TDS : tds ;
93
94# Declare generators
95
96generators.register-linker borland.link : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB : EXE : <toolset>borland ;
97generators.register-linker borland.link.dll : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB : SHARED_LIB IMPORT_LIB : <toolset>borland ;
98
99generators.register-archiver borland.archive : OBJ : STATIC_LIB : <toolset>borland ;
100generators.register-c-compiler borland.compile.c++ : CPP : OBJ : <toolset>borland ;
101generators.register-c-compiler borland.compile.c : C : OBJ : <toolset>borland ;
102generators.register-standard borland.asm : ASM : OBJ : <toolset>borland ;
103
104# Declare flags
105
106flags borland.compile OPTIONS <debug-symbols>on : -v ;
107flags borland.link OPTIONS <debug-symbols>on : -v ;
108
109flags borland.compile OPTIONS <optimization>off : -Od ;
110flags borland.compile OPTIONS <optimization>speed : -O2 ;
111flags borland.compile OPTIONS <optimization>space : -O1 ;
112
113if $(.BORLAND_HAS_FIXED_INLINING_BUGS)
114{
115 flags borland CFLAGS <inlining>off : -vi- ;
116 flags borland CFLAGS <inlining>on : -vi -w-inl ;
117 flags borland CFLAGS <inlining>full : -vi -w-inl ;
118}
119else
120{
121 flags borland CFLAGS : -vi- ;
122}
123
124flags borland.compile OPTIONS <warnings>off : -w- ;
125flags borland.compile OPTIONS <warnings>all : -w ;
126flags borland.compile OPTIONS <warnings-as-errors>on : -w! ;
127
128
129# Deal with various runtime configs...
130
131# This should be not for DLL
132flags borland OPTIONS <user-interface>console : -tWC ;
133
134# -tWR sets -tW as well, so we turn it off here and then turn it
135# on again later if we need it:
136flags borland OPTIONS <runtime-link>shared : -tWR -tWC ;
137flags borland OPTIONS <user-interface>gui : -tW ;
138
139flags borland OPTIONS <main-target-type>LIB/<link>shared : -tWD ;
140# Hmm.. not sure what's going on here.
141flags borland OPTIONS : -WM- ;
142flags borland OPTIONS <threading>multi : -tWM ;
143
144
145
146flags borland.compile OPTIONS <cflags> ;
147flags borland.compile.c++ OPTIONS <cxxflags> ;
148flags borland.compile DEFINES <define> ;
149flags borland.compile INCLUDES <include> ;
150
151flags borland NEED_IMPLIB <main-target-type>LIB/<link>shared : "" ;
152
153#
154# for C++ compiles the following options are turned on by default:
155#
156# -j5 stops after 5 errors
157# -g255 allow an unlimited number of warnings
158# -q no banner
159# -c compile to object
92f5a8d4 160# -P C++ code regardless of file extension
7c673cae
FG
161# -a8 8 byte alignment, this option is on in the IDE by default
162# and effects binary compatibility.
163#
164
165# -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o"$(<)" "$(>)"
166
167
168actions compile.c++
169{
170 "$(CONFIG_COMMAND)" -j5 -g255 -q -c -P -a8 -Vx- -Ve- -b- $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -I"$(STDHDRS)" -o"$(<)" "$(>)"
171}
172
173# For C, we don't pass -P flag
174actions compile.c
175{
176 "$(CONFIG_COMMAND)" -j5 -g255 -q -c -a8 -Vx- -Ve- -b- $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -I"$(STDHDRS)" -o"$(<)" "$(>)"
177}
178
179
180# Declare flags and action for linking
181toolset.flags borland.link OPTIONS <debug-symbols>on : -v ;
182toolset.flags borland.link LIBRARY_PATH <library-path> ;
183toolset.flags borland.link FINDLIBS_ST <find-static-library> ;
184toolset.flags borland.link FINDLIBS_SA <find-shared-library> ;
185toolset.flags borland.link LIBRARIES <library-file> ;
186
187flags borland.link OPTIONS <linkflags> ;
188flags borland.link OPTIONS <link>shared : -tWD ;
189
190flags borland.link LIBRARY_PATH_OPTION <toolset>borland : -L : unchecked ;
191flags borland.link LIBRARY_OPTION <toolset>borland : "" : unchecked ;
192
193
194
195# bcc32 needs to have ilink32 in the path in order to invoke it, so explicitly
196# specifying $(BCC_TOOL_PATH)bcc32 doesn't help. You need to add
197# $(BCC_TOOL_PATH) to the path
198# The NEED_IMPLIB variable controls whether we need to invoke implib.
199
200flags borland.archive AROPTIONS <archiveflags> ;
201
202# Declare action for archives. We don't use response file
203# since it's hard to get "+-" there.
204# The /P256 increases 'page' size -- with too low
205# values tlib fails when building large applications.
206# CONSIDER: don't know what 'together' is for...
207actions updated together piecemeal archive
208{
209 $(.set-path)$(.root:W)$(.old-path)
210 tlib $(AROPTIONS) /P256 /u /a /C "$(<:W)" +-"$(>:W)"
211}
212
213
214if [ os.name ] = CYGWIN
215{
216 .set-path = "cmd /S /C set \"PATH=" ;
217 .old-path = ";%PATH%\" \"&&\"" ;
218
219
220 # Couldn't get TLIB to stop being confused about pathnames
221 # containing dashes (it seemed to treat them as option separators
222 # when passed through from bash), so we explicitly write the
223 # command into a .bat file and execute that. TLIB is also finicky
224 # about pathname style! Forward slashes, too, are treated as
225 # options.
226 actions updated together piecemeal archive
227 {
228 chdir $(<:D)
229 echo +-$(>:BS) > $(<:BS).rsp
230 $(.set-path)$(.root)$(.old-path) "tlib.exe" $(AROPTIONS) /P256 /C $(<:BS) @$(<:BS).rsp && $(RM) $(<:BS).rsp
231 }
232}
233else if [ os.name ] = NT
234{
235 .set-path = "set \"PATH=" ;
236 .old-path = ";%PATH%\"
237 " ;
238}
239else
240{
241 .set-path = "PATH=\"" ;
242 .old-path = "\":$PATH
243 export PATH
244 " ;
245}
246
247RM = [ common.rm-command ] ;
248
249nl = "
250" ;
251
252actions link
253{
254 $(.set-path)$(.root:W)$(.old-path) "$(CONFIG_COMMAND)" -v -q $(OPTIONS) -L"$(LIBRARY_PATH:W)" -L"$(STDLIBPATH:W)" -e"$(<[1]:W)" @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")"
255}
256
257
258actions link.dll bind LIBRARIES RSP
259{
260 $(.set-path)$(.root:W)$(.old-path) "$(CONFIG_COMMAND)" -v -q $(OPTIONS) -L"$(LIBRARY_PATH:W)" -L"$(STDLIBPATH:W)" -e"$(<[1]:W)" @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")" && "$(.root)implib" "$(<[2]:W)" "$(<[1]:W)"
261}
262
263# It seems impossible to specify output file with directory when compiling
264# asm files using bcc32, so use tasm32 directly.
265# /ml makes all symbol names case-sensitive
266actions asm
267{
268 $(.set-path)$(.root:W)$(.old-path) tasm32.exe /ml "$(>)" "$(<)"
269}
270