Hi Dave

On Wed, September 30, 2009 18:17, Dave Peterson wrote:
> The options distutils uses come from the file at <python env
> root>/lib/python2.5/config/Makefile.  I don't think there is any

Good to know.


> So my first suggestion is that you try redefining the -isysroot option
> in the flags you can specify in your extension's config.  There is a
> good chance the compiler will use the last specification on the line
> rather than doing something else when it gets two values.

I didn't try this because 1) the Python docs say that the config file
(setup.cfg) only allows to change the same set of options that can be
specified on the command line; and 2) the "build_ext" command of setup.py
only knows a very specific and limited set of compiler options (e.g.
preprocessor defines, include paths, additional link libraries, etc.), and
-isysroot is not among these.

I figured out another way to specify -isysroot, though: Within setup.py,
the Extension object can be instantiated with the "extra_compile_args" and
"extra_link_args" arguments. For instance:

--- snip ---
from distutils.core import Extension

aprmd5 = Extension('aprmd5', [... more arguments ...],
                   extra_compile_args = ['-isysroot', '/'],
                   extra_link_args = ['-isysroot', '/'])
--- snip ---


As you suggested, compiler and linker use the last specification of
-isysroot, so I win :-) Compiler and linker now look for headers and libs
in places such as "//usr/include" and "//usr/lib" (notice the double
slash), but the module builds and I can use it!


> HTHs,

Yes it does! It's amazing, I'm still a bit dazed and waiting for the
snag... :-)


Thanks very much
Patrick


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

Reply via email to