mirror of
https://github.com/boostorg/build.git
synced 2026-02-14 00:32:11 +00:00
Merge from trunk
[SVN r52376]
This commit is contained in:
@@ -457,10 +457,12 @@ rule run ( sources + : args * : input-files * : requirements * : target-name ?
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The <code>run</code> and the <code>run-fail</code> rules, if the test
|
||||
passes, automatically delete the linked executable, to save space. This
|
||||
behaviour can be suppressed by passing the <literal>
|
||||
--preserve-test-targets</literal> command line option.
|
||||
<indexterm><primary>preserve-test-targets</primary></indexterm>
|
||||
If the <literal>preserve-test-targets</literal> feature has the value
|
||||
<literal>off</literal>, then <code>run</code> and the <code>run-fail</code>
|
||||
rules will remove the executable after running it. This somewhat decreases
|
||||
disk space requirements for continuous testing environments. The default
|
||||
value of <literal>preserve-test-targets</literal> feature is <literal>on</literal>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
|
||||
8
example/built_tool/Jamroot.jam
Normal file
8
example/built_tool/Jamroot.jam
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
import feature ;
|
||||
|
||||
feature.feature tblgen : : dependency free ;
|
||||
|
||||
project built_tool ;
|
||||
|
||||
build-project core ;
|
||||
30
example/built_tool/core/Jamfile.jam
Normal file
30
example/built_tool/core/Jamfile.jam
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
import toolset ;
|
||||
|
||||
project : requirements <tblgen>../tblgen//tblgen ;
|
||||
|
||||
|
||||
# Create a.c using a custom action defined below.
|
||||
make a.c : a.td : @tblgen ;
|
||||
|
||||
# Use a.c in executable.
|
||||
exe core : core.cpp a.c ;
|
||||
|
||||
# The action has to invoke the tool built in other
|
||||
# parts of the project. The <tblgen> feature is used
|
||||
# to specify the location of the tool, and the flags
|
||||
# statement below make the full path to the tool
|
||||
# available inside the action.
|
||||
toolset.flags tblgen COMMAND <tblgen> ;
|
||||
|
||||
# We generally want a.c to be rebuilt when the tool changes.
|
||||
rule tblgen ( targets * : sources * : properties * )
|
||||
{
|
||||
DEPENDS $(targets) : [ on $(targets) return $(COMMAND) ] ;
|
||||
}
|
||||
|
||||
# The action that invokes the tool
|
||||
actions tblgen bind COMMAND
|
||||
{
|
||||
$(COMMAND:E=tblgen) > $(<)
|
||||
}
|
||||
0
example/built_tool/core/a.td
Normal file
0
example/built_tool/core/a.td
Normal file
5
example/built_tool/core/core.cpp
Normal file
5
example/built_tool/core/core.cpp
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
5
example/built_tool/readme.txt
Normal file
5
example/built_tool/readme.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
This example shows how to build an executable and then use it
|
||||
for generating other targets. The 'tblgen' subdirectory builds
|
||||
a tool, while the 'core' subdirectory uses that tool. Refer
|
||||
to core/Jamfile.jam for detailed comments.
|
||||
4
example/built_tool/tblgen/Jamfile.jam
Normal file
4
example/built_tool/tblgen/Jamfile.jam
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
project : requirements -<tblgen>tblgen//tblgen ;
|
||||
|
||||
exe tblgen : tblgen.cpp ;
|
||||
9
example/built_tool/tblgen/tblgen.cpp
Normal file
9
example/built_tool/tblgen/tblgen.cpp
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "int foo;\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2,32 +2,28 @@
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
import common ;
|
||||
import "class" : new ;
|
||||
import common ;
|
||||
|
||||
rule generate-example ( project name : property-set : sources * )
|
||||
{
|
||||
local result ;
|
||||
for local s in $(sources)
|
||||
{
|
||||
#local ea = [ $(s).action ] ;
|
||||
#local ep = [ $(ea).properties ] ;
|
||||
#local source-name = [ $(s).name ] ;
|
||||
#local source-action = [ $(s).action ] ;
|
||||
#local source-properties = [ $(source-action).properties ] ;
|
||||
|
||||
# Create a new action, that takes the source target
|
||||
# and runs 'common.copy' comamnd on it.
|
||||
local a = [
|
||||
new non-scanning-action $(s) : common.copy : $(property-set) ] ;
|
||||
# Create a new action, that takes the source target and runs the
|
||||
# 'common.copy' command on it.
|
||||
local a = [ new non-scanning-action $(s) : common.copy : $(property-set)
|
||||
] ;
|
||||
|
||||
local source-name = [ $(s).name ] ;
|
||||
|
||||
# Create the target to represent the result of the action.
|
||||
# The target has the name that was specified in Jamfile
|
||||
# and passed here via the 'name' parameter,
|
||||
# and the same type and project as the source.
|
||||
result += [ new file-target $(name)
|
||||
: [ $(s).type ]
|
||||
: $(project)
|
||||
: $(a) ] ;
|
||||
# Create a target to represent the action result. Uses the target name
|
||||
# passed here via the 'name' parameter and the same type and project as
|
||||
# the source.
|
||||
result += [ new file-target $(name) : [ $(s).type ] : $(project) : $(a)
|
||||
] ;
|
||||
}
|
||||
return $(result) ;
|
||||
}
|
||||
|
||||
@@ -388,6 +388,24 @@ local rule load-configuration-files
|
||||
ECHO "notice: User configuration file loading explicitly disabled." ;
|
||||
}
|
||||
}
|
||||
|
||||
# We look for project-config.jam from "." upward.
|
||||
# I am not sure this is 100% right decision, we might as well check for
|
||||
# it only alonside the Jamroot file. However:
|
||||
#
|
||||
# - We need to load project-root.jam before Jamroot
|
||||
# - We probably would need to load project-root.jam even if there's no
|
||||
# Jamroot - e.g. to implement automake-style out-of-tree builds.
|
||||
local file = [ path.glob "." : project-config.jam ] ;
|
||||
if ! $(file)
|
||||
{
|
||||
file = [ path.glob-in-parents "." : project-config.jam ] ;
|
||||
}
|
||||
if $(file)
|
||||
{
|
||||
initialize-config-module project-config ;
|
||||
load-config project-config : project-config.jam : $(file:D) ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -469,7 +469,9 @@ rule validate-value-string ( feature value-string )
|
||||
|
||||
if $($(feature).subfeatures)
|
||||
{
|
||||
values = [ regex.split $(value-string) - ] ;
|
||||
if ! ( $(value-string) in $($(feature).subfeatures) ) {
|
||||
values = [ regex.split $(value-string) - ] ;
|
||||
}
|
||||
}
|
||||
|
||||
if ! ( $(values[1]) in $($(feature).values) ) &&
|
||||
|
||||
@@ -439,6 +439,10 @@ rule initialize (
|
||||
{
|
||||
parent-module = site-config ;
|
||||
}
|
||||
else if $(module-name) = project-config
|
||||
{
|
||||
parent-module = user-config ;
|
||||
}
|
||||
else
|
||||
{
|
||||
# We search for parent/project-root only if Jamfile was specified, i.e.
|
||||
@@ -453,7 +457,15 @@ rule initialize (
|
||||
# inherit from user-config.
|
||||
if $(location)
|
||||
{
|
||||
parent-module = user-config ;
|
||||
# If project-config module exist, inherit from it.
|
||||
if $(project-config.attributes)
|
||||
{
|
||||
parent-module = project-config ;
|
||||
}
|
||||
else
|
||||
{
|
||||
parent-module = user-config ;
|
||||
}
|
||||
jamroot = true ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,6 +78,7 @@ import property-set ;
|
||||
import sequence ;
|
||||
import set ;
|
||||
import toolset ;
|
||||
import build-request ;
|
||||
|
||||
|
||||
# Base class for all abstract targets.
|
||||
@@ -557,7 +558,6 @@ local rule end-building ( main-target-instance )
|
||||
class main-target : abstract-target
|
||||
{
|
||||
import assert ;
|
||||
import build-request ;
|
||||
import errors ;
|
||||
import feature ;
|
||||
import print ;
|
||||
@@ -657,65 +657,8 @@ class main-target : abstract-target
|
||||
|
||||
rule apply-default-build ( property-set )
|
||||
{
|
||||
# 1. First, see what properties from default-build are already present
|
||||
# in property-set.
|
||||
|
||||
local raw = [ $(property-set).raw ] ;
|
||||
local specified-features = $(raw:G) ;
|
||||
|
||||
local defaults-to-apply ;
|
||||
for local d in [ $(self.default-build).raw ]
|
||||
{
|
||||
if ! $(d:G) in $(specified-features)
|
||||
{
|
||||
defaults-to-apply += $(d) ;
|
||||
}
|
||||
}
|
||||
|
||||
# 2. If there are any defaults to be applied, form a new build request.
|
||||
# Pass it through to 'expand-no-defaults' since default-build might
|
||||
# contain "release debug" resulting in two property-sets.
|
||||
local result ;
|
||||
if $(defaults-to-apply)
|
||||
{
|
||||
properties = [
|
||||
build-request.expand-no-defaults
|
||||
|
||||
# We have to compress subproperties here to prevent property
|
||||
# lists like:
|
||||
#
|
||||
# <toolset>msvc <toolset-msvc:version>7.1 <threading>multi
|
||||
#
|
||||
# from being expanded into:
|
||||
#
|
||||
# <toolset-msvc:version>7.1/<threading>multi
|
||||
# <toolset>msvc/<toolset-msvc:version>7.1/<threading>multi
|
||||
#
|
||||
# due to a cross-product property combination. That may be an
|
||||
# indication that build-request.expand-no-defaults is the wrong
|
||||
# rule to use here.
|
||||
[ feature.compress-subproperties $(raw) ]
|
||||
$(defaults-to-apply)
|
||||
] ;
|
||||
|
||||
if $(properties)
|
||||
{
|
||||
for local p in $(properties)
|
||||
{
|
||||
result += [ property-set.create
|
||||
[ feature.expand [ feature.split $(p) ] ] ] ;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result = [ property-set.empty ] ;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result = $(property-set) ;
|
||||
}
|
||||
return $(result) ;
|
||||
return [ targets.apply-default-build $(property-set)
|
||||
: $(self.default-build) ] ;
|
||||
}
|
||||
|
||||
# Select an alternative for this main target, by finding all alternatives
|
||||
@@ -883,6 +826,69 @@ rule generate-from-reference (
|
||||
return [ $(target).generate $(rproperties) ] ;
|
||||
}
|
||||
|
||||
rule apply-default-build ( property-set : default-build )
|
||||
{
|
||||
# 1. First, see what properties from default-build are already present
|
||||
# in property-set.
|
||||
|
||||
local raw = [ $(property-set).raw ] ;
|
||||
local specified-features = $(raw:G) ;
|
||||
|
||||
local defaults-to-apply ;
|
||||
for local d in [ $(default-build).raw ]
|
||||
{
|
||||
if ! $(d:G) in $(specified-features)
|
||||
{
|
||||
defaults-to-apply += $(d) ;
|
||||
}
|
||||
}
|
||||
|
||||
# 2. If there are any defaults to be applied, form a new build request.
|
||||
# Pass it through to 'expand-no-defaults' since default-build might
|
||||
# contain "release debug" resulting in two property-sets.
|
||||
local result ;
|
||||
if $(defaults-to-apply)
|
||||
{
|
||||
properties = [
|
||||
build-request.expand-no-defaults
|
||||
|
||||
# We have to compress subproperties here to prevent property
|
||||
# lists like:
|
||||
#
|
||||
# <toolset>msvc <toolset-msvc:version>7.1 <threading>multi
|
||||
#
|
||||
# from being expanded into:
|
||||
#
|
||||
# <toolset-msvc:version>7.1/<threading>multi
|
||||
# <toolset>msvc/<toolset-msvc:version>7.1/<threading>multi
|
||||
#
|
||||
# due to a cross-product property combination. That may be an
|
||||
# indication that build-request.expand-no-defaults is the wrong
|
||||
# rule to use here.
|
||||
[ feature.compress-subproperties $(raw) ]
|
||||
$(defaults-to-apply)
|
||||
] ;
|
||||
|
||||
if $(properties)
|
||||
{
|
||||
for local p in $(properties)
|
||||
{
|
||||
result += [ property-set.create
|
||||
[ feature.expand [ feature.split $(p) ] ] ] ;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result = [ property-set.empty ] ;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result = $(property-set) ;
|
||||
}
|
||||
return $(result) ;
|
||||
}
|
||||
|
||||
|
||||
# Given a build request and requirements, return properties common to dependency
|
||||
# build request and target requirements.
|
||||
@@ -1559,6 +1565,23 @@ rule main-target-alternative ( target )
|
||||
return $(target) ;
|
||||
}
|
||||
|
||||
# Creates a new metargets with the specified properties, using 'klass' as
|
||||
# the class. The 'name', 'sources',
|
||||
# 'requirements', 'default-build' and 'usage-requirements' are assumed to be in
|
||||
# the form specified by the user in Jamfile corresponding to 'project'.
|
||||
#
|
||||
rule create-metatarget ( klass : project : name : sources * : requirements * :
|
||||
default-build * : usage-requirements * )
|
||||
{
|
||||
return [
|
||||
targets.main-target-alternative
|
||||
[ new $(klass) $(name) : $(project)
|
||||
: [ targets.main-target-sources $(sources) : $(name) ]
|
||||
: [ targets.main-target-requirements $(requirements) : $(project) ]
|
||||
: [ targets.main-target-default-build $(default-build) : $(project) ]
|
||||
: [ targets.main-target-usage-requirements $(usage-requirements) : $(project) ]
|
||||
] ] ;
|
||||
}
|
||||
|
||||
# Creates a typed-target with the specified properties. The 'name', 'sources',
|
||||
# 'requirements', 'default-build' and 'usage-requirements' are assumed to be in
|
||||
|
||||
@@ -117,7 +117,7 @@ rule register-suffixes ( suffixes + : type )
|
||||
{
|
||||
.type.$(s) = $(type) ;
|
||||
}
|
||||
else if $(.type.$(s)) != type
|
||||
else if $(.type.$(s)) != $(type)
|
||||
{
|
||||
errors.error Attempting to specify multiple types for suffix
|
||||
\"$(s)\" : "Old type $(.type.$(s)), New type $(type)" ;
|
||||
|
||||
@@ -655,6 +655,8 @@ class notfile-target : abstract-file-target
|
||||
{
|
||||
NOTFILE $(target) ;
|
||||
ALWAYS $(target) ;
|
||||
# TEMPORARY $(target) ;
|
||||
NOUPDATE $(target) ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -675,6 +677,7 @@ class action
|
||||
import property-set ;
|
||||
import indirect ;
|
||||
import path ;
|
||||
import set : difference ;
|
||||
|
||||
rule __init__ ( sources * : action-name + : property-set ? )
|
||||
{
|
||||
@@ -700,6 +703,12 @@ class action
|
||||
self.targets += $(targets) ;
|
||||
}
|
||||
|
||||
rule replace-targets ( old-targets * : new-targets * )
|
||||
{
|
||||
self.targets = [ set.difference $(self.targets) : $(old-targets) ] ;
|
||||
self.targets += $(new-targets) ;
|
||||
}
|
||||
|
||||
rule targets ( )
|
||||
{
|
||||
return $(self.targets) ;
|
||||
|
||||
@@ -63,6 +63,9 @@ flags acc LINKFLAGS <debug-symbols>off : -s ;
|
||||
flags acc CFLAGS <profiling>on : -pg ;
|
||||
flags acc LINKFLAGS <profiling>on : -pg ;
|
||||
|
||||
flags acc CFLAGS <address-model>64 : +DD64 ;
|
||||
flags acc LINKFLAGS <address-model>64 : +DD64 ;
|
||||
|
||||
flags acc CFLAGS <cflags> ;
|
||||
flags acc C++FLAGS <cxxflags> ;
|
||||
flags acc DEFINES <define> ;
|
||||
|
||||
@@ -312,7 +312,6 @@ class boostbook-generator : generator
|
||||
local catalog = $(global-catalog[1]) ;
|
||||
local catalog-file = $(global-catalog[2]) ;
|
||||
local targets ;
|
||||
local targets ;
|
||||
|
||||
# Add the catalog to the property set
|
||||
property-set = [ $(property-set).add-raw <catalog>$(catalog-file) ] ;
|
||||
|
||||
@@ -559,6 +559,23 @@ rule file-creation-command ( )
|
||||
{
|
||||
if [ os.name ] = NT
|
||||
{
|
||||
# A few alternative implementations on Windows:
|
||||
#
|
||||
# 'type NUL >> '
|
||||
# That would construct an empty file instead of a file containing
|
||||
# a space and an end-of-line marker but it would also not change
|
||||
# the target's timestamp in case the file already exists.
|
||||
#
|
||||
# 'type NUL > '
|
||||
# That would construct an empty file instead of a file containing
|
||||
# a space and an end-of-line marker but it would also destroy an
|
||||
# already existing file by overwriting it with an empty one.
|
||||
#
|
||||
# I guess the best solution would be to allow Boost Jam to define
|
||||
# built-in functions such as 'create a file', 'touch a file' or 'copy a
|
||||
# file' which could be used from inside action code. That would allow
|
||||
# completely portable operations without this kind of kludge.
|
||||
# (22.02.2009.) (Jurko)
|
||||
return "echo. > " ;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -91,6 +91,9 @@ rule init ( version ? : command * : options * : requirement * )
|
||||
# - The configured compile driver command.
|
||||
local command = [ common.get-invocation-command darwin : g++ : $(command) ] ;
|
||||
|
||||
# The version as reported by the compiler
|
||||
local real-version ;
|
||||
|
||||
# - Autodetect the root and bin dir if not given.
|
||||
if $(command)
|
||||
{
|
||||
@@ -113,8 +116,9 @@ rule init ( version ? : command * : options * : requirement * )
|
||||
# - The 'command' variable can have multiple elements. When calling
|
||||
# the SHELL builtin we need a single string.
|
||||
local command-string = $(command:J=" ") ;
|
||||
version ?= [ MATCH "^([0-9.]+)"
|
||||
real-version = [ MATCH "^([0-9.]+)"
|
||||
: [ SHELL "$(command-string) -dumpversion" ] ] ;
|
||||
version ?= $(real-version) ;
|
||||
}
|
||||
|
||||
# - Define the condition for this toolset instance.
|
||||
@@ -125,12 +129,12 @@ rule init ( version ? : command * : options * : requirement * )
|
||||
common.handle-options darwin : $(condition) : $(command) : $(options) ;
|
||||
|
||||
# - GCC 4.0 and higher in Darwin does not have -fcoalesce-templates.
|
||||
if $(version) < "4.0.0"
|
||||
if $(real-version) < "4.0.0"
|
||||
{
|
||||
flags darwin.compile.c++ OPTIONS $(condition) : -fcoalesce-templates ;
|
||||
}
|
||||
# - GCC 4.2 and higher in Darwin does not have -Wno-long-double.
|
||||
if $(version) < "4.2.0"
|
||||
if $(real-version) < "4.2.0"
|
||||
{
|
||||
flags darwin.compile OPTIONS $(condition) : -Wno-long-double ;
|
||||
}
|
||||
|
||||
10
src/tools/docutils.jam
Executable file → Normal file
10
src/tools/docutils.jam
Executable file → Normal file
@@ -42,15 +42,19 @@ type.set-scanner ReST : rst-scanner ;
|
||||
|
||||
generators.register-standard docutils.html : ReST : HTML ;
|
||||
|
||||
rule init ( docutils-dir ? )
|
||||
rule init ( docutils-dir ? : tools-dir ? )
|
||||
{
|
||||
ECHO docutils-dir= $(docutils-dir) ;
|
||||
docutils-dir ?= [ modules.peek : DOCUTILS_DIR ] ;
|
||||
ECHO tools-dir= $(tools-dir) ;
|
||||
tools-dir ?= $(docutils-dir)/tools ;
|
||||
|
||||
if ! $(.initialized)
|
||||
{
|
||||
.initialized = true ;
|
||||
.docutils-dir = $(docutils-dir) ;
|
||||
|
||||
.tools-dir = $(tools-dir:R="") ;
|
||||
|
||||
.setup = [
|
||||
common.prepend-path-variable-command PYTHONPATH
|
||||
: $(.docutils-dir) $(.docutils-dir)/extras ] ;
|
||||
@@ -62,7 +66,7 @@ rule html ( target : source : properties * )
|
||||
if ! [ on $(target) return $(RST2XXX) ]
|
||||
{
|
||||
local python-cmd = [ property.select <python.interpreter> : $(properties) ] ;
|
||||
RST2XXX on $(target) = $(python-cmd:G=:E="python") $(.docutils-dir)/tools/rst2html.py ;
|
||||
RST2XXX on $(target) = $(python-cmd:G=:E="python") $(.tools-dir)/rst2html.py ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,12 @@ import generators ;
|
||||
feature.extend-subfeature toolset intel : platform : darwin ;
|
||||
|
||||
toolset.inherit-generators intel-darwin
|
||||
<toolset>intel <toolset-intel:platform>darwin : gcc : gcc.mingw.link gcc.mingw.link.dll ;
|
||||
<toolset>intel <toolset-intel:platform>darwin
|
||||
: gcc
|
||||
# Don't inherit PCH generators. They were not tested, and probably
|
||||
# don't work for this compiler.
|
||||
: gcc.mingw.link gcc.mingw.link.dll gcc.compile.c.pch gcc.compile.c++.pch
|
||||
;
|
||||
|
||||
generators.override intel-darwin.prebuilt : builtin.lib-generator ;
|
||||
generators.override intel-darwin.prebuilt : builtin.prebuilt ;
|
||||
|
||||
@@ -13,6 +13,8 @@ import gcc ;
|
||||
import common ;
|
||||
import errors ;
|
||||
import generators ;
|
||||
import type ;
|
||||
import numbers ;
|
||||
|
||||
feature.extend-subfeature toolset intel : platform : linux ;
|
||||
|
||||
@@ -22,6 +24,12 @@ generators.override intel-linux.prebuilt : builtin.lib-generator ;
|
||||
generators.override intel-linux.prebuilt : builtin.prebuilt ;
|
||||
generators.override intel-linux.searched-lib-generator : searched-lib-generator ;
|
||||
|
||||
# Override default do-nothing generators.
|
||||
generators.override intel-linux.compile.c.pch : pch.default-c-pch-generator ;
|
||||
generators.override intel-linux.compile.c++.pch : pch.default-cpp-pch-generator ;
|
||||
|
||||
type.set-generated-target-suffix PCH : <toolset>intel <toolset-intel:platform>linux : pchi ;
|
||||
|
||||
toolset.inherit-rules intel-linux : gcc ;
|
||||
toolset.inherit-flags intel-linux : gcc
|
||||
: <inlining>off <inlining>on <inlining>full <optimization>space
|
||||
@@ -55,7 +63,27 @@ rule init ( version ? : command * : options * )
|
||||
{
|
||||
bin ?= [ common.get-absolute-tool-path $(command[-1]) ] ;
|
||||
root ?= $(bin:D) ;
|
||||
|
||||
|
||||
local command-string = $(command:J=" ") ;
|
||||
local version-output = [ SHELL "$(command-string) --version" ] ;
|
||||
local real-version = [ MATCH "([0-9.]+)" : $(version-output) ] ;
|
||||
local major = [ MATCH "([0-9]+).*" : $(real-version) ] ;
|
||||
|
||||
# If we failed to determine major version, use the behaviour for
|
||||
# the current compiler.
|
||||
if $(major) && [ numbers.less $(major) 10 ]
|
||||
{
|
||||
flags intel-linux.compile OPTIONS $(condition)/<inlining>off : "-Ob0" ;
|
||||
flags intel-linux.compile OPTIONS $(condition)/<inlining>on : "-Ob1" ;
|
||||
flags intel-linux.compile OPTIONS $(condition)/<inlining>full : "-Ob2" ;
|
||||
}
|
||||
else
|
||||
{
|
||||
flags intel-linux.compile OPTIONS $(condition)/<inlining>off : "-inline-level=0" ;
|
||||
flags intel-linux.compile OPTIONS $(condition)/<inlining>on : "-inline-level=1" ;
|
||||
flags intel-linux.compile OPTIONS $(condition)/<inlining>full : "-inline-level=2" ;
|
||||
}
|
||||
|
||||
if $(root)
|
||||
{
|
||||
# Libraries required to run the executable may be in either
|
||||
@@ -74,9 +102,6 @@ rule init ( version ? : command * : options * )
|
||||
|
||||
SPACE = " " ;
|
||||
|
||||
flags intel-linux.compile OPTIONS <inlining>off : "-Ob0" ;
|
||||
flags intel-linux.compile OPTIONS <inlining>on : "-Ob1" ;
|
||||
flags intel-linux.compile OPTIONS <inlining>full : "-Ob2" ;
|
||||
flags intel-linux.compile OPTIONS <optimization>space : "-O1" ; # no specific space optimization flag in icc
|
||||
|
||||
flags intel-linux.compile OPTIONS <warnings>off : -w0 ;
|
||||
@@ -87,22 +112,50 @@ rule compile.c++ ( targets * : sources * : properties * )
|
||||
{
|
||||
gcc.setup-threading $(targets) : $(sources) : $(properties) ;
|
||||
gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
|
||||
DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ;
|
||||
}
|
||||
|
||||
actions compile.c++
|
||||
actions compile.c++ bind PCH_FILE
|
||||
{
|
||||
"$(CONFIG_COMMAND)" -c -xc++ $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
|
||||
"$(CONFIG_COMMAND)" -c -xc++ $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -use-pch"$(PCH_FILE)" -c -o "$(<)" "$(>)"
|
||||
}
|
||||
|
||||
rule compile.c ( targets * : sources * : properties * )
|
||||
{
|
||||
gcc.setup-threading $(targets) : $(sources) : $(properties) ;
|
||||
gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
|
||||
DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ;
|
||||
}
|
||||
|
||||
actions compile.c
|
||||
actions compile.c bind PCH_FILE
|
||||
{
|
||||
"$(CONFIG_COMMAND)" -c -xc $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
|
||||
"$(CONFIG_COMMAND)" -c -xc $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -use-pch"$(PCH_FILE)" -c -o "$(<)" "$(>)"
|
||||
}
|
||||
|
||||
rule compile.c++.pch ( targets * : sources * : properties * )
|
||||
{
|
||||
gcc.setup-threading $(targets) : $(sources) : $(properties) ;
|
||||
gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
|
||||
}
|
||||
#
|
||||
# Compiling a pch first deletes any existing *.pchi file, as Intel's compiler
|
||||
# won't over-write an existing pch: instead it creates filename$1.pchi, filename$2.pchi
|
||||
# etc - which appear not to do anything except take up disk space :-(
|
||||
#
|
||||
actions compile.c++.pch
|
||||
{
|
||||
rm -f "$(<)" && "$(CONFIG_COMMAND)" -x c++-header $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -pch-create "$(<)" "$(>)"
|
||||
}
|
||||
|
||||
rule compile.c.pch ( targets * : sources * : properties * )
|
||||
{
|
||||
gcc.setup-threading $(targets) : $(sources) : $(properties) ;
|
||||
gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
|
||||
}
|
||||
|
||||
actions compile.c.pch
|
||||
{
|
||||
rm -f "$(<)" && "$(CONFIG_COMMAND)" -x c-header $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -pch-create "$(<)" "$(>)"
|
||||
}
|
||||
|
||||
rule link ( targets * : sources * : properties * )
|
||||
@@ -129,3 +182,6 @@ actions link.dll bind LIBRARIES
|
||||
{
|
||||
"$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" -Wl,-soname$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -988,16 +988,22 @@ class msvc-linking-generator : linking-generator
|
||||
{
|
||||
local result = [ linking-generator.generated-targets $(sources)
|
||||
: $(property-set) : $(project) $(name) ] ;
|
||||
if [ $(property-set).get <embed-manifest> ] = "off"
|
||||
|
||||
if $(result)
|
||||
{
|
||||
if ! $(name)
|
||||
{
|
||||
name = [ determine-output-name $(sources) ] ;
|
||||
}
|
||||
|
||||
local name = [ $(result[0]).name ] ;
|
||||
local action = [ $(result[0]).action ] ;
|
||||
result += [ virtual-target.register
|
||||
[ class.new file-target $(name) : MANIFEST : $(project) : $(action) ] ] ;
|
||||
|
||||
if [ $(property-set).get <embed-manifest> ] = "off"
|
||||
{
|
||||
local target = [ class.new file-target $(name) : MANIFEST : $(project) : $(action) ] ;
|
||||
local registered-target = [ virtual-target.register $(target) ] ;
|
||||
if $(action) && ( $(target) != $(registered-target) )
|
||||
{
|
||||
$(action).replace-targets $(target) : $(registered-target) ;
|
||||
}
|
||||
result += $(registered-target) ;
|
||||
}
|
||||
}
|
||||
return $(result) ;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import fortran ;
|
||||
|
||||
feature.extend toolset : pathscale ;
|
||||
toolset.inherit pathscale : unix ;
|
||||
generators.override pathscale.prebuilt : builtin.lib-generator ;
|
||||
generators.override pathscale.prebuilt : builtin.prebuilt ;
|
||||
generators.override pathscale.searched-lib-generator : searched-lib-generator ;
|
||||
|
||||
# Documentation and toolchain description located
|
||||
|
||||
@@ -142,7 +142,14 @@ class stlport-target-class : basic-target
|
||||
name += _static ;
|
||||
}
|
||||
|
||||
name += .$(self.version.5) ;
|
||||
# Starting with version 5.2.0, the STLport static libraries no longer
|
||||
# include a version number in their name
|
||||
local version.pre.5.2 = [ MATCH "^(5[.][01]+).*" : $(version) ] ;
|
||||
if $(version.pre.5.2) || [ feature.get-values <runtime-link> : $(raw) ] != "static"
|
||||
{
|
||||
name += .$(self.version.5) ;
|
||||
}
|
||||
|
||||
name = $(name:J=) ;
|
||||
|
||||
if [ feature.get-values <install-dependencies> : $(raw) ] = "on"
|
||||
|
||||
@@ -49,7 +49,7 @@ generators.register-c-compiler sun.compile.c++ : CPP : OBJ : <toolset>sun ;
|
||||
# Declare flags and actions for compilation
|
||||
flags sun.compile OPTIONS <debug-symbols>on : -g ;
|
||||
flags sun.compile OPTIONS <profiling>on : -xprofile=tcov ;
|
||||
flags sun.compile OPTIONS <optimization>speed : -fast ;
|
||||
flags sun.compile OPTIONS <optimization>speed : -xO4 ;
|
||||
flags sun.compile OPTIONS <optimization>space : -xO2 -xspace ;
|
||||
flags sun.compile OPTIONS <threading>multi : -mt ;
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ feature.feature test-info : : free incidental ;
|
||||
feature.feature testing.arg : : free incidental ;
|
||||
feature.feature testing.input-file : : free dependency ;
|
||||
|
||||
feature.feature preserve-test-targets : off on : incidental propagated ;
|
||||
feature.feature preserve-test-targets : on off : incidental propagated ;
|
||||
|
||||
# Register target types.
|
||||
type.register TEST : test ;
|
||||
|
||||
@@ -6,4 +6,4 @@ import type ;
|
||||
|
||||
type.register EXE ;
|
||||
type.set-generated-target-suffix EXE : <target-os>windows : "exe" ;
|
||||
type.set-generated-target-suffix EXE : <target-os>cygiwn : "exe" ;
|
||||
type.set-generated-target-suffix EXE : <target-os>cygwin : "exe" ;
|
||||
|
||||
@@ -25,6 +25,7 @@ type.set-generated-target-prefix IMPORT_LIB : : "" ;
|
||||
|
||||
type.register SHARED_LIB : so dll dylib : LIB ;
|
||||
type.set-generated-target-suffix SHARED_LIB : <target-os>windows : dll ;
|
||||
type.set-generated-target-suffix SHARED_LIB : <target-os>cygwin : dll ;
|
||||
type.set-generated-target-suffix SHARED_LIB : <target-os>darwin : dylib ;
|
||||
|
||||
type SEARCHED_LIB : : LIB ;
|
||||
|
||||
@@ -16,7 +16,7 @@ import os ;
|
||||
|
||||
feature.extend toolset : vacpp ;
|
||||
toolset.inherit vacpp : unix ;
|
||||
generators.override vacpp.prebuilt : builtin.lib-generator ;
|
||||
generators.override vacpp.prebuilt : builtin.prebuilt ;
|
||||
generators.override vacpp.searched-lib-generator : searched-lib-generator ;
|
||||
|
||||
# Configure the vacpp toolset
|
||||
@@ -69,14 +69,25 @@ flags vacpp LINKFLAGS <debug-symbols>off : -s ;
|
||||
|
||||
if [ os.name ] = AIX
|
||||
{
|
||||
# Tell the linker to discard unneeded object files from archive libraries.
|
||||
# Please note that the static constructors contained by the discarded object
|
||||
# files will not be invoked.
|
||||
flags vacpp.compile C++FLAGS : -qfuncsect ;
|
||||
flags vacpp.link LINKFLAGS <link>static : -qtwolink ;
|
||||
|
||||
# The -bnoipath strips the prepending (relative) path of libraries from
|
||||
# the loader section in the target library or executable. Hence, during
|
||||
# load-time LIBPATH (identical to LD_LIBRARY_PATH) or a hard-coded
|
||||
# -blibpath (*similar* to -lrpath/-lrpath-link) is searched. Without
|
||||
# this option, the prepending (relative) path + library name is
|
||||
# hard-coded in the loader section, causing *only* this path to be
|
||||
# searched during load-time. Note that the AIX linker does not have an
|
||||
# -soname equivalent, this is as close as it gets.
|
||||
#
|
||||
# The above options are definately for AIX 5.x, and most likely also for
|
||||
# AIX 4.x and AIX 6.x. For details about the AIX linker see:
|
||||
# http://download.boulder.ibm.com/ibmdl/pub/software/dw/aix/es-aix_ll.pdf
|
||||
#
|
||||
flags vacpp.link LINKFLAGS <link>shared : -bnoipath ;
|
||||
|
||||
# Run-time linking
|
||||
flags vacpp.link EXE-LINKFLAGS <link>shared : -brtl -qtwolink ;
|
||||
flags vacpp.link EXE-LINKFLAGS <link>shared : -brtl ;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -36,11 +36,19 @@ alias the-other-obj : Other//other-obj ;
|
||||
|
||||
t.write("Other/mygen.jam", """
|
||||
import generators ;
|
||||
import os ;
|
||||
import type ;
|
||||
type.register MY_TYPE : extension ;
|
||||
generators.register-standard mygen.generate-a-cpp-file : MY_TYPE : CPP ;
|
||||
rule generate-a-cpp-file { ECHO Generating a CPP file... ; }
|
||||
actions generate-a-cpp-file { echo "void g() {}" > "$(<)" }
|
||||
if [ os.name ] = NT
|
||||
{
|
||||
actions generate-a-cpp-file { echo void g() {} > "$(<)" }
|
||||
}
|
||||
else
|
||||
{
|
||||
actions generate-a-cpp-file { echo "void g() {}" > "$(<)" }
|
||||
}
|
||||
""")
|
||||
|
||||
t.write("Other/jamfile.jam", """
|
||||
|
||||
@@ -13,8 +13,8 @@ import BoostBuild
|
||||
|
||||
xml = "--xml" in sys.argv
|
||||
toolset = BoostBuild.get_toolset()
|
||||
|
||||
|
||||
|
||||
|
||||
# Clear environment for testing.
|
||||
#
|
||||
for s in ('BOOST_ROOT', 'BOOST_BUILD_PATH', 'JAM_TOOLSET', 'BCCROOT', 'MSVCDir',
|
||||
@@ -42,11 +42,11 @@ def run_tests(critical_tests, other_tests):
|
||||
|
||||
pass_count = 0
|
||||
failures_count = 0
|
||||
|
||||
|
||||
for i in all_tests:
|
||||
passed = 1
|
||||
if not xml:
|
||||
print ("%-25s : " %(i)),
|
||||
if not xml:
|
||||
print ("%-25s : " %(i)),
|
||||
try:
|
||||
__import__(i)
|
||||
except SystemExit:
|
||||
@@ -58,12 +58,12 @@ def run_tests(critical_tests, other_tests):
|
||||
failures_count = failures_count + 1
|
||||
# Restore the current directory, which might be changed by the test.
|
||||
os.chdir(invocation_dir)
|
||||
|
||||
|
||||
if not xml:
|
||||
if passed:
|
||||
print "PASSED"
|
||||
else:
|
||||
print "FAILED"
|
||||
print "FAILED"
|
||||
else:
|
||||
rs = "succeed"
|
||||
if not passed:
|
||||
@@ -79,9 +79,9 @@ def run_tests(critical_tests, other_tests):
|
||||
print """
|
||||
</run>
|
||||
</test-log>
|
||||
"""
|
||||
|
||||
pass_count = pass_count + 1
|
||||
"""
|
||||
if passed:
|
||||
pass_count = pass_count + 1
|
||||
sys.stdout.flush() # Makes testing under emacs more entertaining.
|
||||
|
||||
# Erase the file on success.
|
||||
|
||||
Reference in New Issue
Block a user