diff --git a/src/build/version.jam b/src/build/version.jam index fa34d32d2..3092a5d99 100644 --- a/src/build/version.jam +++ b/src/build/version.jam @@ -99,6 +99,12 @@ rule version-less ( lhs + : rhs + ) return $(result) ; } +# Splits a version in its form of n[.n][.n] into n n n etc. +# +rule version-split ( v ) +{ +return [ SPLIT_BY_CHARACTERS $(v) : . ] ; +} # Returns "true" if the current JAM version version is at least the given # version. @@ -142,6 +148,8 @@ rule __test__ ( ) assert.true check-jam-version $(jam-version) ; assert.false check-jam-version $(future-version) ; + assert.result 8 4 2 : version-split 8.4.2 ; + assert.true version-less 0 : 1 ; assert.false version-less 0 : 0 ; assert.true version-less 1 : 2 ; diff --git a/src/tools/borland.jam b/src/tools/borland.jam index f8b8a0dcb..bd2cc5265 100644 --- a/src/tools/borland.jam +++ b/src/tools/borland.jam @@ -62,6 +62,7 @@ import toolset : flags ; import feature : get-values ; import type ; import common ; +import version ; feature.extend toolset : borland ; @@ -85,8 +86,60 @@ rule init ( version ? : command * : options * ) flags borland.link STDLIBPATH $(condition) : $(root)/lib ; flags borland.link RUN_PATH $(condition) : $(root)/bin ; flags borland .root $(condition) : $(root)/bin/ ; + + local jv ; + + if $(version) + { + jv = [ MATCH "^([0-9.]+)" : $(version) ] ; + } + if ! $(jv) || [ version.version-less [ version.version-split $(jv) ] : 6 30 ] + { + init-earlier-releases $(condition) ; + } + else + { + init-later-releases $(condition) ; + } } +local rule init-earlier-releases ( condition ) +{ + +# Deal with various runtime configs... + +# This should be not for DLL +flags borland OPTIONS $(condition)/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)/shared : -tWR -tWC ; + +flags borland OPTIONS $(condition)/LIB/shared : -tWD ; +# Hmm.. not sure what's going on here. +flags borland OPTIONS $(condition) : -WM- ; +flags borland OPTIONS $(condition)/multi : -tWM ; + +flags borland.link OPTIONS $(condition)/shared : -tWD ; + +} + +local rule init-later-releases ( condition ) +{ + +# Deal with various runtime configs... + +# This should be not for DLL +flags borland OPTIONS $(condition)/console : -tC ; + +flags borland OPTIONS $(condition)/shared : -tR ; + +flags borland OPTIONS $(condition)/LIB/shared : -tD ; +flags borland OPTIONS $(condition)/multi : -tM ; + +flags borland.link OPTIONS $(condition)/shared : -tD ; + +} # A borland-specific target type type.register BORLAND.TDS : tds ; @@ -125,24 +178,8 @@ flags borland.compile OPTIONS off : -w- ; flags borland.compile OPTIONS all : -w ; flags borland.compile OPTIONS on : -w! ; - -# Deal with various runtime configs... - -# This should be not for DLL -flags borland OPTIONS 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 shared : -tWR -tWC ; flags borland OPTIONS gui : -tW ; -flags borland OPTIONS LIB/shared : -tWD ; -# Hmm.. not sure what's going on here. -flags borland OPTIONS : -WM- ; -flags borland OPTIONS multi : -tWM ; - - - flags borland.compile OPTIONS ; flags borland.compile.c++ OPTIONS ; flags borland.compile DEFINES ; @@ -185,7 +222,6 @@ toolset.flags borland.link FINDLIBS_SA ; toolset.flags borland.link LIBRARIES ; flags borland.link OPTIONS ; -flags borland.link OPTIONS shared : -tWD ; flags borland.link LIBRARY_PATH_OPTION borland : -L : unchecked ; flags borland.link LIBRARY_OPTION borland : "" : unchecked ;