From 7b360ad93351deca07ed3cdbf7512a7ca101316d Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 27 Jun 2003 22:05:03 +0000 Subject: [PATCH] Support use of unversioned and unrooted initialization of the toolset. In which case an attempt is made to find the intended root from a path search. Additionaly fixed the precense of -L"" when an unrooted initialization happens. [SVN r18882] --- src/tools/borland.jam | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/tools/borland.jam b/src/tools/borland.jam index 8c3734fe9..329e415bf 100644 --- a/src/tools/borland.jam +++ b/src/tools/borland.jam @@ -1,5 +1,6 @@ # (C) Copyright David Abrahams 2001. # (C) Copyright Vladimir Prus 2003. +# (C) Copyright Rene Rivera 2003. # Permission to copy, use, modify, sell and distribute this software # is granted provided this copyright notice appears in all copies. This # software is provided "as is" without express or implied warranty, and @@ -20,8 +21,8 @@ feature.subfeature toolset borland : version ; # Installation root to use for versionless toolset .root = "" ; -STDHDRS = "" ; -STDLIBPATH = "" ; +STDHDRS = ; +STDLIBPATH = ; rule init ( version ? : root ? ) @@ -32,11 +33,20 @@ rule init ( version ? : root ? ) # default values are not applied to subfeatures. if ! $(version) { + if ! $(root) + { + # versionless and rootless, we assume the user has bcc in the path + # so we try and find it, and set up the paths accordingly + import regex ; + import modules ; + local bcc = [ GLOB [ modules.peek : Path ] [ modules.peek : PATH ] : bcc32.exe ] ; + root = $(bcc[1]:D) ; root = $(root:P) ; + } if $(root) { - .root = $(root)/bin/ ; - STDHDRS = $(root)/include/ ; - STDLIBPATH = $(root)/lib ; + toolset.flags borland.compile STDHDRS borland : $(root)/include/ ; + toolset.flags borland.link STDLIBPATH borland : $(root)/lib ; + toolset.flags borland .root borland : $(root)/bin/ ; } } else @@ -50,8 +60,10 @@ rule init ( version ? : root ? ) root = $(root)/bin/ ; root ?= "" ; toolset.flags borland .root $(condition) : $(root) ; - - } + } + # strange that this return is needed, because if absent the + # unversioned/unrooted case doesn't work at all + return ; } @@ -208,6 +220,3 @@ actions link bind LIBRARIES $(.set-path)$(.root:W)$(.old-path) "$(.root)bcc32" -v -q $(OPTIONS) -L"$(LIBRARY_PATH:W)" -L"$(STDLIBPATH:W)" -e"$(<[1]:W)" @"$(>:W)" $(NEED_IMPLIB)"$(.root)implib" $(NEED_IMPLIB)"$(<[2]:W)" $(NEED_IMPLIB)"$(<[1]:W)" } - - -