|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r49596 - in trunk/tools/build/v2: build tools
From: ghost_at_[hidden]
Date: 2008-11-05 05:11:31
Author: vladimir_prus
Date: 2008-11-05 05:11:30 EST (Wed, 05 Nov 2008)
New Revision: 49596
URL: http://svn.boost.org/trac/boost/changeset/49596
Log:
When building on Windows for Linux target with gcc, don't try to create
import libraries and allow linking executables to shared libraries.
Text files modified:
trunk/tools/build/v2/build/generators.jam | 15 ++++++++-
trunk/tools/build/v2/tools/gcc.jam | 62 +++++++++++++++++++++------------------
2 files changed, 47 insertions(+), 30 deletions(-)
Modified: trunk/tools/build/v2/build/generators.jam
==============================================================================
--- trunk/tools/build/v2/build/generators.jam (original)
+++ trunk/tools/build/v2/build/generators.jam 2008-11-05 05:11:30 EST (Wed, 05 Nov 2008)
@@ -203,6 +203,7 @@
)
{
self.id = $(id) ;
+ self.rule-name = $(id) ;
self.composing = $(composing) ;
self.source-types = $(source-types) ;
self.target-types-and-names = $(target-types-and-names) ;
@@ -260,7 +261,17 @@
{
return $(self.requirements) ;
}
-
+
+ rule set-rule-name ( rule-name )
+ {
+ self.rule-name = $(rule-name) ;
+ }
+
+ rule rule-name ( )
+ {
+ return $(self.rule-name) ;
+ }
+
# Returns a true value if the generator can be run with the specified
# properties.
#
@@ -506,7 +517,7 @@
# Assign an action for each target.
local action = [ action-class ] ;
- local a = [ class.new $(action) $(sources) : $(self.id) :
+ local a = [ class.new $(action) $(sources) : $(self.rule-name) :
$(property-set) ] ;
# Create generated target for each target type.
Modified: trunk/tools/build/v2/tools/gcc.jam
==============================================================================
--- trunk/tools/build/v2/tools/gcc.jam (original)
+++ trunk/tools/build/v2/tools/gcc.jam 2008-11-05 05:11:30 EST (Wed, 05 Nov 2008)
@@ -504,34 +504,38 @@
}
}
-.IMPLIB-COMMAND = ;
-if [ os.on-windows ]
-{
- .IMPLIB-COMMAND = "-Wl,--out-implib," ;
- generators.register
- [ new gcc-linking-generator gcc.link
- : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB
- : EXE
- : <toolset>gcc ] ;
- generators.register
- [ new gcc-linking-generator gcc.link.dll
- : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB
- : IMPORT_LIB SHARED_LIB
- : <toolset>gcc ] ;
-}
-else
-{
- generators.register
- [ new gcc-linking-generator gcc.link
- : LIB OBJ
- : EXE
- : <toolset>gcc ] ;
- generators.register
- [ new gcc-linking-generator gcc.link.dll
- : LIB OBJ
- : SHARED_LIB
- : <toolset>gcc ] ;
-}
+# The set of permissible input types is different on mingw.
+# So, define two sets of generators, with mingw generators
+# selected when target-os=windows.
+
+local g ;
+g = [ new gcc-linking-generator gcc.mingw.link
+ : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB
+ : EXE
+ : <toolset>gcc <target-os>windows ] ;
+$(g).set-rule-name gcc.link ;
+generators.register $(g) ;
+
+g = [ new gcc-linking-generator gcc.mingw.link.dll
+ : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB
+ : IMPORT_LIB SHARED_LIB
+ : <toolset>gcc <target-os>windows ] ;
+$(g).set-rule-name gcc.link.dll ;
+generators.register $(g) ;
+
+generators.register
+ [ new gcc-linking-generator gcc.link
+ : LIB OBJ
+ : EXE
+ : <toolset>gcc ] ;
+generators.register
+ [ new gcc-linking-generator gcc.link.dll
+ : LIB OBJ
+ : SHARED_LIB
+ : <toolset>gcc ] ;
+
+generators.override gcc.mingw.link : gcc.link ;
+generators.override gcc.mingw.link.dll : gcc.link.dll ;
# Declare flags for linking.
# First, the common flags.
@@ -543,6 +547,8 @@
toolset.flags gcc.link FINDLIBS-SA <find-shared-library> ;
toolset.flags gcc.link LIBRARIES <library-file> ;
+toolset.flags gcc.link.dll .IMPLIB-COMMAND <target-os>windows : "-Wl,--out-implib," ;
+
# For <runtime-link>static we made sure there are no dynamic libraries in the
# link. On HP-UX not all system libraries exist as archived libraries (for
# example, there is no libunwind.a), so, on this platform, the -static option
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