2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-16 13:22:11 +00:00

Fixes for intel-linux

added <default> feature handling for specifying build defaults in requirement sets.


[SVN r22027]
This commit is contained in:
Dave Abrahams
2004-01-28 22:50:18 +00:00
parent 1d037dbe15
commit 23a7ecb8c0
4 changed files with 103 additions and 22 deletions

View File

@@ -458,6 +458,28 @@ rule get-values
return $(_properties:G=) ;
}
rule replace-properties ( property-set * : new-properties * )
{
local result = ;
for local x in $(property-set)
{
if $(x:G) in $(new-properties:G)
{
if ! $(x:G) in $(result:G)
{
result += [ get-properties $(x:G) : $(new-properties) ] ;
}
}
else
{
result += $(x) ;
}
}
return $(result) ;
}
# normalize-properties properties
#
# Normalizes a set of (possibly qualified) properties by prepending <*> as many
@@ -474,6 +496,14 @@ rule normalize-properties
case <*><tag>* : result += <*>$(property) ;
case <tag>* : result += <*><*>$(property) ;
case <*><*><*><default>* : result += $(property) ;
case <*><*><default><*>* : result += <*>$(property) ;
case <*><*><default>* : result += $(property) ;
case <*><default><*>* : result += <*><*>$(property) ;
case <*><default>* : result += <*>$(property) ;
case <default><*>* : result += <*><*><*>$(property) ;
case <default>* : result += <*><*>$(property) ;
case <*><*><*><*@*>* : result += $(property) ;
case <*><*><*@*>* : result += <*>$(property) ;
case <*><*@*>* : result += <*><*>$(property) ;
@@ -1071,13 +1101,11 @@ rule segregate-overrides
$(>) = [ get-properties $(kept-features) : $($(>)) ] ;
}
# report-free-property-conflicts free-property... : target
#
# If any single-valued free-feature appears more than once in free-property...,
# exit with an appropriate error message.
rule report-free-property-conflicts
rule report-free-property-conflicts ( free-property * : target + )
{
local p = [ get-properties $(gSINGLE_VALUED_FREE_FEATURES) $(<) ] ;
local p = [ get-properties $(gSINGLE_VALUED_FREE_FEATURES) : $(free-property) ] ;
local f = [ unique $(p:G) ] ;
if $(p:G) != $(f)
{
@@ -1086,28 +1114,22 @@ rule report-free-property-conflicts
}
}
# expand-build-request
# toolset variant target-name : requirements : build-request
#
# Returns a list of path-property-sets (see make-path-property-sets above) for
# all build configurations based on the given toolset, requirements, and
# build-request. Target-name is just used for error reporting.
rule expand-build-request
rule expand-build-request ( toolset variant target : raw-requirements * : raw-build-request * )
{
local toolset = $(<[1]) ;
local variant = $(<[2]) ;
# grab the requirements and BUILD-request relevant to this toolset and variant
local requirements = [ select-properties $(toolset) $(variant) : $(>) ] ;
local build-request = [ select-properties $(toolset) $(variant) : $(3) ] ;
local requirements = [ select-properties $(toolset) $(variant) : $(raw-requirements) ] ;
local build-request = [ select-properties $(toolset) $(variant) : $(raw-build-request) ] ;
# Separate the free features (e.g. <define>, <undef>, <include>) from the others
local free-properties = [ segregate-free-properties requirements build-request ] ;
# Check for conflicts
report-free-property-conflicts $(free-properties) : $(<[3]) ;
report-free-property-conflicts $(free-properties) : $(target) ;
build-request = [ remove-incompatible-builds $(requirements)
: $(build-request) : $(<[3]) ] ;
: $(build-request) : $(target) ] ;
if $(build-request) != SKIP
{
@@ -1129,6 +1151,7 @@ rule expand-build-request
] ;
local defaulted-properties = [ feature-default $(defaulted-features) ] ;
# VP: defaulted-properties have the form <feature>value and there's 1 value.
# Hence, each element of defaulted-properties will be part of each
# component of override-sets and will be a part of each property-set
@@ -1136,6 +1159,28 @@ rule expand-build-request
# way: free properties does not show up in target path.
local defaulted-free-properties = [ segregate-free-properties defaulted-properties ] ;
#
# Allow <default> properties and rules to take effect.
#
local default-requirements = [ get-values <default> : $(free-properties) ] ;
defaulted-properties = [ replace-properties $(defaulted-properties)
: [ select-gristed $(default-requirements) ] ] ;
local non-defaults = $(requirements) $(build-request) $(free-properties) ;
for local r in [ select-ungristed $(default-requirements) ]
{
local x = [ $(r) $(toolset) $(variant) : $(non-defaults) ] ;
# ECHO $(r) yields $(x) ;
# ECHO defaulted-properties= $(defaulted-properties) ;
defaulted-properties = [
replace-properties $(defaulted-properties) : $(x) ] ;
}
# In case any defaults should conflict with the requirements,
# force them to match up.
defaulted-properties = [ replace-properties $(defaulted-properties) : $(requirements) ] ;
# form override property sets of the form (property1[/property2...] )+,
# sorted in feature order. These represent the properties of subvariants

View File

@@ -26,6 +26,9 @@ feature unicode-application : on off ;
feature exception-handling : on off ;
feature rtti : on off ;
feature stdlib : "default" gcc stlport ;
free-feature "default" ;
free-feature cflags ;
free-feature linkflags ;
free-feature cxxflags ;
@@ -84,7 +87,7 @@ feature instruction-set :
gLINK_COMPATIBLE = <shared-linkable>true <target-type> <inlining> ;
gALWAYS_RELEVANT = <target-type> <tag> ;
gALWAYS_RELEVANT = <target-type> <tag> <default> ;
##### Requirements by target type #####
gTARGET_TYPE_REQUIREMENTS(DLL) = <shared-linkable>true ;

View File

@@ -41,6 +41,7 @@ flags intel-linux INTEL_LINUX_SETUP : ". "$(INTEL_LINUX_ROOT)"/bin/iccvars.sh" ;
# Additional DLL directory
flags intel-linux INTEL_LINUX_RUN_LD_LIBRARY_PATH : $(INTEL_LINUX_ROOT)"/lib" ;
#### compiler and linker switches ####
# debugging
@@ -53,6 +54,10 @@ flags intel-linux CFLAGS <optimization>off : -O0 ;
flags intel-linux CFLAGS <optimization>space : -O2 ;
flags intel-linux CFLAGS <optimization>speed : -O3 ;
# standard library
flags intel-linux CFLAGS <stdlib>gcc : -cxxlib-gcc ;
flags intel-linux LINKFLAGS <stdlib>gcc : -cxxlib-gcc ;
# inlining
# results using -ip are worse than without?
# flags intel-linux CFLAGS <inlining>full : -ip ;

View File

@@ -124,7 +124,8 @@ else if $(UNIX)
PYTHON_PROPERTIES ?=
<sysinclude>$(PYTHON_INCLUDES)
<library-path>$(PYTHON_LIB_PATH)
python-intel-use-gcc-stdlib
<default>python-intel-use-gcc-stdlib
python-static-multithread
;
if $(OS) = OSF
@@ -193,13 +194,31 @@ CYGWIN_ROOT ?= c:/cygwin ;
# intel-linked shared libs by a GCC-built executable unless they have
# been told to use the GCC runtime. This rule adds the requisite
# flags to the compile and link lines.
rule python-intel-use-gcc-stdlib ( toolset variant : properties * )
rule python-intel-use-gcc-stdlib ( toolset variant : non-defaults * )
{
if ( ! $(PYTHON_WINDOWS) )
&& ( ! <define>BOOST_PYTHON_STATIC_LIB in $(non-defaults) )
&& [ MATCH (intel) : $(toolset) ]
{
return <stdlib>gcc ;
}
else
{
return ;
}
}
# Force statically-linked embedding applications to be multithreaded
# on UNIX.
rule python-static-multithread ( toolset variant : properties * )
{
if ! $(PYTHON_WINDOWS)
&& ! <define>BOOST_PYTHON_STATIC_LIB in $(properties)
&& [ MATCH (intel) : $(toolset) ]
{
properties += <cxxflags>-cxxlib-gcc <linkflags>-cxxlib-gcc ;
local x = <define>BOOST_PYTHON_STATIC_LIB <threading>single ;
if $(x) in $(properties)
{
properties = [ difference $(properties) : <threading>single ] <threading>multi ;
}
}
return $(properties) ;
}
@@ -454,7 +473,16 @@ rule boost-python-runtest (
local dependencies = [ FGristFiles [ expand-source-names $(sources) ] ] ;
source-files on $(main-target) += $(gTARGET_SOURCES($(dependencies))) ;
local result = [ boost-test $(sources) : RUN_PYD : $(requirements) : $(target) : $(local-build) ] ;
local result = [
boost-test $(sources)
: RUN_PYD
: $(requirements)
<default>python-intel-use-gcc-stdlib # unless otherwise
# specified, assume the GCC standard
# library is needed for intel
: $(target)
: $(local-build)
] ;
}
rule boost-python-test ( name : sources + : requirements * : default-BUILD * )