[Pythonmac-SIG] Python modules that are a PITA
Ronald Oussoren
oussoren@cistron.nl
Wed, 19 Mar 2003 09:18:20 +0100
On Wednesday, Mar 19, 2003, at 07:10 Europe/Amsterdam, Joel Bender
wrote:
>> Among other things I keep seeing gcc -arch i386 -arch ppc, why do I
>> see -arch i386?
>
> Apparently Apple shipped a bad Makefile. Look in
> /usr/lib/python2.2/config and remove it from there. I've been trying
> to get 4Suite working with similar problems, lots of attempts, and no
> solution yet.
We're using the following snippet in the setup.py for PyObjC, you could
use something like this in PYTHONSTARTUP file when building and
installing extension modules:
if sys.platform == 'darwin':
# Apple has used build options that don't work with a 'normal'
system.
# Remove '-arch i386' from the LDFLAGS.
import distutils.sysconfig
distutils.sysconfig.get_config_vars()
x = distutils.sysconfig._config_vars['LDSHARED']
y = x.replace('-arch i386', '')
if y != x:
print "Fixing Apple strangeness in Python configuration"
distutils.sysconfig._config_vars['LDSHARED'] = y
Ronald