Bug 4352 - Makefile: allow custom optimization flags
Status: RESOLVED WONTFIX
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Misc
Version: GIT MASTER
Hardware: All All
: P3 normal
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2009-11-22 17:20 EST by Andrey Vihrov
Modified: 2010-10-12 02:40:51 EDT
1 user (show)

See Also:


Attachments
Proposed changes (674 bytes, patch)
2009-11-22 17:20 EST, Andrey Vihrov

Description Andrey Vihrov 2009-11-22 17:20:52 EST
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.
Comment 2 Ludwig Nussel 2010-10-12 02:40:51 EDT
the feature is already there
make release OPTIMIZEVM="bar" OPTIMIZE="bar"