Update of /cvsroot/boost/boost/tools/build/v2/tools
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16110/tools/build/v2/tools
Modified Files:
Tag: RC_1_34_0
python.jam common.jam
Log Message:
Support for --with-pydebug builds.
python.jam:
Support for the specification of "_d" extension suffix.
In compute-default-paths, fixed the check for residence in
a "PCBuild.*" directory so we can build against Windows Python built
in a source distribution.
common.jam:
Fixed generation of the "y" tag to look for <python-debugging>on
rather than the whole debug-python build variant.
Fixed some grammar and spelling.
virtual-target.jam:
Added the ability to forego the prepending of "." to a
generated-target-suffix by specifying the suffix enclosed in <...>
libs/python/build/Jamfile.v2:
#define BOOST_DEBUG_PYTHON when <python-debugging>on
Index: python.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/python.jam,v
retrieving revision 1.12.2.49
retrieving revision 1.12.2.50
diff -u -d -r1.12.2.49 -r1.12.2.50
--- python.jam 31 Mar 2007 05:03:31 -0000 1.12.2.49
+++ python.jam 2 Apr 2007 00:51:15 -0000 1.12.2.50
@@ -32,6 +32,8 @@
import sequence ;
import path ;
import feature ;
+import set ;
+import builtin ;
# Make this module a project
project.initialize $(__name__) ;
@@ -77,13 +79,24 @@
# matched against the build configuration when Boost.Build selects a
# Python configuration to use.
#
+# - extension-suffix: A string to append to the name of extension
+# modules before the true filename extension. Ordinarily we would
+# just compute this based on the value of the <python-debugging>
+# feature. However ubuntu's python-dbg package uses the windows
+# convention of appending _d to debug-build extension modules. We
+# have no way of detecting ubuntu, or of probing python for the "_d"
+# requirement, and if you configure and build python using
+# --with-pydebug, you'll be using the standard *nix convention.
+# Defaults to "" (or "_d" when targeting windows and
+# <python-debugging> is set).
+#
# Example usage:
#
# using python 2.3 ;
# using python 2.3 : /usr/local/bin/python ;
-#
-rule init ( version ? : cmd-or-prefix ? : includes ? : libraries ?
- : condition * )
+#
+rule init ( version ? : cmd-or-prefix ? : includes ? : libraries ?
+ : condition * : extension-suffix ? )
{
.configured = true ;
@@ -97,8 +110,8 @@
debug-message " user-specified "$(v): \"$($(v))\" ;
}
}
-
- configure $(version) : $(cmd-or-prefix) : $(includes) : $(libraries) :
$(condition) ;
+
+ configure $(version) : $(cmd-or-prefix) : $(includes) : $(libraries) :
$(condition) : $(extension-suffix) ;
project.pop-current ;
}
@@ -494,7 +507,7 @@
# We ask Python itself what the executable path is
# in case of intermediate symlinks or shell
# scripts.
- local executable-dir = $(executable:D) ;
+ local executable-dir = $(sys.executable:D) ;
if [ MATCH ^(PCBuild) : $(executable-dir:D=) ]
{
@@ -527,6 +540,12 @@
flags python.capture-output PYTHON : <python.interpreter> ;
+#
+# Support for Python configured --with-pydebug
+#
+feature.feature python-debugging : off on : propagated ;
+builtin.variant debug-python : debug : <python-debugging>on ;
+
# Return a list of candidate commands to try when looking for a Python
# interpreter. prefix is expected to be a native path.
local rule candidate-interpreters ( version ? : prefix ? : target-os )
@@ -623,6 +642,10 @@
{
local major-minor = [ split-version $(version) ] ;
lib-version = $(major-minor:J="") ;
+ if <python-debugging>on in $(requirements)
+ {
+ lib-version = $(lib-version)_d ;
+ }
}
if ! $(lib-version)
@@ -638,8 +661,8 @@
}
# implementation of init
-local rule configure (
- version ? : cmd-or-prefix ? : includes ? : libraries ? : condition * )
+local rule configure (
+ version ? : cmd-or-prefix ? : includes ? : libraries ? : condition * :
extension-suffix ? )
{
local prefix ;
local exec-prefix ;
@@ -649,7 +672,13 @@
local target-os = [ feature.get-values target-os : $(condition) ] ;
target-os ?= [ feature.defaults target-os ] ;
target-os = $(target-os:G=) ;
-
+
+ if $(target-os) = windows && <python-debugging>on in $(condition)
+ {
+ extension-suffix ?= _d ;
+ }
+ extension-suffix ?= "" ;
+
# Normalize and dissect any version number
local major-minor ;
if $(version)
@@ -797,8 +826,6 @@
target-requirements += <target-os>$(target-os) ;
- local usage-requirements = [ system-library-dependencies $(target-os) ] ;
-
# See if we can find a framework directory on darwin
local framework-directory ;
if $(target-os) = darwin
@@ -821,15 +848,36 @@
}
}
+ local dll-path = $(libraries) ;
+
# Make sure that we can find the Python DLL on windows
- local dll-path ;
if $(target-os) = windows && $(exec-prefix)
{
dll-path += $(exec-prefix) ;
}
-
+
+ #
+ # prepare usage requirements
+ #
+ local usage-requirements = [ system-library-dependencies $(target-os) ] ;
usage-requirements += <include>$(includes)
<python.interpreter>$(interpreter-cmd) ;
+ if <python-debugging>on in $(condition)
+ {
+ if $(target-os) = windows
+ {
+ # in pyconfig.h, Py_DEBUG is set if _DEBUG is set. If we
+ # define Py_DEBUG we'll get multiple definition warnings.
+ usage-requirements += <define>_DEBUG ;
+ }
+ else
+ {
+ usage-requirements += <define>Py_DEBUG ;
+ }
+ }
+ # Register the right suffix for extensions
+ register-extension-suffix $(extension-suffix) : $(target-requirements) ;
+
#
# Declare the "python" target. This should really be called
# python_for_embedding
@@ -892,22 +940,30 @@
type.register PYTHON_EXTENSION : : SHARED_LIB ;
-# We can't simply assign the "dll" or "so" suffix to PYTHON_EXTENSION,
-# because then we wouldn't know whether "x.dll" is a python extension
-# or an ordinary library. Therefore, we specify only the suffixes used
-# for target generation.
-type.set-generated-target-suffix PYTHON_EXTENSION : : so ;
-type.set-generated-target-suffix PYTHON_EXTENSION : <target-os>windows : pyd ;
-type.set-generated-target-suffix PYTHON_EXTENSION : <target-os>cygwin : dll ;
-
-# Prior to python 2.5, HPUX extension modules had a ".sl" extension
-type.set-generated-target-suffix PYTHON_EXTENSION : <target-os>hpux
<python>2.4 : sl ;
-type.set-generated-target-suffix PYTHON_EXTENSION : <target-os>hpux
<python>2.3 : sl ;
-type.set-generated-target-suffix PYTHON_EXTENSION : <target-os>hpux
<python>2.2 : sl ;
-type.set-generated-target-suffix PYTHON_EXTENSION : <target-os>hpux
<python>2.1 : sl ;
-type.set-generated-target-suffix PYTHON_EXTENSION : <target-os>hpux
<python>2.0 : sl ;
-type.set-generated-target-suffix PYTHON_EXTENSION : <target-os>hpux
<python>1.6 : sl ;
-type.set-generated-target-suffix PYTHON_EXTENSION : <target-os>hpux
<python>1.5 : sl ;
+local rule register-extension-suffix ( root : condition * )
+{
+ local suffix ;
+
+ switch [ feature.get-values target-os : $(condition) ]
+ {
+ case windows : suffix = pyd ;
+ case cygwin : suffix = dll ;
+ case hpux :
+ {
+ if [ feature.get-values python : $(condition) ] in 1.5 1.6 2.0 2.1
2.2 2.3 2.4
+ {
+ suffix = sl ;
+ }
+ else
+ {
+ suffix = so ;
+ }
+ }
+ case * : suffix = so ;
+ }
+
+ type.set-generated-target-suffix PYTHON_EXTENSION : $(condition) :
<$(root).$(suffix)> ;
+}
# Unset 'lib' prefix for PYTHON_EXTENSION
type.set-generated-target-prefix PYTHON_EXTENSION : : "" ;
Index: common.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/common.jam,v
retrieving revision 1.45.2.13
retrieving revision 1.45.2.14
diff -u -d -r1.45.2.13 -r1.45.2.14
--- common.jam 15 Mar 2007 04:02:23 -0000 1.45.2.13
+++ common.jam 2 Apr 2007 00:51:15 -0000 1.45.2.14
@@ -605,11 +605,11 @@
# :: The abbreviated toolset tag being used to build the target.
# <threading>[joiner]
# :: Indication of a multi-threaded build.
-# <runtine>[joiner]
+# <runtime>[joiner]
# :: Collective tag of the build runtime.
# <version:/version-feature | X.Y[.Z]/>[joiner]
# :: Short version tag taken from the given "version-feature"
-# in the build properties. Or if not present the literal
+# in the build properties. Or if not present, the literal
# value as the version number.
# <property:/property-name/>[joiner]
# :: Direct lookup of the given property-name value in the
@@ -790,7 +790,7 @@
if <runtime-debugging>on in $(properties) { tag += g ; }
}
- if <variant>debug-python in $(properties) { tag += y ; }
+ if <python-debugging>on in $(properties) { tag += y ; }
if <variant>debug in $(properties) { tag += d ; }
if <stdlib>stlport in $(properties) { tag += p ; }
if <stdlib-stlport:iostream>hostios in $(properties) { tag += n ; }
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs