From: David Abrahams (dave_at_[hidden])
Date: 2004-11-12 21:26:53
Vladimir Prus <ghost_at_[hidden]> writes:
> since Boost.Python support is among the few things missing from V2,
> I'm now looking at the logic used by v1 to detect python
> installation locations, and thinking how it could work in V2.
> First, what should the initialization interface be. One possibility:
> # Tries to find the Python root
> using python ;
> # Specifies everything manually
> using python : /usr/include/python2.2 ........... ;
Looks good to me.
> Another approach is to allow several Python versions:
> using python : 2.2 : .......... ;
> is this needed, in your opinion?
It's needed for people like me who want to be able to test against
multiple Python versions.
> Secondly, I'm a bit confused with CYGWIN/NT handling in v1. First,
> it is true that only cygwin version of gcc is supported?
When targeting Cygwin, yes. When targeting NT you can use mingw or,
I suppose, gcc-nocygwin.
> And that cygwin gcc must be also invoked in cygwin shell?
I'm not sure what you mean. bjam invokes cygwin gcc. Do you mean
that bjam must be invoked under the cygwin shell? That's not true;
you can build and test for cygwin gcc under an NT shell. I did that
in part so I could test for cygwin and windows with a single bjam
> Here's the relevant code:
> rule select-nt-python-includes ( toolset variant : properties * )
> if $(toolset) in $(gcc-compilers)
> properties +=
> <sysinclude>$(CYGWIN_PYTHON_$(d)ROOT)/include/python$(CYGWIN_PYTHON_$(d)VERSION) ;
> And CYGWIN_PYTHON_ROOT is initialized like this:
> if $(PYTHON_WINDOWS)
> CYGWIN_PYTHON_ROOT ?= /usr ;
> So, if you're using gcc + msvc on NT, the logic will try using "/usr" as
> python root for gcc and c:/tools/python for msvc, which is a bit
It's intentional. When using gcc in its cygwin mode you need to find
the cygwin installation of Python.
> Actually, why we need *both* CYGWIN_PYTHON_ROOT and PYTHON_ROOT, and use the
> first for gcc and the second for other compilers.
It should be obvious from what I've already written.
> Is it possible to detect
> one Python location and use it for all toolsets?
> What are the problems with that?
Cygwin Python is essentially a Unix build; Windows Python is a Win32
build. They're different and require different treatment.
> Another question is about python debug mode.
> CYGWIN_PYTHON_DEBUG_ROOT ?= /usr/local/pydebug ;
> Am I right that cygwin python uses different roots for debug and release
> while for NT python, we have only different libraries?
> Could you explain why it's so?
You'd have to ask the Python developers why.
-- Dave Abrahams Boost Consulting http://www.boost-consulting.com
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk