Created attachment 2207[details]
Proposed changes
Currently, ioquake3 Makefile respects user supplied CFLAGS, but just adds them
to the list of default ones. If the user wants to use own custom optimization
flags which conflict with default flags (OPTIMIZE and OPTIMIZEVM variables),
the user should be able to override the defaults in favor of custom CFLAGS. An
example for such use is the linux-i386 platform, where default OPTIMIZE
contains -march=i586, which is suboptimal on modern CPUs - most people building
ioquake3 for this platform will want to use -march=native, -march=core2 or
another.
Attaching a patch that makes such functionality available. The OPTIMIZE and
OPTIMIZEVM variables are not simply emptied, but rather filtered because some
platforms add -DNDEBUG to the variables' values, which should be preserved even
in case of custom CFLAGS. Another solution for this would be introducing an
additional OPTIMIZE_CPPFLAGS variable.
Comment 1|ALPHA| Mad Professor
2010-06-01 10:52:52 EDT
Ping! This applies cleanly to SVN HEAD and is useful for people who want more conservative optimization flags.
Created attachment 2207 [details] Proposed changes Currently, ioquake3 Makefile respects user supplied CFLAGS, but just adds them to the list of default ones. If the user wants to use own custom optimization flags which conflict with default flags (OPTIMIZE and OPTIMIZEVM variables), the user should be able to override the defaults in favor of custom CFLAGS. An example for such use is the linux-i386 platform, where default OPTIMIZE contains -march=i586, which is suboptimal on modern CPUs - most people building ioquake3 for this platform will want to use -march=native, -march=core2 or another. Attaching a patch that makes such functionality available. The OPTIMIZE and OPTIMIZEVM variables are not simply emptied, but rather filtered because some platforms add -DNDEBUG to the variables' values, which should be preserved even in case of custom CFLAGS. Another solution for this would be introducing an additional OPTIMIZE_CPPFLAGS variable.