From dca25d906bc9c6e9e59094cf5d5d330008355194 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 30 Jan 2007 15:23:09 +0000 Subject: [PATCH] Publish the python interpreter and version number, because others need it [SVN r36846] --- src/tools/python.jam | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/tools/python.jam b/src/tools/python.jam index 5d2f5e631..b0d234563 100644 --- a/src/tools/python.jam +++ b/src/tools/python.jam @@ -104,6 +104,18 @@ rule init ( version ? : root ? : includes ? : libraries ? project.pop-current ; } +# Retrieves the Python interpreter +rule get-python-interpreter ( ) +{ + return $(PYTHON) ; +} + +# Retrieves the Python version number +rule get-python-version ( ) +{ + return [ python-version [ get-python-interpreter ] ] ; +} + local rule python-version ( cmd ) { cmd ?= python ; @@ -352,6 +364,7 @@ rule init-mac ( version : root ? : includes ? : libraries ? ) ECHO "notice: Python interpreter is" $(interpreter) ; } + PYTHON = $(interpreter) ; flags python.capture-output PYTHON : $(interpreter) ; PYTHON_FRAMEWORK ?= $(root) ; @@ -421,9 +434,9 @@ rule init-nt ( version : root ? : includes ? : libraries ? : cygwin-condition ? ECHO "notice: Python library name is" python$(PYTHON_VERSION_NODOT) ; } + PYTHON = $(interpreter) ; flags python.capture-output PYTHON : $(interpreter) ; - - + properties += $(PYTHON_LIB_PATH) ; # msvc compilers auto-find the python library