Python rules for compiling in Mac OS X

Hi all. It seems that the tools/build/v2/tools/python.jam file is broken when used in Mac OS X (darwin). I had many problems when trying to compile libtorrent's python bindings using bjam and they all were finally solved by changing this file. I would suggest applying the following patch to the code. This fixes the missing "python_for_extensions" rule problem, and allows for properly setting the include paths (without relying on env vars). For linking I just used "-framework Python". I don't get what all the $ (PYTHON_FRAMEWORK) stuff is about. With the "official" python install, gcc automatically finds the framework. However, there is still an issue: In rule "init-mac" the "root" variable should not be necessary. When I tried to change that, compilation broke again. I guess there are references to the variable elsewhere that have to be changed first. For now I can compile everything by setting (in user-config.jam): using python : 2.5 : /Library/Frameworks/Python.framework/Versions/2.5 ; Hope this helps, as it should apply to other python-related projects as well. Antony

on Fri Jul 06 2007, Antony Chazapis
Hi all. It seems that the tools/build/v2/tools/python.jam file is broken when used in Mac OS X (darwin). I had many problems when trying to compile libtorrent's python bindings using bjam and they all were finally solved by changing this file.
I would suggest applying the following patch to the code. This fixes the missing "python_for_extensions" rule problem, and allows for properly setting the include paths (without relying on env vars). For linking I just used "-framework Python". I don't get what all the $ (PYTHON_FRAMEWORK) stuff is about. With the "official" python install, gcc automatically finds the framework.
Thanks Antony, Could you please enter this into a Trac ticket at http://svn.boost.org ? -- Dave Abrahams Boost Consulting http://www.boost-consulting.com The Astoria Seminar ==> http://www.astoriaseminar.com
participants (2)
-
Antony Chazapis
-
David Abrahams