Bug#561160: boswars: DEB_BUILD_OPTIONS=noopt still compiles with -O2

Kalle Olavi Niemitalo kon at iki.fi
Mon Dec 14 23:30:03 UTC 2009


Kalle Olavi Niemitalo <kon at iki.fi> writes:

> I suggest changing debian/rules to place the optimization options
> in CCFLAGS instead.

Unfortunately, the SConstruct file seems to insist on treating
the whole CCFLAGS as just one argument.  If I run
scons CCFLAGS="-DSTRATAGUS_LIB_PATH=\\\"/usr/share/games/boswars\\\" -O0"
then the -O0 becomes part of the STRATAGUS_LIB_PATH preprocessor macro.

I then tried making debian/rules generate the build_options.py
file before it runs scons.  This way, I can get a CCFLAGS that is
a list rather than a string, and SConstruct properly passes each
argument to the compiler.  Unfortunately, SConstruct also appends
an -O2 option that cancels the previous -O0.  The -O2 is part of
the "release" build variant, which SConstruct makes the default.

The obvious next step then is to build the "debug" variant
instead.  Unfortunately, that doesn't work either:

g++ -o build/debug/action/action_train.o -c -DSTRATAGUS_LIB_PATH=\"/usr/share/games/boswars\" -Wall -g -O0 -g -Wsign-compare -Wall -Werror -DUSE_VORBIS -DUSE_THEORA -DUSE_OGG -DHAVE_STRCASESTR -DHAVE_STRNLEN -DHAVE_X -D_GNU_SOURCE=1 -D_REENTRANT -DDEBUG -I/usr/local/include -I/usr/include/lua5.1 -I/usr/include -I/usr/include/SDL -Iengine/include -Iengine/guichan/include engine/action/action_train.cpp
cc1plus: warnings being treated as errors
In file included from engine/action/action_train.cpp:43:
engine/include/animation.h:57: error: 'typedef' was ignored in this declaration
scons: *** [build/debug/action/action_train.o] Error 1
scons: building terminated because of errors.

g++ 4.3.4 with -Wall warns about the useless typedef, and -Werror
makes that an error.  The typedef has been removed in the
upstream Subversion repository (r9581) but that fix is not yet in
any release.

Anyway, it now seems to me that to get DEB_BUILD_OPTIONS=noopt to
work, Debian would have to patch either the SConstruct script or
the C++ source code.  Support for DEB_BUILD_OPTIONS is only
"recommended" by Debian Policy version 3.8.3.0 section 4.9.1,
though, so this bug is not serious.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-games-devel/attachments/20091215/73575157/attachment.pgp>


More information about the Pkg-games-devel mailing list