mirror of
https://github.com/boostorg/build.git
synced 2026-02-15 13:02:11 +00:00
Add support for STLport 5.x release.
[SVN r33531]
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
# (C) Copyright Gennadiy Rozental 2002.
|
||||
# (C) Copyright Vladimir Prus 2003.
|
||||
# (C) Copyright Gennadiy Rozental 2002.
|
||||
# (C) Copyright Vladimir Prus 2003.
|
||||
# (C) Copyright Rene Rivera 2006.
|
||||
# Permission to copy, use,
|
||||
# modify, sell and distribute this software is granted provided this
|
||||
# copyright notice appears in all copies. This software is provided
|
||||
@@ -22,7 +23,7 @@
|
||||
# on used toolset.
|
||||
# Also, finish various flags:
|
||||
#
|
||||
# This is copied from V1 toolset, "+" means "impelemnted"
|
||||
# This is copied from V1 toolset, "+" means "implemented"
|
||||
#+flags $(CURR_TOOLSET) DEFINES <stlport-iostream>off : _STLP_NO_OWN_IOSTREAMS=1 _STLP_HAS_NO_NEW_IOSTREAMS=1 ;
|
||||
#+flags $(CURR_TOOLSET) DEFINES <stlport-extensions>off : _STLP_NO_EXTENSIONS=1 ;
|
||||
# flags $(CURR_TOOLSET) DEFINES <stlport-anachronisms>off : _STLP_NO_ANACHRONISMS=1 ;
|
||||
@@ -37,7 +38,7 @@ import feature : feature subfeature ;
|
||||
import project ;
|
||||
import "class" : new ;
|
||||
import targets ;
|
||||
import property-set ;
|
||||
import property-set ;
|
||||
import common ;
|
||||
|
||||
# Make this module into a project.
|
||||
@@ -68,7 +69,7 @@ subfeature stdlib stlport : extensions : noext : optional propagated ;
|
||||
# STLport debug allocation -- NOT YET SUPPORTED
|
||||
#subfeature stdlib stlport : debug-alloc : off on ;
|
||||
|
||||
# Declare a special target class to handle the creation of search-lib-target
|
||||
# Declare a special target class to handle the creation of search-lib-target
|
||||
# instances for STLport. We need a special class, because otherwise we'll have
|
||||
# - declare prebuilt targets for all possible toolsets. And by the time 'init'
|
||||
# is called we don't even know the list of toolsets that are registered
|
||||
@@ -78,16 +79,17 @@ subfeature stdlib stlport : extensions : noext : optional propagated ;
|
||||
class stlport-target-class : basic-target
|
||||
{
|
||||
import feature project type errors generators ;
|
||||
import set : difference ;
|
||||
|
||||
rule __init__ ( project : headers ? : libraries ? : version ? )
|
||||
import set : difference ;
|
||||
|
||||
rule __init__ ( project : headers ? : libraries + : version ? )
|
||||
{
|
||||
basic-target.__init__ stlport : $(project) ;
|
||||
self.headers = $(headers) ;
|
||||
self.libraries = $(libraries) ;
|
||||
self.version = $(version) ;
|
||||
self.version.5 = [ MATCH "^(5[.][^.]+).*" : $(version) ] ;
|
||||
}
|
||||
|
||||
|
||||
rule match ( property-set )
|
||||
{
|
||||
# Override the rule which detects if this basic-target is
|
||||
@@ -97,29 +99,39 @@ class stlport-target-class : basic-target
|
||||
# requirements, but then stlport-$(version) would show in
|
||||
# the common properties, causing recursive building of ourselfs.
|
||||
|
||||
local matched ;
|
||||
if [ $(property-set).get <stdlib-stlport:version> ] = $(self.version)
|
||||
{
|
||||
return stlport-$(self.version) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
return no-match ;
|
||||
if $(self.version.5)
|
||||
{
|
||||
# And for STLport 5.x multi-threading is required.
|
||||
if [ $(property-set).get <threading> ] = multi
|
||||
{
|
||||
matched = stlport-$(self.version) ;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
matched = stlport-$(self.version) ;
|
||||
}
|
||||
}
|
||||
matched ?= no-match ;
|
||||
|
||||
return $(matched) ;
|
||||
}
|
||||
|
||||
|
||||
rule generate ( property-set )
|
||||
{
|
||||
# Since this target is built with <stdlib>stlport, it will also
|
||||
# have <library>/stlport//stlport in requirements, which will
|
||||
# cause a loop in main target references. Remove that property
|
||||
# manually.
|
||||
|
||||
|
||||
property-set = [ property-set.create [ difference
|
||||
[ $(property-set).raw ] : <library>/stlport//stlport <stdlib>stlport ] ] ;
|
||||
return [ basic-target.generate $(property-set) ] ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
rule construct ( name : source-targets * : property-set )
|
||||
{
|
||||
# Deduce the name of stlport library, based on toolset and
|
||||
@@ -128,96 +140,123 @@ class stlport-target-class : basic-target
|
||||
local hostios = [ feature.get-values <stdlib-stlport:iostream> : $(raw) ] ;
|
||||
local toolset = [ feature.get-values <toolset> : $(raw) ] ;
|
||||
|
||||
|
||||
# We don't need libraries if host istreams are used. For
|
||||
# msvc, automatic library selection will be used.
|
||||
if ! $(hostios) && $(toolset) != msvc
|
||||
{
|
||||
local debug = [ feature.get-values <runtime-debugging> : $(raw) ] ;
|
||||
if $(self.version.5)
|
||||
{
|
||||
# Version 5.x
|
||||
|
||||
# STLport host IO streams no longer supported. So we always
|
||||
# need libraries.
|
||||
|
||||
# name: stlport(stl)?[dg]?.M.R
|
||||
local name = stlport ;
|
||||
if [ feature.get-values <runtime-debugging> : $(raw) ] = "on"
|
||||
{
|
||||
name += stl ;
|
||||
switch $(toolset)
|
||||
{
|
||||
case gcc* : name += g ;
|
||||
case darwin* : name += g ;
|
||||
case * : name += d ;
|
||||
}
|
||||
}
|
||||
name += .$(self.version.5) ;
|
||||
|
||||
return [ generators.construct
|
||||
$(self.project) $(name:J=) : SEARCHED_LIB : $(property-set) ] ;
|
||||
}
|
||||
else if ! $(hostios) && $(toolset) != msvc
|
||||
{
|
||||
# We don't need libraries if host istreams are used. For
|
||||
# msvc, automatic library selection will be used.
|
||||
|
||||
# name: stlport_<toolset>(_stldebug)?
|
||||
local name = stlport ;
|
||||
name = $(name)_$(toolset) ;
|
||||
if $(debug) = "on"
|
||||
if [ feature.get-values <runtime-debugging> : $(raw) ] = "on"
|
||||
{
|
||||
name = $(name)_stldebug ;
|
||||
}
|
||||
|
||||
return [ generators.construct $(self.project) $(name) : SEARCHED_LIB
|
||||
: $(property-set) ] ;
|
||||
|
||||
return [ generators.construct
|
||||
$(self.project) $(name) : SEARCHED_LIB : $(property-set) ] ;
|
||||
}
|
||||
else
|
||||
{
|
||||
return [ property-set.empty ] ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
rule compute-usage-requirements ( subvariant )
|
||||
{
|
||||
local usage-requirements ;
|
||||
usage-requirements +=
|
||||
<include>$(self.headers)
|
||||
<dll-path>$(self.libraries)
|
||||
<library-path>$(self.libraries)
|
||||
;
|
||||
|
||||
local usage-requirements =
|
||||
<include>$(self.headers)
|
||||
<dll-path>$(self.libraries)
|
||||
<library-path>$(self.libraries)
|
||||
;
|
||||
|
||||
local rproperties = [ $(subvariant).build-properties ] ;
|
||||
# CONSIDER: should this "if" sequence be replaced with
|
||||
# some use of 'property-map' class?
|
||||
if [ $(rproperties).get <runtime-debugging> ] = "on"
|
||||
{
|
||||
usage-requirements += <define>_STLP_DEBUG=1
|
||||
<define>_STLP_DEBUG_UNINITIALIZED=1 ;
|
||||
usage-requirements +=
|
||||
<define>_STLP_DEBUG=1
|
||||
<define>_STLP_DEBUG_UNINITIALIZED=1 ;
|
||||
}
|
||||
if [ $(rproperties).get <runtime-debugging> ] = "on"
|
||||
if [ $(rproperties).get <runtime-debugging> ] = "on"
|
||||
{
|
||||
usage-requirements += <define>_STLP_USE_DYNAMIC_LIB=1 ;
|
||||
usage-requirements +=
|
||||
<define>_STLP_USE_DYNAMIC_LIB=1 ;
|
||||
}
|
||||
if [ $(rproperties).get <stdlib-stlport:extensions> ] = noext
|
||||
{
|
||||
usage-requirements += <define>_STLP_NO_EXTENSIONS=1 ;
|
||||
usage-requirements +=
|
||||
<define>_STLP_NO_EXTENSIONS=1 ;
|
||||
}
|
||||
if [ $(rproperties).get <stdlib-stlport:iostream> ] = hostios
|
||||
{
|
||||
usage-requirements += <define>_STLP_NO_OWN_IOSTREAMS=1
|
||||
<define>_STLP_HAS_NO_NEW_IOSTREAMS=1 ;
|
||||
usage-requirements +=
|
||||
<define>_STLP_NO_OWN_IOSTREAMS=1
|
||||
<define>_STLP_HAS_NO_NEW_IOSTREAMS=1 ;
|
||||
}
|
||||
|
||||
|
||||
return [ property-set.create $(usage-requirements) ] ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rule stlport-target ( headers ? : libraries ? : version ? )
|
||||
rule stlport-target ( headers ? : libraries + : version ? )
|
||||
{
|
||||
local project = [ project.current ] ;
|
||||
|
||||
|
||||
targets.main-target-alternative
|
||||
[ new stlport-target-class $(project) : $(headers) : $(libraries)
|
||||
[ new stlport-target-class $(project) : $(headers) : $(libraries)
|
||||
: $(version)
|
||||
] ;
|
||||
}
|
||||
|
||||
local .version-subfeature-defined ;
|
||||
|
||||
# Initialize stlport support.
|
||||
rule init ( version ? :
|
||||
headers # Location of header files
|
||||
libraries ? # Location of libraries
|
||||
)
|
||||
# Initialize stlport support.
|
||||
rule init (
|
||||
version ? :
|
||||
headers # Location of header files
|
||||
libraries * # Location of libraries, lib and bin subdirs of STLport.
|
||||
)
|
||||
{
|
||||
# FIXME: need to use common.check-init-parameters here.
|
||||
# At the moment, that rule always tries to define subfeature
|
||||
# of the 'toolset' feature, while we need to define subfeature
|
||||
# of <stdlib>stlport, so tweaks to check-init-parameters are needed.
|
||||
if $(version)
|
||||
{
|
||||
{
|
||||
if ! $(.version-subfeature-defined)
|
||||
{
|
||||
{
|
||||
feature.subfeature stdlib stlport : version : : propagated ;
|
||||
.version-subfeature-defined = true ;
|
||||
}
|
||||
}
|
||||
feature.extend-subfeature stdlib stlport : version : $(version) ;
|
||||
}
|
||||
|
||||
|
||||
# Declare the main target for this STLPort version.
|
||||
stlport-target $(headers) : $(libraries) : $(version) ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user