From 0390c210ca9a928bdf3ecce7bd8076b44943a4b9 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 22 Mar 2006 06:56:28 +0000 Subject: [PATCH] When Python is initialized several times, for different toolsets, use only one interpreter command when running Boost.Python tests, not all initialized ones. [SVN r33428] --- src/tools/python.jam | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/tools/python.jam b/src/tools/python.jam index 475976684..3377f3d7a 100644 --- a/src/tools/python.jam +++ b/src/tools/python.jam @@ -92,18 +92,35 @@ rule init-unix ( version ? : root ? : includes ? : libraries ? : condition * ) libraries ?= $(root)/lib/python$(version)/config ; # Find the 'python' binary, which is used for testing. - # Look first in $(root)/bin, then in PATH. + # Look first in $(root)/bin, then in PATH. local interpreter = [ common.get-invocation-command python : python : : $(root)/bin : path-last ] ; + if $(interpreter:D) != $(root)/bin + { + ECHO "warning: was expecting Python interpreter in " $(root)/bin ; + ECHO "warning: found only in PATH:" $(interpreter) ; + } + if --debug-configuration in [ modules.peek : ARGV ] { ECHO "notice: Python include path is" $(includes) ; ECHO "notice: Python library path is" $(libraries) ; - ECHO "notice: Python interpreter is" $(interpreter) ; + ECHO "notice: Python interpreter is" $(interpreter) ; + } + + # If not specific condition is specified, set global value + # If condition is specified, set PYTHON on target. It will + # override the global value. + if ! $(condition) + { + PYTHON = $(interpreter) ; + } + else + { + flags python.capture-output PYTHON $(condition:J=/) : $(interpreter) ; } - flags python.capture-output PYTHON : $(interpreter) ; # On Linux, we don't want to link either Boost.Python or # Python extensions to libpython, so that when extensions