aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-05-09 22:08:56 +0000
committerRob Landley <rob@landley.net>2006-05-09 22:08:56 +0000
commitc503df5bdda79ee9ed755325c0d76350a7a719c8 (patch)
treede6d49c010d80fc41028bf9ca7ef3872c30a4e18
parent2431830018a3cb789af0793647d7ba3db31d72f2 (diff)
downloadbusybox-w32-c503df5bdda79ee9ed755325c0d76350a7a719c8.tar.gz
busybox-w32-c503df5bdda79ee9ed755325c0d76350a7a719c8.tar.bz2
busybox-w32-c503df5bdda79ee9ed755325c0d76350a7a719c8.zip
Split CONFIG_DEBUG from CONFIG_DEBUG_PESSIMIZE, and consolidate some Rules.mak
stuff along the way.
-rw-r--r--Config.in22
-rw-r--r--Rules.mak22
2 files changed, 31 insertions, 13 deletions
diff --git a/Config.in b/Config.in
index 6dd4c58e7..bdc4b0a4f 100644
--- a/Config.in
+++ b/Config.in
@@ -288,17 +288,27 @@ endmenu
288menu 'Debugging Options' 288menu 'Debugging Options'
289 289
290config CONFIG_DEBUG 290config CONFIG_DEBUG
291 bool "Build BusyBox with Debugging symbols" 291 bool "Build BusyBox with extra Debugging symbols"
292 default n 292 default n
293 help 293 help
294 Say Y here if you wish to compile BusyBox with debugging symbols. 294 Say Y here if you wish to examine BusyBox internals while applets are
295 This will allow you to use a debugger to examine BusyBox internals 295 running. This increases the size of the binary considerably, and
296 while applets are running. This increases the size of the binary 296 should only be used when doing development. If you are doing
297 considerably and should only be used when doing development. 297 development and want to debug BusyBox, answer Y.
298 If you are doing development and want to debug BusyBox, answer Y.
299 298
300 Most people should answer N. 299 Most people should answer N.
301 300
301config CONFIG_DEBUG_PESSIMIZE
302 bool "Disable compiler optimizations."
303 default n
304 depends on CONFIG_DEBUG
305 help
306 The compiler's optimization of source code can eliminate and reorder
307 code, resulting in an executable that's hard to understand when
308 stepping through it with a debugger. This switches it off, resulting
309 in a much bigger executable that more closely matches the source
310 code.
311
302choice 312choice
303 prompt "Additional debugging library" 313 prompt "Additional debugging library"
304 default CONFIG_NO_DEBUG_LIB 314 default CONFIG_NO_DEBUG_LIB
diff --git a/Rules.mak b/Rules.mak
index 605cce3c2..53dd6a857 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -75,13 +75,14 @@ CFLAGS_EXTRA=$(subst ",, $(strip $(EXTRA_CFLAGS_OPTIONS)))
75 75
76# This must bind late because srcdir is reset for every source subdirectory. 76# This must bind late because srcdir is reset for every source subdirectory.
77INCS:=-I$(top_builddir)/include -I$(top_srcdir)/include 77INCS:=-I$(top_builddir)/include -I$(top_srcdir)/include
78CFLAGS=$(INCS) -I$(srcdir) 78CFLAGS=$(INCS) -I$(srcdir) -D_GNU_SOURCE
79CFLAGS+=$(CHECKED_CFLAGS) 79CFLAGS+=$(CHECKED_CFLAGS)
80ARFLAGS=cru 80ARFLAGS=cru
81 81
82# Warnings 82# Warnings
83 83
84CFLAGS+=-Wall -Wstrict-prototypes -Wshadow 84CFLAGS += -Wall -Wstrict-prototypes -Wshadow
85LDFLAGS += $(call check_ld,--warn-common,)
85 86
86# gcc centric. Perhaps fiddle with findstring gcc,$(CC) for the rest 87# gcc centric. Perhaps fiddle with findstring gcc,$(CC) for the rest
87# get the CC MAJOR/MINOR version 88# get the CC MAJOR/MINOR version
@@ -183,7 +184,7 @@ ifeq ($(strip $(shell [ $(CC_MAJOR) -ge 4 -a $(CC_MINOR) -ge 1 ] ; echo $$?)),0)
183 OPTIMIZATION+=$(call check_gcc,-fno-branch-count-reg,) 184 OPTIMIZATION+=$(call check_gcc,-fno-branch-count-reg,)
184endif # gcc-4.1 and beyond 185endif # gcc-4.1 and beyond
185endif 186endif
186OPTIMIZATIONS:=$(OPTIMIZATION) $(call check_gcc,-fomit-frame-pointer,) 187OPTIMIZATION+=$(call check_gcc,-fomit-frame-pointer,)
187 188
188# 189#
189#-------------------------------------------------------- 190#--------------------------------------------------------
@@ -207,14 +208,21 @@ else
207 LIBRARIES:=-lefence 208 LIBRARIES:=-lefence
208 endif 209 endif
209endif 210endif
211
212# Debugging info
213
210ifeq ($(strip $(CONFIG_DEBUG)),y) 214ifeq ($(strip $(CONFIG_DEBUG)),y)
211 CFLAGS +=-g -D_GNU_SOURCE 215 CFLAGS +=-g
212 LDFLAGS += $(call check_ld,--warn-common,)
213else 216else
214 CFLAGS+=$(OPTIMIZATIONS) -D_GNU_SOURCE -DNDEBUG 217 CFLAGS +=-DNDEBUG
215 LDFLAGS += $(call check_ld,--warn-common,)
216 LDFLAGS += $(call check_ld,--sort-common,) 218 LDFLAGS += $(call check_ld,--sort-common,)
217endif 219endif
220
221ifneq ($(strip $(CONFIG_DEBUG_PESSIMIZE)),y)
222else
223 CFLAGS += $(OPTIMIZATION)
224endif
225
218# warn a bit more verbosely for non-release versions 226# warn a bit more verbosely for non-release versions
219ifneq ($(EXTRAVERSION),) 227ifneq ($(EXTRAVERSION),)
220 CHECKED_CFLAGS+=$(call check_gcc,-Wstrict-prototypes,) 228 CHECKED_CFLAGS+=$(call check_gcc,-Wstrict-prototypes,)