mirror of
https://github.com/boostorg/build.git
synced 2026-02-15 00:52:16 +00:00
Quick fix to allow configure different Python versions for different toolsets.
[SVN r33421]
This commit is contained in:
@@ -674,6 +674,22 @@ rule current ( )
|
||||
return $(.current-project) ;
|
||||
}
|
||||
|
||||
# Temporary changes the current project to 'project'. Should
|
||||
# be followed by 'pop-current'.
|
||||
rule push-current ( project )
|
||||
{
|
||||
.saved-current-project += $(.current-project) ;
|
||||
.current-project = $(project) ;
|
||||
}
|
||||
|
||||
rule pop-current ( )
|
||||
{
|
||||
.current-project = $(.saved-current-project[-1]) ;
|
||||
.saved-current-project = $(.saved-current-project[1--2]) ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Returns the project-attribute instance for the specified jamfile module.
|
||||
rule attributes ( project )
|
||||
{
|
||||
|
||||
@@ -39,6 +39,11 @@ import toolset : flags ;
|
||||
project.initialize $(__name__) ;
|
||||
project python ;
|
||||
|
||||
# Save the project so that if 'init' is called several
|
||||
# times we define new targets in the python project,
|
||||
# not in whatever project we were called by.
|
||||
.project = [ project.current ] ;
|
||||
|
||||
# Initializes the Python toolset.
|
||||
# - version -- the version of Python to use. Should be in Major.Minor format,
|
||||
# for example 2.3
|
||||
@@ -57,9 +62,12 @@ project python ;
|
||||
# using python 2.3 : /usr/local ; # Root specified, include and lib paths
|
||||
# # will be guessed
|
||||
#
|
||||
rule init ( version ? : root ? : includes ? : libraries ? : cygwin-condition ? )
|
||||
rule init ( version ? : root ? : includes ? : libraries ?
|
||||
: cygwin-condition * )
|
||||
{
|
||||
.configured = true ;
|
||||
|
||||
project.push-current $(.project) ;
|
||||
|
||||
if [ os.name ] = NT
|
||||
{
|
||||
@@ -71,11 +79,13 @@ rule init ( version ? : root ? : includes ? : libraries ? : cygwin-condition ? )
|
||||
}
|
||||
else if [ modules.peek : UNIX ]
|
||||
{
|
||||
init-unix $(version) : $(root) : $(includes) : $(libraries) ;
|
||||
init-unix $(version) : $(root) : $(includes) : $(libraries) : $(cygwin-condition) ;
|
||||
}
|
||||
|
||||
project.pop-current ;
|
||||
}
|
||||
|
||||
rule init-unix ( version ? : root ? : includes ? : libraries ? )
|
||||
rule init-unix ( version ? : root ? : includes ? : libraries ? : condition * )
|
||||
{
|
||||
root ?= /usr ;
|
||||
includes ?= $(root)/include/python$(version) ;
|
||||
@@ -100,17 +110,17 @@ rule init-unix ( version ? : root ? : includes ? : libraries ? )
|
||||
# loaded in the interpreter, the symbols in the interpreter
|
||||
# are used. If we linked to libpython, we'd get duplicate
|
||||
# symbols. So declare two targets -- one for headers and another
|
||||
# for library.
|
||||
# for library.
|
||||
alias python_for_extensions
|
||||
:
|
||||
:
|
||||
:
|
||||
: $(condition)
|
||||
:
|
||||
: <include>$(includes)
|
||||
;
|
||||
|
||||
alias python
|
||||
:
|
||||
:
|
||||
:
|
||||
: $(condition)
|
||||
:
|
||||
: <include>$(includes)
|
||||
<library-path>$(libraries)
|
||||
|
||||
Reference in New Issue
Block a user