I\'m trying to build a Python extension on MacOSX 10.6 and to link it against several frameworks (i386 only). I made a setup.py file, using distutils and the Extension object.>
Although long after the dust has settled, having the same question myself I dug around a little bit and found this:
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/sysconfig.py
if 'ARCHFLAGS' in os.environ:
archflags = os.environ['ARCHFLAGS']
else:
archflags = '-arch i386 -arch ppc -arch x86_64'
_config_vars['ARCHFLAGS'] = archflags
if archflags.strip() != '':
_config_vars['CFLAGS'] = _config_vars['CFLAGS'] + ' ' + archflags
_config_vars['LDFLAGS'] = _config_vars['LDFLAGS'] + ' ' + archflags
I'm coming at the problem from a different angle - on 10.6 distutils is trying to build C extensions and as complains because there's no PPC portion in the 10.6 SDK.
However,
export ARCHFLAGS="-arch i386 -arch x86_64"
python setup.py build
Worked like a charm.