diff options
author | Rob Landley <rob@landley.net> | 2006-05-09 22:08:56 +0000 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2006-05-09 22:08:56 +0000 |
commit | c503df5bdda79ee9ed755325c0d76350a7a719c8 (patch) | |
tree | de6d49c010d80fc41028bf9ca7ef3872c30a4e18 | |
parent | 2431830018a3cb789af0793647d7ba3db31d72f2 (diff) | |
download | busybox-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.in | 22 | ||||
-rw-r--r-- | Rules.mak | 22 |
2 files changed, 31 insertions, 13 deletions
@@ -288,17 +288,27 @@ endmenu | |||
288 | menu 'Debugging Options' | 288 | menu 'Debugging Options' |
289 | 289 | ||
290 | config CONFIG_DEBUG | 290 | config 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 | ||
301 | config 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 | |||
302 | choice | 312 | choice |
303 | prompt "Additional debugging library" | 313 | prompt "Additional debugging library" |
304 | default CONFIG_NO_DEBUG_LIB | 314 | default CONFIG_NO_DEBUG_LIB |
@@ -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. |
77 | INCS:=-I$(top_builddir)/include -I$(top_srcdir)/include | 77 | INCS:=-I$(top_builddir)/include -I$(top_srcdir)/include |
78 | CFLAGS=$(INCS) -I$(srcdir) | 78 | CFLAGS=$(INCS) -I$(srcdir) -D_GNU_SOURCE |
79 | CFLAGS+=$(CHECKED_CFLAGS) | 79 | CFLAGS+=$(CHECKED_CFLAGS) |
80 | ARFLAGS=cru | 80 | ARFLAGS=cru |
81 | 81 | ||
82 | # Warnings | 82 | # Warnings |
83 | 83 | ||
84 | CFLAGS+=-Wall -Wstrict-prototypes -Wshadow | 84 | CFLAGS += -Wall -Wstrict-prototypes -Wshadow |
85 | LDFLAGS += $(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,) |
184 | endif # gcc-4.1 and beyond | 185 | endif # gcc-4.1 and beyond |
185 | endif | 186 | endif |
186 | OPTIMIZATIONS:=$(OPTIMIZATION) $(call check_gcc,-fomit-frame-pointer,) | 187 | OPTIMIZATION+=$(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 |
209 | endif | 210 | endif |
211 | |||
212 | # Debugging info | ||
213 | |||
210 | ifeq ($(strip $(CONFIG_DEBUG)),y) | 214 | ifeq ($(strip $(CONFIG_DEBUG)),y) |
211 | CFLAGS +=-g -D_GNU_SOURCE | 215 | CFLAGS +=-g |
212 | LDFLAGS += $(call check_ld,--warn-common,) | ||
213 | else | 216 | else |
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,) |
217 | endif | 219 | endif |
220 | |||
221 | ifneq ($(strip $(CONFIG_DEBUG_PESSIMIZE)),y) | ||
222 | else | ||
223 | CFLAGS += $(OPTIMIZATION) | ||
224 | endif | ||
225 | |||
218 | # warn a bit more verbosely for non-release versions | 226 | # warn a bit more verbosely for non-release versions |
219 | ifneq ($(EXTRAVERSION),) | 227 | ifneq ($(EXTRAVERSION),) |
220 | CHECKED_CFLAGS+=$(call check_gcc,-Wstrict-prototypes,) | 228 | CHECKED_CFLAGS+=$(call check_gcc,-Wstrict-prototypes,) |