In article <4dbdcff5.5050...@xs4all.nl>,
 Irmen de Jong <ir...@xs4all.nl> wrote:
> I recently ran into a problem installing a module because it needed to 
> compile an
> extension written in C. The compilation failed because the c extension needed 
> a header
> file+lib that gcc could not find. This was caused by the fact that distutils 
> was adding
> a '-isysroot' parameter to the gcc command line that pointed to the 10.4 SDK 
> location on
> my mac. That SDK location doesn't have the particular header file. The issue 
> is almost
> identical to this old message:
> http://mail.python.org/pipermail/pythonmac-sig/2009-October/021712.html
> 
> In the meantime, I worked around the problem by replacing the Python.org 
> python by a
> non-framework version that I built from source. Building the extension module 
> was fine
> because it could find the c-library dependency just fine from 
> /usr/local/include this time.
> 
> This is on a mac mini powerpc, mac os 10.5.8, python.org python 2.7.1 for 
> ppc+intel.
> 
> My questions are:
> It's only recently that I discovered about the -isysroot option and I'm not 
> sure how to
> deal with it. What would be the right way to solve the error I experienced?
> Can I compile+install custom c libraries in the SDK location? If so, how 
> would I do
> that? (I only seem to manage to compile+install them into /usr/local)

If the extra header files and lib files are in /usr/local, you should be 
able to include those by either modifying the setup.py file included 
with the module or, more simply, by setting the appropriate values in 
the conventional environment variables CFLAGS and LDFLAGS which 
Distutils looks at and uses.  If the module itself requires OS X 
interfaces that are not in the 10.3 ABI (most python.org Pythons are 
built with MACOSX_DEPLOYMENT_TARGET=10.3), you may be able to override 
the -sysroot value by pointing at the 10.5 SDK but I'm not sure that 
really works.  If you could supply an example and open a bug tracker 
issue, that would be good.

The relevant code for 2.7.1 is here:

http://hg.python.org/cpython/file/5395f96588d4/Lib/distutils/ccompiler.py
http://hg.python.org/cpython/file/5395f96588d4/Lib/distutils/unixccompile
r.py

-- 
 Ned Deily,
 n...@acm.org

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG

Reply via email to