[PyQt] Python modules shouldn't link directly to Python framework
on OS X
William Kyngesburye
woklist at kyngchaos.com
Fri Nov 21 18:52:02 GMT 2008
On Nov 21, 2008, at 11:03 AM, Phil Thompson wrote:
>> This will take care of not-linking the python framework - in
>> siputils.py, ModuleMakefile().finalise(), change:
>>
>> self.LFLAGS.append("-F%s" % string.join(dl, os.sep))
>> self.LFLAGS.append("-framework Python")
>>
>> to:
>>
>> self.LFLAGS.append("-undefined dynamic_lookup")
>
> Thanks - it will be in SIP v4.8.
>
Thanks.
When I saw your reply, I suddenly remembered an old ld manpage that
mentioned that dynamic_lookup isn't supported on older OSX versions -
10.2 or earlier.
The default "compatibility" mode on 10.4 and earlier is 10.1, and on
10.5 is 10.5, and thus dynamic_lookup won't work by default on 10.3 or
10.4. You can set this with C flag -macosx_version_min, or macro flag
MACOSX_DEPLOYMENT_TARGET. (I always build for a specific version using
MACOSX_DEPLOYMENT_TARGET, such as 10.4 or 10.5, so I don't run into
old-version issues)
Note that the current python 2.5 and 2.6 binaries for OSX are 10.3
minimum. The system python in OSX 10.4 and 10.3 is v2.3 (the minimum
for SIP). Earlier OSX versions have pre-2.3 pythons (I think). So
supporting OSX before 10.3 is difficult if not impossible.
Also, if (and only if) macosx_version_min or MACOSX_DEPLOYMENT_TARGET
are not set by the user, SIP should add a min version 10.3 to
compilation flags. That could be tricky, since
MACOSX_DEPLOYMENT_TARGET is read while running make, while SIP creates
the makefiles. Maybe SIP documentation just needs a note for OSX
users to set MACOSX_DEPLOYMENT_TARGET to a minimum of 10.3. ie:
export MACOSX_DEPLOYMENT_TARGET=10.3
python configure.py ...
make
My brain not up to the task of working out anything more complex such
as testing for MACOSX_DEPLOYMENT_TARGET or -macosx_version_min in
makefiles or during configuration. The key is that SIP should respect
what the user sets (if it's at least 10.3), before defaulting to 10.3.
-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/
"I ache, therefore I am. Or in my case - I am, therefore I ache."
- Marvin
More information about the PyQt
mailing list