[issue12242] distutils2 environment marker for current compiler

Éric Araujo report at bugs.python.org
Tue Jun 7 16:41:52 CEST 2011


Éric Araujo <merwok at netwok.org> added the comment:

>> What would the value be for non-C Python implementations?

> I'm not really sure how this idea could have any value for those
> implementations, at least for the ones that can't make use of C
> extensions at all

The question was about the meaning of a new “compiler” environment marker.  Would it be set to the empty string in Jython?  Not available?  Or do you think that there is no issue, since Jython would not try to compiler C files?

> I'm not entirely sure how common this is; even within those people
> who write C extensions, but I'm pretty sure some problems are
> unavoidable, such as compiler-specific options when linking to
> external libraries or compiler-specific ways of specifying
> compatibility options.

The SO page contains some pretty crude hacks.

Instead of putting more things into the PEP 345 environment markers, why not extend the extra_compile_args field to take a dictionary mapping regexes to match compiler names and versions to arguments?

In code:

Extension(..., extra_compile_args={'gcc': '-fo',
                                   'gcc .* 4.2': '-foo'})

In setup.cfg:

[build_ext] (or maybe extensions section)
extra_args =
  gcc = -fo
  gcc .* 4.2 = -foo

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12242>
_______________________________________


More information about the Python-bugs-list mailing list