[Fedora-packaging] Setting CFLAGS when building python packages

Susi Lehtola jussilehtola at fedoraproject.org
Fri Jul 5 11:07:46 UTC 2013

On Fri, 5 Jul 2013 12:02:58 +0200
Sergio Pascual <sergio.pasra at gmail.com> wrote:

> Hello,
> I was wandering if it is still needed to put set CFLAGS before
> compilling python extensions, like this:
> CFLAGS="%{optflags}" %{__python} setup.py build
> There is nothing about it in the guidelines, altough I recall reading
> about it, so perhaps it was removed from the wiki?
> When comparing the compilation lines with and without setting CFLAGS,
> I see lots of repeated switches but nothing clearly different.

Well, it still seems to be implicitly at

You only need CFLAGS when there are C extensions used. If a package is
pure python, it's noarch and doesn't need the CFLAGS.
Susi Lehtola
Fedora Project Contributor
jussilehtola at fedoraproject.org

More information about the packaging mailing list