[Distutils] Passing compiler options via the pydistutils.cfg file

kieran hervold hervold at gmail.com
Thu Jan 10 19:02:07 CET 2008


I've run into a problem using mod_python under OS X Leopard: because
the apache2 process runs in 64-bit mode, the python interpreter is
forced into 64-bit mode, which breaks compatibility with any Python
library with underlying C code.

I suspect that adding a compiler flag specifying "-arch x86_64" to any
gcc invocation would fix the problem, but I'd rather not do this
package by package: I'd like to set one global parameter and be done
with it.

Apparently, I can add an entry to the global pydistutils.cfg file.
However, I can't seem to find the appropriate parameter.  The
pydistutils.cfg file follows the nomenclature of command-line setup.py
invocation, but I haven't found a C compiler pass-through parameter
for setup.py.

Does such a parameter exist?  If I want to add a flag ("-arch x86_64",
in this case) to the C compiler invocation, how do I pass that to
setup.py?

Thanks for any help,
   kieran hervold


More information about the Distutils-SIG mailing list