[Python-Dev] Problem building module against Mac Python 2.4 and Python 2.5

Ronald Oussoren ronaldoussoren at mac.com
Sun Oct 15 22:11:12 CEST 2006


On Oct 15, 2006, at 9:41 PM, Bob Ippolito wrote:

> On 10/15/06, Barry Scott <barry at barrys-emacs.org> wrote:
>> This may be down to my lack of knowledge of Mac OS X development.
>>
>> I want to build my python extension for Python 2.3, 2.4 and 2.5 on
>> the same Mac.
>> Build Python 2.3 and Python 2.4 has been working well for a long
>> time. But
>> after I installed Python 2.5 it seems that I can no longer link a
>> against Python 2.4
>> without changing sym link /Library/Frameworks/Python.framework/
>> Versions/Current
>> to point at the one I want to build against.
>>
>> The problem did not arise with Python 2.3 and Python 2.4 because
>> Python 2.3
>> is in /System/Library and Python 2.4 is in /LIbrary. Telling ld which
>> framework
>> folder to look in allows both to be linked against.
>>
>> Is there a way to force ld to use a particular version of the python
>> framework or do
>> I have to change the symlink each time I build against a different
>> version?
>>
>> This type of problem does not happen on Windows or Unix by design.
>
> Use an absolute path to the library rather than -framework.

That is, add '/Library/Frameworks/Python.framework/Versions/2.4/ 
Python' to the link command instead of '-framework Python'.

>
> Or use distutils!

That's definitely advisable anyway, that way you'll automaticly get  
the right flags to compile and link the extension :-)

Ronald
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3562 bytes
Desc: not available
Url : http://mail.python.org/pipermail/python-dev/attachments/20061015/646f0311/attachment.bin 


More information about the Python-Dev mailing list