problems build root on OSX against non-system python version

From: Chris Jones <>
Date: Tue, 13 Sep 2011 19:02:36 +0100


I part maintain the root port on MacPorts, and am trying to fix some problems when enabling python support.

In order to be system-neutral (different OSX versions have different versions of system libraries), MacPorts uses as far as possible is own libraries, and not system ones. Therefore I need to configure root to link against the MacPorts version of python (2.6, 2.7 or whatever).

I use the configure command

./configure --with-python-incdir=/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 --with-python-libdir=/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config --enable-python

to point the build at the correct areas. I'm using OS X 10.7

The problem is the configure script looks for the wrong python version

Checking for Python.h ... /opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 Checking for python2.7, libpython2.7, libpython, python, or Python no

so it has decided to look for python2.7. Looking into the ./configure script the problem comes from lines like

  pythonvers=`python -c 'import sys; sys.stdout.write(sys.version[:3])'`

The problem with these lines is they use the system 'python' command to get the version, which on Lion is 2.7

I need to be able to inform the ./configure script that the python binary name it should use is 'python2.6', and not 'python'. Is there anyway to do this ?

cheers Chris

Received on Tue Sep 13 2011 - 20:02:44 CEST

This archive was generated by hypermail 2.2.0 : Tue Sep 13 2011 - 23:50:02 CEST