mirror of
https://github.com/boostorg/build.git
synced 2026-02-14 00:32:11 +00:00
When building on Windows for Linux target with gcc, don't try to create
import libraries and allow linking executables to shared libraries. [SVN r49596]
This commit is contained in:
@@ -203,6 +203,7 @@ class generator
|
||||
)
|
||||
{
|
||||
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 @@ class generator
|
||||
{
|
||||
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 @@ class generator
|
||||
|
||||
# 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.
|
||||
|
||||
@@ -504,34 +504,38 @@ class gcc-linking-generator : unix-linking-generator
|
||||
}
|
||||
}
|
||||
|
||||
.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-ST <find-static-library> ;
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user