From e73e73f8ccaa5b78c81e1ce64bad3599f65b2c90 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Fri, 12 Jan 2007 22:21:04 +0000 Subject: [PATCH] Minor fixes for python on Windows. Handle spaces in pathnames in testing.jam [SVN r36713] --- src/tools/python.jam | 24 +++++++++++++++--------- src/tools/testing.jam | 10 +++++----- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/tools/python.jam b/src/tools/python.jam index a9f5e4e29..5d2f5e631 100644 --- a/src/tools/python.jam +++ b/src/tools/python.jam @@ -381,19 +381,24 @@ rule init-nt ( version : root ? : includes ? : libraries ? : cygwin-condition ? { if ! $(cygwin-condition) { - root ?= c:/tools/python ; - + # The name of Python library file does not have a dot between + # major and minor version. + local PYTHON_VERSION_NODOT = [ regex.match ([0-9]+)[.]([0-9]+).* : $(version) : 1 2 ] ; + + PYTHON_VERSION_NODOT = $(PYTHON_VERSION_NODOT:J="") ; + + root ?= c:/python$(PYTHON_VERSION_NODOT) ; + local PATH = [ modules.peek : PATH ] ; local PATH = [ modules.peek : Path ] ; + PYTHON_INCLUDES = $(includes) ; + PYTHON_LIB_PATH = $(libraries) ; + PYTHON_LIB_PATH ?= $(root)/libs [ GLOB $(root) : PCbuild ] ; PYTHON_INCLUDES ?= $(root)/include [ GLOB $(root) : PC ] ; - # The name of Python library file does not have a dot between - # major and minor version. - local PYTHON_VERSION_NODOT = [ regex.match ([0-9]+)[.]([0-9]+).* : $(version) : 1 2 ] ; - PYTHON_VERSION_NODOT = $(PYTHON_VERSION_NODOT:J="") ; PYTHON_DLL ?= [ GLOB $(PATH) $(Path) : python$(PYTHON_VERSION_NODOT).dll ] ; PYTHON_DEBUG_DLL ?= [ GLOB $(PATH) $(Path) : python$(PYTHON_VERSION_NODOT)_d.dll ] ; @@ -401,16 +406,17 @@ rule init-nt ( version : root ? : includes ? : libraries ? : cygwin-condition ? PYTHON_DEBUG_IMPORT_LIB ?= [ GLOB $(PYTHON_LIB_PATH) : libpython$(PYTHON_VERSION_NODOT).* ] ; + ECHO searching for python.exe in $(root)/bin ; local interpreter = [ common.get-invocation-command - python : python : : $(root)/bin + python.exe : python.exe : : $(root)/bin $(root) $(root)/PCBuild : path-last ] ; if --debug-configuration in [ modules.peek : ARGV ] { - ECHO "notice: Python include path is" $(includes) ; - ECHO "notice: Python library path is" $(libraries) ; + ECHO "notice: Python include path is" $(PYTHON_INCLUDES) ; + ECHO "notice: Python library path is" $(PYTHON_LIB_PATH) ; ECHO "notice: Python interpreter is" $(interpreter) ; ECHO "notice: Python library name is" python$(PYTHON_VERSION_NODOT) ; } diff --git a/src/tools/testing.jam b/src/tools/testing.jam index a43c88c2d..e1ed2cb9e 100644 --- a/src/tools/testing.jam +++ b/src/tools/testing.jam @@ -434,12 +434,12 @@ RM = [ common.rm-command ] ; actions capture-output bind INPUT_FILES output-file { $(PATH_SETUP) - $(LAUNCHER) $(>) $(ARGS) "$(INPUT_FILES)" > $(output-file) 2>&1 + $(LAUNCHER) "$(>)" $(ARGS) "$(INPUT_FILES)" > "$(output-file)" 2>&1 $(SET_STATUS) - $(RUN_OUTPUT_NL) >> $(output-file) - echo EXIT STATUS: $(STATUS) >> $(output-file) + $(RUN_OUTPUT_NL) >> "$(output-file)" + echo EXIT STATUS: $(STATUS) >> "$(output-file)" if $(STATUS_0) - $(CP) $(output-file) $(<) + $(CP) "$(output-file)" "$(<)" $(ENDIF) $(SHELL_SET)verbose=$(VERBOSE_TEST) if $(STATUS_NOT_0) @@ -447,7 +447,7 @@ actions capture-output bind INPUT_FILES output-file $(ENDIF) if $(VERBOSE) echo ====== BEGIN OUTPUT ====== - $(CATENATE) $(output-file) + $(CATENATE) "$(output-file)" echo ====== END OUTPUT ====== $(ENDIF) exit $(STATUS)