diff --git a/build/Jamfile b/build/Jamfile index eeb38d64..a76f372a 100644 --- a/build/Jamfile +++ b/build/Jamfile @@ -73,12 +73,13 @@ if $(NT) PYTHON_ROOT ?= c:/tools/python ; PYTHON_INCLUDES ?= $(PYTHON_ROOT)/include <*>/usr/include/python$(PYTHON_VERSION) ; PYTHON_LIBS ?= c:/cygnus/lib/python$(PYTHON_VERSION)/config/libpython$(PYTHON_VERSION).dll.a ; - PYTHON_LIB_PATH = $(PYTHON_ROOT)/libs ; + PYTHON_LIB_PATH ?= $(PYTHON_ROOT)/libs ; # common properties required for compiling any Python module. PYTHON_PROPERTIES ?= <*>SIZEOF_LONG=4 <*>USE_DL_IMPORT + _DEBUG dynamic ; @@ -90,6 +91,10 @@ else if $(UNIX) PYTHON_LIBS ?= /usr/lib/python$(PYTHON_VERSION)/config/libpython$(PYTHON_VERSION).a ; } +local PYTHON_VERSION_NODOT + = [ SUBST $(PYTHON_VERSION) ([0-9]*)\.([0-9]*) $1$2 ] + ; + # how do we invoke python? local PYTHON = $(PYTHON) ; PYTHON ?= python ; @@ -107,14 +112,22 @@ local BOOST_PYTHON_INCLUDES = $(BOOST_ROOT) $(PYTHON_INCLUDES) ; # Base names of the source files for libboost_python local CPP_SOURCES = - classes conversions extension_class functions - init_function module_builder objects types cross_module ; + types classes conversions extension_class functions + init_function module_builder objects cross_module ; lib libboost_python : ../src/$(CPP_SOURCES).cpp # requirements : $(BOOST_PYTHON_INCLUDES) true $(PYTHON_PROPERTIES) ; + +lib libboost_python_d : ../src/$(CPP_SOURCES).cpp + # requirements + : $(BOOST_PYTHON_INCLUDES) + true + $(PYTHON_PROPERTIES) + BOOST_DEBUG_PYTHON + ; ####################### @@ -123,8 +136,14 @@ lib libboost_python : ../src/$(CPP_SOURCES).cpp # Declare a boost python module. Return a list of the DLL files generated. rule boost-python { + local debug ; + if ( BOOST_DEBUG_PYTHON in $(3) ) || ( debug-python in $(BUILD) ) + { + debug = _d ; + } + # declare a DLL; add the boost python library to sources - dll $(<) : libboost_python $(>) + dll $(<) : libboost_python$(debug) $(>) # Requirements : $(3) # caller-specified requirements @@ -132,7 +151,7 @@ rule boost-python # standard requirements $(BOOST_PYTHON_INCLUDES) <*>$(PYTHON_LIB_PATH) - <*>$(PYTHON_LIB_PATH)/python22.lib + <*>$(PYTHON_LIB_PATH)/python$(PYTHON_VERSION_NODOT)$(debug).lib <*>$(PYTHON_LIBS) $(PYTHON_PROPERTIES) @@ -146,9 +165,12 @@ rule boost-python rule boost-python-test { type-DEPENDS test : $(<) ; + type-DEPENDS test_d : $(<)_d ; + NOTFILE test_d ; local gSUPPRESS_FAKE_TARGETS = true ; boost-python $(1) : $(2) : $(3) : $(4) ; + boost-python $(1)_d : $(2) : $(3) BOOST_DEBUG_PYTHON : $(4) ; } ####################### @@ -239,12 +261,17 @@ boost-python-runtest comprehensive : [ join-path $(DOTDOT) test comprehensive.py ] boost_python_test ; +boost-python-runtest comprehensive_d + : [ join-path $(DOTDOT) test comprehensive.py ] + boost_python_test_d ; + ############# simple tests from ../example ############ rule boost-python-example-runtest { boost-python-test $(<) : ../example/$(<).cpp ; boost-python-runtest $(<) : [ join-path $(DOTDOT) example test_$(<).py ] $(<) ; + boost-python-runtest $(<)_d : [ join-path $(DOTDOT) example test_$(<).py ] $(<)_d ; }