[Mesa-dev] [PATCH] Fix usage of Python in Makefiles

Matthew William Cox matt at mattcox.ca
Tue Oct 26 16:12:36 PDT 2010


Firstly, Kenneth Graunke's patch fixes the autoconf issue and supercedes
this patch, so we should focus the review on that patch.

On Tue, Oct 26, 2010 at 06:23:00AM -0700, Dan Nicholson wrote:
> However, removing the second -O from PYTHON_FLAGS is really a separate
> change.  Can you explain that problem in more detail?

The second -O flag triggers the same behaviour as passing -OO to the
python interpreter. A single -O enables optimizations, but -OO causes
doc strings to be stripped from the bytecode in addition to enabling
optimization. There's no real reason to do this, except perhaps to save
a small amount of memory.

This breaks u_format_srgb.py because that script uses its docstring as
part of its output, specifically, the copyright notice of the module is
copied to the output. If the docstring is stripped, this causes an
exception as the __doc__ variable is undefined.

> It might also be more reasonable to just drop $(PYTHON_FLAGS) when
> using src/gallium/auxiliary/util/u_format_srgb.py so this isn't a
> global change.

There's really no global effect to dropping the second -O, and it's more
consistent to use the same flags for everything. Why introduce a special

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20101026/bf41da4c/attachment.pgp>

More information about the mesa-dev mailing list