Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for Embarcardero C++ compilers based on clang-5.0 #551

Merged
merged 20 commits into from
Mar 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
e88393b
Updated borland.jam to support latest Embarcadero C++ using the 32-bi…
eldiener Feb 17, 2020
f7a5a9d
Don't pass command line options which bcc32c can not handle.
eldiener Feb 17, 2020
b485b81
Only set shared when creating DLL.
eldiener Feb 17, 2020
78d4949
Use -b- only with bcc32.
eldiener Mar 8, 2020
e4fa9ca
Add embarcadero toolset for C++ Builder using clang technology. This …
eldiener Mar 9, 2020
a1c81dd
Clean up conditional flags when the condition is not needed.
eldiener Mar 9, 2020
ad706a9
Fixed syntax and other errors.
eldiener Mar 9, 2020
1c412c1
More fixes for embarcadero jam file syntax problems. Set the default …
eldiener Mar 9, 2020
3cb53e8
Added support for static library archive with tlib/tlib64.
eldiener Mar 10, 2020
db74086
Update before further changes.
eldiener Mar 11, 2020
6c723ad
Simplify requirements.
eldiener Mar 11, 2020
13ed1fe
Dropped support for bcc32c since it errors out with quite a number of…
eldiener Mar 11, 2020
e85e343
Support for asm, archive, and user-interface options. Addition of pre…
eldiener Mar 12, 2020
a4856f6
Added docs. Removed precompiled headers.
eldiener Mar 13, 2020
b493b8c
Remove change to version.jam and put code locally into borland.jam.
eldiener Mar 13, 2020
6688642
Fixed a number of syntax issues. Fix the methods for finding the root…
eldiener Mar 14, 2020
b11c119
Adding address model options for compile and link.
eldiener Mar 15, 2020
138bb13
Added linker option to generate the import library.
eldiener Mar 16, 2020
b00baf1
Update import library switch to link.dll.
eldiener Mar 18, 2020
2349bef
Added my copyright to borland.jam toolset and fixed the creation of D…
eldiener Mar 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 105 additions & 55 deletions src/tools/borland.jam
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
# Copyright 2005 Dave Abrahams
# Copyright 2003 Rene Rivera
# Copyright 2003, 2004, 2005 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Copyright 2005 Dave Abrahams
# Copyright 2003 Rene Rivera
# Copyright 2003, 2004, 2005 Vladimir Prus
# Copyright (c) 2020 Edward Diener
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)

#| tag::doc[]

[[bbv2.reference.tools.compiler.borland]]
= Borland C++ Compiler

The `borland` module supports the command line C++ compiler included in
http://www.borland.com/us/products/cbuilder/index.html[C++ Builder 2006]
product and earlier version of it, running on Microsoft Windows.

The supported products are listed below. The version reported by the
command lines tools is also listed for reference.:

* C++ Builder 2006 -- 5.8.2
* CBuilderX -- 5.6.5, 5.6.4 (depending on release)
* CBuilder6 -- 5.6.4
* Free command line tools -- 5.5.1
The `borland` module supports the 32-bit command line C++ compilers
running on Microsoft Windows. This is the bcc32 executable for all
versions of Borland C++ and C++ Builder, as well as the command line
compatible compiler bcc32c on later versions of C++ Builder.

The module is initialized using the following syntax:

Expand All @@ -30,7 +24,7 @@ using borland : [version] : [c++-compile-command] : [compiler options] ;
This statement may be repeated several times, if you want to configure
several versions of the compiler.

If the command is not specified, B2 will search for a binary
If the command is not specified, Boost.Build will search for a binary
named `bcc32` in PATH.

The following options can be provided, using
Expand All @@ -51,6 +45,10 @@ and C++ sources.
`linkflags`::
Specifies additional command line options that will be passed to the linker.

`user-interface`::
Specifies the user interface for applications. Valid choices are `console`
for a console applicatiuon and `gui` for a Windows application.

|# # end::doc[]

# Support for the Borland's command line compiler
Expand All @@ -62,31 +60,100 @@ import toolset : flags ;
import feature : get-values ;
import type ;
import common ;
import version ;

feature.extend toolset : borland ;

rule init ( version ? : command * : options * )
{

local condition = [ common.check-init-parameters borland :
version $(version) ] ;

local command = [ common.get-invocation-command borland : bcc32.exe
local command = [ common.get-invocation-command borland : bcc32.exe
: $(command) ] ;

common.handle-options borland : $(condition) : $(command) : $(options) ;


local just_bcc32 = [ MATCH ".*(bcc32)([^a-z0-9]|$)" : $(command:L) ] ;

if $(command)
{
command = [ common.get-absolute-tool-path $(command[-1]) ] ;
}
root = $(command:D) ;

}
root = $(command:D) ;
flags borland.compile STDHDRS $(condition) : $(root)/include/ ;
flags borland.link STDLIBPATH $(condition) : $(root)/lib ;
flags borland.link RUN_PATH $(condition) : $(root)/bin ;
flags borland .root $(condition) : $(root)/bin/ ;
flags borland .root $(condition) : $(root)/bin/ ;

local jv ;

if $(version)
{
jv = [ MATCH "^([0-9.]+)" : $(version) ] ;
}
if ! $(jv) || [ version.version-less [ version-split $(jv) ] : 6 30 ]
{
init-earlier-releases $(condition) ;
}
else
{
init-later-releases $(condition) ;
}

if $(just_bcc32) && ( $(just_bcc32[1]) = bcc32 )
{
flags borland.compile OPTIONS $(condition) : -g255 -Vx- -Ve- -b- ;
}
}

# Splits a version in its form of n[.n][.n] into n n n etc.
#
local rule version-split ( v )
{
return [ SPLIT_BY_CHARACTERS $(v) : . ] ;
}

local rule init-earlier-releases ( condition )
{

# Deal with various runtime configs...

# This should be not for DLL
flags borland OPTIONS $(condition)/<user-interface>console : -tWC ;

# -tWR sets -tW as well, so we turn it off here and then turn it
# on again later if we need it:
flags borland OPTIONS $(condition)/<runtime-link>shared : -tWR -tWC ;

flags borland OPTIONS $(condition)/<main-target-type>LIB/<link>shared : -tWD ;
# Hmm.. not sure what's going on here.
flags borland OPTIONS $(condition) : -WM- ;
flags borland OPTIONS $(condition)/<threading>multi : -tWM ;

flags borland.link OPTIONS $(condition)/<link>shared : -tWD ;

}

local rule init-later-releases ( condition )
{

# Deal with various runtime configs...

# This should be not for DLL
flags borland OPTIONS $(condition)/<user-interface>console : -tC ;

flags borland OPTIONS $(condition)/<runtime-link>shared : -tR ;

flags borland OPTIONS $(condition)/<main-target-type>LIB/<link>shared : -tD ;
flags borland OPTIONS $(condition)/<main-target-type>EXE : -tC ;
flags borland OPTIONS $(condition)/<threading>multi : -tM ;

flags borland.link.dll OPTIONS $(condition)/<link>shared : -tD ;

}

# A borland-specific target type
type.register BORLAND.TDS : tds ;
Expand All @@ -101,7 +168,7 @@ generators.register-c-compiler borland.compile.c++ : CPP : OBJ : <toolset>borlan
generators.register-c-compiler borland.compile.c : C : OBJ : <toolset>borland ;
generators.register-standard borland.asm : ASM : OBJ : <toolset>borland ;

# Declare flags
# Declare flags

flags borland.compile OPTIONS <debug-symbols>on : -v ;
flags borland.link OPTIONS <debug-symbols>on : -v ;
Expand All @@ -125,24 +192,8 @@ flags borland.compile OPTIONS <warnings>off : -w- ;
flags borland.compile OPTIONS <warnings>all : -w ;
flags borland.compile OPTIONS <warnings-as-errors>on : -w! ;


# Deal with various runtime configs...

# This should be not for DLL
flags borland OPTIONS <user-interface>console : -tWC ;

# -tWR sets -tW as well, so we turn it off here and then turn it
# on again later if we need it:
flags borland OPTIONS <runtime-link>shared : -tWR -tWC ;
flags borland OPTIONS <user-interface>gui : -tW ;

flags borland OPTIONS <main-target-type>LIB/<link>shared : -tWD ;
# Hmm.. not sure what's going on here.
flags borland OPTIONS : -WM- ;
flags borland OPTIONS <threading>multi : -tWM ;



flags borland.compile OPTIONS <cflags> ;
flags borland.compile.c++ OPTIONS <cxxflags> ;
flags borland.compile DEFINES <define> ;
Expand All @@ -158,7 +209,7 @@ flags borland NEED_IMPLIB <main-target-type>LIB/<link>shared : "" ;
# -q no banner
# -c compile to object
# -P C++ code regardless of file extension
# -a8 8 byte alignment, this option is on in the IDE by default
# -a8 8 byte alignment, this option is on in the IDE by default
# and effects binary compatibility.
#

Expand All @@ -167,25 +218,24 @@ flags borland NEED_IMPLIB <main-target-type>LIB/<link>shared : "" ;

actions compile.c++
{
"$(CONFIG_COMMAND)" -j5 -g255 -q -c -P -a8 -Vx- -Ve- -b- $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -I"$(STDHDRS)" -o"$(<)" "$(>)"
"$(CONFIG_COMMAND)" -j5 -q -c -P -a8 $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -I"$(STDHDRS)" -o"$(<)" "$(>)"
}

# For C, we don't pass -P flag
actions compile.c
{
"$(CONFIG_COMMAND)" -j5 -g255 -q -c -a8 -Vx- -Ve- -b- $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -I"$(STDHDRS)" -o"$(<)" "$(>)"
"$(CONFIG_COMMAND)" -j5 -q -c -a8 $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -I"$(STDHDRS)" -o"$(<)" "$(>)"
}


# Declare flags and action for linking
toolset.flags borland.link OPTIONS <debug-symbols>on : -v ;
toolset.flags borland.link LIBRARY_PATH <library-path> ;
toolset.flags borland.link FINDLIBS_ST <find-static-library> ;
toolset.flags borland.link FINDLIBS_SA <find-shared-library> ;
toolset.flags borland.link LIBRARIES <library-file> ;
flags borland.link OPTIONS <debug-symbols>on : -v ;
flags borland.link LIBRARY_PATH <library-path> ;
flags borland.link FINDLIBS_ST <find-static-library> ;
flags borland.link FINDLIBS_SA <find-shared-library> ;
flags borland.link LIBRARIES <library-file> ;

flags borland.link OPTIONS <linkflags> ;
flags borland.link OPTIONS <link>shared : -tWD ;

flags borland.link LIBRARY_PATH_OPTION <toolset>borland : -L : unchecked ;
flags borland.link LIBRARY_OPTION <toolset>borland : "" : unchecked ;
Expand All @@ -205,7 +255,7 @@ flags borland.archive AROPTIONS <archiveflags> ;
# values tlib fails when building large applications.
# CONSIDER: don't know what 'together' is for...
actions updated together piecemeal archive
{
{
$(.set-path)$(.root:W)$(.old-path)
tlib $(AROPTIONS) /P256 /u /a /C "$(<:W)" +-"$(>:W)"
}
Expand All @@ -215,7 +265,7 @@ if [ os.name ] = CYGWIN
{
.set-path = "cmd /S /C set \"PATH=" ;
.old-path = ";%PATH%\" \"&&\"" ;


# Couldn't get TLIB to stop being confused about pathnames
# containing dashes (it seemed to treat them as option separators
Expand All @@ -224,11 +274,11 @@ if [ os.name ] = CYGWIN
# about pathname style! Forward slashes, too, are treated as
# options.
actions updated together piecemeal archive
{
{
chdir $(<:D)
echo +-$(>:BS) > $(<:BS).rsp
$(.set-path)$(.root)$(.old-path) "tlib.exe" $(AROPTIONS) /P256 /C $(<:BS) @$(<:BS).rsp && $(RM) $(<:BS).rsp
}
}
}
else if [ os.name ] = NT
{
Expand Down
Loading