1 | # (C) Copyright David Abrahams 2001. |
---|
2 | # Distributed under the Boost Software License, Version 1.0. |
---|
3 | # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) |
---|
4 | |
---|
5 | # The following #// line will be used by the regression test table generation |
---|
6 | # program as the column heading for HTML tables. Must not include version number. |
---|
7 | #//<a href="http://www.borland.com/bcppbuilder/freecompiler/">Borland</a> |
---|
8 | |
---|
9 | # Borland tool definitions. |
---|
10 | # |
---|
11 | # Please note that wide-character support is currently disabled for Borland in |
---|
12 | # features.jam, pending someone taking the time to figure out how to get the |
---|
13 | # appropriate libraries into the link command line. |
---|
14 | |
---|
15 | # BCCROOT is the install location of the borland tools. |
---|
16 | set-as-singleton BCCROOT ; |
---|
17 | |
---|
18 | # Get these variable set on the targets so that we can re-use the |
---|
19 | # build actions for other toolsets using this one as a base. |
---|
20 | flags borland BCC_TOOL_PATH ; |
---|
21 | |
---|
22 | # compute Borland tool path |
---|
23 | # You can either put the borland bin directory in your PATH, or you can set |
---|
24 | # BCCROOT to point at the borland installation directory |
---|
25 | BCC_TOOL_PATH = $(BCCROOT)$(SLASH)bin$(SLASH) ; |
---|
26 | BCC_TOOL_PATH ?= "" ; # Don't clobber adjoining text if BCCROOT isn't set |
---|
27 | |
---|
28 | # specify compilation and link flags |
---|
29 | flags borland CFLAGS <debug-symbols>on : -v ; |
---|
30 | flags borland LINKFLAGS <debug-symbols>on : -v ; |
---|
31 | flags borland CFLAGS <optimization>off : -Od ; |
---|
32 | flags borland CFLAGS <optimization>speed : -O2 ; |
---|
33 | flags borland CFLAGS <optimization>space : -O1 ; |
---|
34 | |
---|
35 | # Borland has inlining bugs that affect destructors |
---|
36 | # (http://lists.boost.org/boost-testing/2005/10/2079.php). Define |
---|
37 | # this variable to force inlining for Borland to always be shut off. |
---|
38 | # We decided it was a bad idea to do it by default, because it would |
---|
39 | # hide bugs that users would see. |
---|
40 | if ! $(.BORLAND_INLINING_BUG_BRUTE_FORCE_WORKAROUND) |
---|
41 | { |
---|
42 | flags borland CFLAGS <inlining>off : -vi- ; |
---|
43 | flags borland CFLAGS <inlining>on : -vi -w-inl ; |
---|
44 | flags borland CFLAGS <inlining>full : -vi -w-inl ; |
---|
45 | } |
---|
46 | else |
---|
47 | { |
---|
48 | flags borland CFLAGS : -vi- ; |
---|
49 | } |
---|
50 | |
---|
51 | # build the options common to the link and C/C++ command-lines |
---|
52 | { |
---|
53 | local bcc-common-flags ; |
---|
54 | |
---|
55 | # this section sets up the target type (threading, |
---|
56 | # RTL, and console/GUI options). The order in which |
---|
57 | # these options appear is generally important, as some |
---|
58 | # (such as -tWR) can have unexpected side effects. |
---|
59 | |
---|
60 | |
---|
61 | local target-type = [ get-values <target-type> : $(gBUILD_PROPERTIES) ] ; |
---|
62 | if ! $(target-type) || ! ( $(target-type) in $(SHARED_TYPES) ) |
---|
63 | { |
---|
64 | flags borland bcc-common-flags <user-interface>console : -tWC ; |
---|
65 | # -tWR sets -tW as well, so we turn it off here and then turn it |
---|
66 | # on again later if we need it: |
---|
67 | flags borland bcc-common-flags <runtime-link>dynamic : -tWR -tWC ; |
---|
68 | flags borland bcc-common-flags <user-interface>gui : -tW ; |
---|
69 | } |
---|
70 | else |
---|
71 | { |
---|
72 | flags borland bcc-common-flags <runtime-link>dynamic : -tWR ; |
---|
73 | } |
---|
74 | |
---|
75 | flags borland bcc-common-flags <target-type>$(SHARED_TYPES) : -tWD ; |
---|
76 | flags borland bcc-common-flags : -WM- ; |
---|
77 | flags borland bcc-common-flags <threading>multi : -tWM ; |
---|
78 | |
---|
79 | flags borland LINKFLAGS : $(bcc-common-flags) ; |
---|
80 | flags borland CFLAGS : $(bcc-common-flags) ; |
---|
81 | } |
---|
82 | |
---|
83 | |
---|
84 | flags borland LINKFLAGS <unicode-application>on : -WU ; |
---|
85 | flags borland CFLAGS <unicode-application>on : -WU ; |
---|
86 | |
---|
87 | flags borland CFLAGS <cflags> ; |
---|
88 | flags borland C++FLAGS <cxxflags> ; |
---|
89 | flags borland DEFINES <define> ; |
---|
90 | flags borland UNDEFS <undef> ; |
---|
91 | flags borland HDRS <include> ; |
---|
92 | flags borland SYSHDRS <sysinclude> ; |
---|
93 | flags borland LINKFLAGS <linkflags> ; |
---|
94 | flags borland ARFLAGS <arflags> ; |
---|
95 | |
---|
96 | flags borland STDHDRS : $(BCCROOT)$(SLASH)include ; |
---|
97 | flags borland STDLIBPATH : $(BCCROOT)$(SLASH)lib ; |
---|
98 | |
---|
99 | flags borland LIBPATH <library-path> ; |
---|
100 | flags borland NEEDLIBS <library-file> ; |
---|
101 | flags borland FINDLIBS <find-library> ; |
---|
102 | |
---|
103 | # suppress some specific warnings |
---|
104 | |
---|
105 | flags borland C++FLAGS : -w-8001 ; |
---|
106 | |
---|
107 | # For detailed information about borland tools and their command-line switches, |
---|
108 | # see http://www.objectcentral.com/vide/help/videdoc/bcc32.html |
---|
109 | |
---|
110 | #### Link #### |
---|
111 | |
---|
112 | rule Link-action |
---|
113 | { |
---|
114 | # Make sure that the borland runtime dlls are in the runtime path |
---|
115 | gRUN_PATH($(<)) += $(BCC_TOOL_PATH) ; |
---|
116 | |
---|
117 | with-command-file borland-Link-action $(<) : $(>) $(NEEDLIBS) ; |
---|
118 | |
---|
119 | if $(3) in $(SHARED_TYPES) |
---|
120 | { |
---|
121 | borland-IMPLIB-action $(<) : $(>) ; |
---|
122 | } |
---|
123 | } |
---|
124 | |
---|
125 | # bcc32 needs to have ilink32 in the path in order to invoke it, so explicitly |
---|
126 | # specifying $(BCC_TOOL_PATH)bcc32 doesn't help. You need to add |
---|
127 | # $(BCC_TOOL_PATH) to the path |
---|
128 | if $(NT) |
---|
129 | { |
---|
130 | actions borland-Link-action |
---|
131 | { |
---|
132 | set "PATH=$(BCC_TOOL_PATH);%PATH%" |
---|
133 | "$(BCC_TOOL_PATH)bcc32" -v -q $(LINKFLAGS) -L"$(LIBPATH)" -L"$(STDLIBPATH)" -e"$(<[1])" @"$(>)" $(FINDLIBS:S=.lib) |
---|
134 | } |
---|
135 | } |
---|
136 | else |
---|
137 | { |
---|
138 | actions borland-Link-action |
---|
139 | { |
---|
140 | export PATH=$(BCC_TOOL_PATH):$PATH |
---|
141 | "$(BCC_TOOL_PATH)bcc32" -v -q $(LINKFLAGS) -L"$(LIBPATH)" -L"$(STDLIBPATH)" -e"$(<[1])" @"$(>)" $(FINDLIBS:S=.lib) |
---|
142 | } |
---|
143 | } |
---|
144 | |
---|
145 | actions borland-IMPLIB-action bind IMPLIB |
---|
146 | { |
---|
147 | $(BCC_TOOL_PATH)implib $(<[2]) $(<[1]) |
---|
148 | } |
---|
149 | |
---|
150 | #### Cc ##### |
---|
151 | |
---|
152 | rule Cc-action |
---|
153 | { |
---|
154 | borland-Cc-action $(<) : $(>) ; |
---|
155 | } |
---|
156 | |
---|
157 | actions borland-Cc-action |
---|
158 | { |
---|
159 | "$(BCC_TOOL_PATH)bcc32" -j5 -g255 -q -c -w -a8 -b- -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -I"$(SYSHDRS)" -o"$(<)" "$(>)" |
---|
160 | } |
---|
161 | |
---|
162 | #### C++ #### |
---|
163 | rule C++-action |
---|
164 | { |
---|
165 | borland-C++-action $(<) : $(>) ; |
---|
166 | } |
---|
167 | |
---|
168 | # |
---|
169 | # for C++ compiles the following options are turned on by default: |
---|
170 | # |
---|
171 | # -j5 stops after 5 errors |
---|
172 | # -g255 allow an unlimited number of warnings |
---|
173 | # -q no banner |
---|
174 | # -c compile to object |
---|
175 | # -P C++ code regardless of file extention |
---|
176 | # -w turns on all warnings |
---|
177 | # -Ve zero sized empty base classes, this option is on in the IDE by default |
---|
178 | # and effects binary compatibility. |
---|
179 | # -Vx zero sized empty members, this option is on in the IDE by default |
---|
180 | # and effects binary compatibility. |
---|
181 | # -a8 8 byte alignment, this option is on in the IDE by default |
---|
182 | # and effects binary compatibility. |
---|
183 | # |
---|
184 | actions borland-C++-action |
---|
185 | { |
---|
186 | "$(BCC_TOOL_PATH)bcc32" -j5 -g255 -q -c -P -w -Ve -Vx -a8 -b- -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -I"$(SYSHDRS)" -o"$(<)" "$(>)" |
---|
187 | } |
---|
188 | |
---|
189 | if ! $(BORLAND_ARCHIVE_LINESEP) |
---|
190 | { |
---|
191 | if $(NT) |
---|
192 | { |
---|
193 | if [ W32_GETREG "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" : CurrentVersion ] |
---|
194 | { |
---|
195 | BORLAND-ARCHIVE-LINESEP = " ^&" ; |
---|
196 | } |
---|
197 | } |
---|
198 | BORLAND-ARCHIVE-LINESEP ?= " &" ; |
---|
199 | } |
---|
200 | |
---|
201 | #### Archive #### |
---|
202 | rule Archive-action |
---|
203 | { |
---|
204 | with-command-file borland-Archive-action $(<) : $(>) : + $(BORLAND-ARCHIVE-LINESEP) ; |
---|
205 | } |
---|
206 | |
---|
207 | actions borland-Archive-action |
---|
208 | { |
---|
209 | IF EXIST "$(<)" DEL "$(<)" |
---|
210 | "$(BCC_TOOL_PATH)tlib" /P64 /u /a /C /$(ARFLAGS) "$(<)" @"$(>)" |
---|
211 | } |
---|