summaryrefslogtreecommitdiff
path: root/Makefile.rules
diff options
context:
space:
mode:
authorGeorge Joseph <george.joseph@fairview5.com>2016-03-12 15:02:20 -0700
committerGeorge Joseph <george.joseph@fairview5.com>2016-03-13 14:53:35 -0600
commit32f0a3d52a45e1c59274e271a83722cafbf5f231 (patch)
tree4a8d56521c8f7705003f7216185eb8b4e13dc884 /Makefile.rules
parented34bbdf9becaa61fa2ae544605426b6c6bbbb0f (diff)
build_system: Split COMPILE_DOUBLE from DONT_OPTIMIZE
I can't ever recall actually needing the intermediate files or the checking that a double compile produces. What I CAN remember is every DONT_OPTIMIZE build needing 3 invocations of gcc instead of 1 just to do the checks and produce those intermediate files. Having said that, Richard pointed out that the reason for the double compile was that there were cases in the past where a submitted patch failed to compile because the submitter never tried it with the optimizations turned on. To get the best of both worlds, COMPILE_DOUBLE has been split into its own option. If DONT_OPTIMIZE is turned on, COMPILE_DOUBLE will also be selected BUT you can then turn it off if all you need are the debugging symbols. This way you have to make an informed decision about disabling COMPILE_DOUBLE. To allow COMPILE_DOUBLE to be both auto-selected and turned off, a new feature was added to menuselect. The <use> element can now contain an "autoselect" attribute which will turn the used member on but not create a hard dependency. The cflags.xml implementation for COMPILE_DOUBLE looks like this... <member name="DONT_OPTIMIZE" displayname="Disable Optimizations ..."> <use autoselect="yes">COMPILE_DOUBLE</use> <support_level>core</support_level> </member> <member name="COMPILE_DOUBLE" displayname="Pre-compile with ...> <depend>DONT_OPTIMIZE</depend> <support_level>core</support_level> </member> When DONT_OPTIMIZE is turned on, COMPILE_DOUBLE is turned on because of the use. When DONT_OPTIMIZE is turned off, COMPILE_DOUBLE is turned off because of the depend. When COMPILE_DOUBLE is turned on, DONT_OPTIMIZE is turned on because of the depend. When COMPILE_DOUBLE is turned off, DONT_OPTIMIZE is left as is because it only uses COMPILE_DOUBLE, it doesn't depend on it. I also made a few tweaks to the ncurses implementation to move things left a bit to allow longer descriptions. Change-Id: Id49ca930ac4b5ec4fc2d8141979ad888da7b1611
Diffstat (limited to 'Makefile.rules')
-rw-r--r--Makefile.rules10
1 files changed, 6 insertions, 4 deletions
diff --git a/Makefile.rules b/Makefile.rules
index 1031f2def..a22f19c16 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -103,13 +103,15 @@ CC_LIBS=$(PTHREAD_LIBS) $(LIBS)
CXX_LIBS=$(PTHREAD_LIBS) $(LIBS)
# determine whether to double-compile so that the optimizer can report code path problems
-# this is only done when developer mode and DONT_OPTIMIZE are both enabled
-# in that case, we run the preprocessor to produce a .i or .ii file from the source
+# In this case, we run the preprocessor to produce a .i or .ii file from the source
# code, then compile once with optimizer enabled (and the output to /dev/null),
# and if that doesn't fail then compile again with optimizer disabled
-ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS))$(AST_DEVMODE),DONT_OPTIMIZEyes)
+
+ifeq ($(findstring COMPILE_DOUBLE,$(MENUSELECT_CFLAGS)),COMPILE_DOUBLE)
COMPILE_DOUBLE=yes
-else
+endif
+
+ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS))$(AST_DEVMODE),)
_ASTCFLAGS+=$(AST_FORTIFY_SOURCE)
endif