mirror of
https://github.com/boostorg/build.git
synced 2026-02-11 11:42:14 +00:00
Merge changes from Version_1_34_1 back to trunk.
[SVN r38792]
This commit is contained in:
@@ -434,41 +434,39 @@ class gcc-linking-generator : unix-linking-generator
|
||||
local generated-targets = [ unix-linking-generator.run $(project) $(name)
|
||||
: $(property-set) : $(sources) ] ;
|
||||
|
||||
# If more than one target was generated, throw out the
|
||||
# last one, which on windows just leaves the import
|
||||
# library. Most generators on windows simply don't accept
|
||||
# shared libraries as input, but being able to link
|
||||
# directly to a shared library without an import library
|
||||
# is an important capability of GCC. Therefore, we remove
|
||||
# the target after the action sees it so that dependent
|
||||
# targets don't try to link to both the import library and
|
||||
# the DLL.
|
||||
if [ $(property-set).get <suppress-import-lib> ] = true
|
||||
{
|
||||
return $(generated-targets[0]) $(generated-targets[-1]) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $(generated-targets[1-2]) ;
|
||||
}
|
||||
return $(generated-targets) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
generators.register [ new gcc-linking-generator gcc.link : LIB OBJ : EXE
|
||||
: <toolset>gcc ] ;
|
||||
|
||||
.IMPLIB-COMMAND = ;
|
||||
.IMPLIB-TYPE = ;
|
||||
if [ os.on-windows ]
|
||||
{
|
||||
.IMPLIB-COMMAND = "-Wl,--out-implib," ;
|
||||
.IMPLIB-TYPE = IMPORT_LIB ;
|
||||
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 ] ;
|
||||
}
|
||||
|
||||
generators.register
|
||||
[ new gcc-linking-generator gcc.link.dll : LIB OBJ : $(.IMPLIB-TYPE) SHARED_LIB
|
||||
: <toolset>gcc ] ;
|
||||
|
||||
# Declare flags for linking
|
||||
# First, the common flags
|
||||
|
||||
@@ -354,7 +354,7 @@ toolset.flags testing.capture-output LAUNCHER <testing.launcher> ;
|
||||
# - if 'none', does not remove anything, ever
|
||||
# - if empty, removes 'source'
|
||||
# - if non-empty and not 'none', contains a list of sources to remove.
|
||||
rule capture-output ( target : source : properties * : targets-to-remove ? )
|
||||
rule capture-output ( target : source : properties * : targets-to-remove * )
|
||||
{
|
||||
output-file on $(target) = $(target:S=.output) ;
|
||||
LOCATE on $(target:S=.output) = [ on $(target) return $(LOCATE) ] ;
|
||||
|
||||
@@ -70,12 +70,13 @@ if [ os.name ] = AIX
|
||||
flags vacpp.link LINKFLAGS <link>static : -qtwolink ;
|
||||
|
||||
# Run-time linking
|
||||
flags vacpp.link EXE-LINKFLAGS <link>shared : -brtl ;
|
||||
flags vacpp.link EXE-LINKFLAGS <link>shared : -brtl -qtwolink ;
|
||||
}
|
||||
else
|
||||
{
|
||||
# Linux PPC
|
||||
flags vacpp.compile CFLAGS <link>shared : -qpic ;
|
||||
flags vacpp FINDLIBS : rt ;
|
||||
}
|
||||
|
||||
# Profiling
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
import modules ;
|
||||
import string ;
|
||||
|
||||
# Return the value(s) of the given environment variable(s) at the time
|
||||
# bjam was invoked.
|
||||
@@ -17,51 +18,79 @@ rule environ ( variable-names + )
|
||||
.platform = [ modules.peek : OSPLAT ] ;
|
||||
.version = [ modules.peek : OSVER ] ;
|
||||
|
||||
local rule constant ( c )
|
||||
local rule constant ( c : os ? )
|
||||
{
|
||||
os ?= $(.name) ;
|
||||
# First look for platform-specific name, then general value
|
||||
local variables = .$(c)-$(.name) .$(c) ;
|
||||
local variables = .$(c)-$(os) .$(c) ;
|
||||
local result = $($(variables)) ;
|
||||
return $(result[1]) ;
|
||||
}
|
||||
|
||||
rule get-constant ( )
|
||||
rule get-constant ( os ? )
|
||||
{
|
||||
# Find the name of the constant being accessed, which is
|
||||
# equal to the name used to invoke us.
|
||||
local bt = [ BACKTRACE 1 ] ;
|
||||
local rulename = [ MATCH ([^.]*)$ : $(bt[4]) ] ;
|
||||
return [ constant $(rulename) ] ;
|
||||
return [ constant $(rulename) : $(os) ] ;
|
||||
}
|
||||
|
||||
|
||||
# export all the common constants
|
||||
.constants = name platform version shared-library-path-variable path-separator ;
|
||||
.constants = name platform version shared-library-path-variable path-separator executable-path-variable executable-suffix ;
|
||||
for local constant in $(.constants)
|
||||
{
|
||||
IMPORT $(__name__) : get-constant : $(__name__) : $(constant) ;
|
||||
}
|
||||
EXPORT $(__name__) : $(.constants) ;
|
||||
|
||||
.shared-library-path-variable-NT = PATH ;
|
||||
.executable-path-variable-NT = PATH ;
|
||||
# On Windows the case and capitalization of PATH is not always
|
||||
# predictable, so let's find out what variable name was really set.
|
||||
if $(.name) = NT
|
||||
{
|
||||
for local n in [ VARNAMES .ENVIRON ]
|
||||
{
|
||||
if $(n:L) = path
|
||||
{
|
||||
.executable-path-variable-NT = $(n) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Specific constants for various platforms. There's no need to define
|
||||
# any constant whose value would be the same as the default, below.
|
||||
.shared-library-path-variable-NT = $(.executable-path-variable-NT) ;
|
||||
.path-separator-NT = ";" ;
|
||||
.expand-variable-prefix-NT = % ;
|
||||
.expand-variable-suffix-NT = % ;
|
||||
.executable-suffix-NT = .exe ;
|
||||
|
||||
.shared-library-path-variable-CYGWIN = PATH ;
|
||||
.path-separator-CYGWIN = ":" ;
|
||||
.expand-variable-prefix-CYGWIN = $ ;
|
||||
.expand-variable-suffix-CYGWIN = "" ;
|
||||
|
||||
.shared-library-path-variable-MACOSX = DYLD_LIBRARY_PATH ;
|
||||
|
||||
.shared-library-path-variable-AIX = LIBPATH ;
|
||||
|
||||
# Default constants
|
||||
.shared-library-path-variable = LD_LIBRARY_PATH ;
|
||||
.path-separator = ":" ;
|
||||
.expand-variable-prefix = $ ;
|
||||
.expand-variable-suffix = "" ;
|
||||
.executable-path-variable = PATH ;
|
||||
.executable-suffix = "" ;
|
||||
|
||||
# Return a list of the directories in the PATH. Yes, that information
|
||||
# is (sort of) available in the global module, but jam code can change
|
||||
# those values, and it isn't always clear what case/capitalization to
|
||||
# use when looking. This rule is a more reliable way to get there.
|
||||
rule executable-path ( )
|
||||
{
|
||||
return [ string.words [ environ [ constant executable-path-variable ] ]
|
||||
: [ constant path-separator ] ] ;
|
||||
}
|
||||
|
||||
if $(.name) = NT
|
||||
{
|
||||
local home = [ environ HOMEDRIVE HOMEPATH ] ;
|
||||
|
||||
@@ -46,6 +46,16 @@ rule transform ( function + : sequence * )
|
||||
return $(result) ;
|
||||
}
|
||||
|
||||
rule reverse ( s * )
|
||||
{
|
||||
local r ;
|
||||
for local x in $(s)
|
||||
{
|
||||
r = $(x) $(r) ;
|
||||
}
|
||||
return $(r) ;
|
||||
}
|
||||
|
||||
|
||||
rule less ( a b )
|
||||
{
|
||||
@@ -304,5 +314,7 @@ local rule __test__ ( )
|
||||
|
||||
assert.result e-3 h-3
|
||||
: sequence.select-highest-ranked e-1 e-3 h-3 m-2 : 1 3 3 2 ;
|
||||
|
||||
assert.result 7 6 5 4 3 2 1 : sequence.reverse 1 2 3 4 5 6 7 ;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user