Boost logo

Boost-Commit :

From: ghost_at_[hidden]
Date: 2007-12-25 04:11:38


Author: vladimir_prus
Date: 2007-12-25 04:11:37 EST (Tue, 25 Dec 2007)
New Revision: 42295
URL: http://svn.boost.org/trac/boost/changeset/42295

Log:
Fix detection of RC compiler presense, and null obj fallback.

Thanks to Juergen Hunold for the bug report.

Text files modified:
   trunk/tools/build/v2/tools/common.jam | 53 ++++++++++++++++++++++++---------------
   trunk/tools/build/v2/tools/gcc.jam | 2
   2 files changed, 34 insertions(+), 21 deletions(-)

Modified: trunk/tools/build/v2/tools/common.jam
==============================================================================
--- trunk/tools/build/v2/tools/common.jam (original)
+++ trunk/tools/build/v2/tools/common.jam 2007-12-25 04:11:37 EST (Tue, 25 Dec 2007)
@@ -236,43 +236,56 @@
 # find the tool, a warning is issued.
 # If 'path-last' is specified, PATH is checked after 'additional-paths' when
 # searching to 'tool'.
-rule get-invocation-command (
+rule get-invocation-command-nodefault (
     toolset : tool : user-provided-command * : additional-paths * : path-last ? )
 {
     local command ;
     if ! $(user-provided-command)
     {
         command = [ common.find-tool $(tool) : $(additional-paths) : $(path-last) ] ;
- if ! $(command)
+ if ! $(command) && $(.debug-configuration)
         {
- if $(.debug-configuration)
- {
- ECHO "warning: toolset $(toolset) initialization: can't find tool $(tool)" ;
- ECHO "warning: initialized from" [ errors.nearest-user-location ] ;
- }
- command = $(tool) ;
- }
+ ECHO "warning: toolset $(toolset) initialization: can't find tool $(tool)" ;
+ ECHO "warning: initialized from" [ errors.nearest-user-location ] ;
+ }
     }
     else
     {
         command = [ common.check-tool $(user-provided-command) ] ;
- if ! $(command)
+ if ! $(command) && $(.debug-configuration)
         {
- if $(.debug-configuration)
- {
- ECHO "warning: toolset $(toolset) initialization: " ;
- ECHO "warning: can't find user-provided command " '$(user-provided-command)' ;
- ECHO "warning: initialized from" [ errors.nearest-user-location ] ;
- }
- # It's possible, in theory, that user-provided command is OK, but we're
- # not smart enough to understand that.
- command = $(user-provided-command) ;
- }
+ ECHO "warning: toolset $(toolset) initialization: " ;
+ ECHO "warning: can't find user-provided command " '$(user-provided-command)' ;
+ ECHO "warning: initialized from" [ errors.nearest-user-location ] ;
+ }
     }
 
     return $(command) ;
 }
 
+# Same as get-invocation-command-nodefault, except that if no tool
+# if found, returns either the user-provided-command, if present,
+# or the 'tool' parameter.
+rule get-invocation-command (
+ toolset : tool : user-provided-command * : additional-paths * : path-last ? )
+{
+ local result = [ get-invocation-command-nodefault $(toolset) : $(tool)
+ : $(user-provided-command) : $(additional-paths) : $(path-last) ] ;
+
+ if ! $(result)
+ {
+ if $(user-provided-command)
+ {
+ result = $(user-provided-command) ;
+ }
+ else
+ {
+ result = $(tool) ;
+ }
+ }
+ return $(result) ;
+}
+
 # Given an invocation command,
 # return the absolute path to the command. This works even if commnad
 # has not path element and is present in PATH.

Modified: trunk/tools/build/v2/tools/gcc.jam
==============================================================================
--- trunk/tools/build/v2/tools/gcc.jam (original)
+++ trunk/tools/build/v2/tools/gcc.jam 2007-12-25 04:11:37 EST (Tue, 25 Dec 2007)
@@ -184,7 +184,7 @@
     
     #~ - The resource compiler.
     local rc =
- [ common.get-invocation-command gcc
+ [ common.get-invocation-command-nodefault gcc
             : windres : [ feature.get-values <rc> : $(options) ] : $(bin) : search-path ] ;
     local rc-type =
         [ feature.get-values <rc-type> : $(options) ] ;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk