Split CONFIG_DEBUG from CONFIG_DEBUG_PESSIMIZE, and consolidate some Rules.mak

stuff along the way.
This commit is contained in:
Rob Landley 2006-05-09 22:08:56 +00:00
parent 2431830018
commit c503df5bdd
2 changed files with 31 additions and 13 deletions

View File

@ -288,17 +288,27 @@ endmenu
menu 'Debugging Options' menu 'Debugging Options'
config CONFIG_DEBUG config CONFIG_DEBUG
bool "Build BusyBox with Debugging symbols" bool "Build BusyBox with extra Debugging symbols"
default n default n
help help
Say Y here if you wish to compile BusyBox with debugging symbols. Say Y here if you wish to examine BusyBox internals while applets are
This will allow you to use a debugger to examine BusyBox internals running. This increases the size of the binary considerably, and
while applets are running. This increases the size of the binary should only be used when doing development. If you are doing
considerably and should only be used when doing development. development and want to debug BusyBox, answer Y.
If you are doing development and want to debug BusyBox, answer Y.
Most people should answer N. Most people should answer N.
config CONFIG_DEBUG_PESSIMIZE
bool "Disable compiler optimizations."
default n
depends on CONFIG_DEBUG
help
The compiler's optimization of source code can eliminate and reorder
code, resulting in an executable that's hard to understand when
stepping through it with a debugger. This switches it off, resulting
in a much bigger executable that more closely matches the source
code.
choice choice
prompt "Additional debugging library" prompt "Additional debugging library"
default CONFIG_NO_DEBUG_LIB default CONFIG_NO_DEBUG_LIB

View File

@ -75,13 +75,14 @@ CFLAGS_EXTRA=$(subst ",, $(strip $(EXTRA_CFLAGS_OPTIONS)))
# This must bind late because srcdir is reset for every source subdirectory. # This must bind late because srcdir is reset for every source subdirectory.
INCS:=-I$(top_builddir)/include -I$(top_srcdir)/include INCS:=-I$(top_builddir)/include -I$(top_srcdir)/include
CFLAGS=$(INCS) -I$(srcdir) CFLAGS=$(INCS) -I$(srcdir) -D_GNU_SOURCE
CFLAGS+=$(CHECKED_CFLAGS) CFLAGS+=$(CHECKED_CFLAGS)
ARFLAGS=cru ARFLAGS=cru
# Warnings # Warnings
CFLAGS += -Wall -Wstrict-prototypes -Wshadow CFLAGS += -Wall -Wstrict-prototypes -Wshadow
LDFLAGS += $(call check_ld,--warn-common,)
# gcc centric. Perhaps fiddle with findstring gcc,$(CC) for the rest # gcc centric. Perhaps fiddle with findstring gcc,$(CC) for the rest
# get the CC MAJOR/MINOR version # get the CC MAJOR/MINOR version
@ -183,7 +184,7 @@ ifeq ($(strip $(shell [ $(CC_MAJOR) -ge 4 -a $(CC_MINOR) -ge 1 ] ; echo $$?)),0)
OPTIMIZATION+=$(call check_gcc,-fno-branch-count-reg,) OPTIMIZATION+=$(call check_gcc,-fno-branch-count-reg,)
endif # gcc-4.1 and beyond endif # gcc-4.1 and beyond
endif endif
OPTIMIZATIONS:=$(OPTIMIZATION) $(call check_gcc,-fomit-frame-pointer,) OPTIMIZATION+=$(call check_gcc,-fomit-frame-pointer,)
# #
#-------------------------------------------------------- #--------------------------------------------------------
@ -207,14 +208,21 @@ else
LIBRARIES:=-lefence LIBRARIES:=-lefence
endif endif
endif endif
# Debugging info
ifeq ($(strip $(CONFIG_DEBUG)),y) ifeq ($(strip $(CONFIG_DEBUG)),y)
CFLAGS +=-g -D_GNU_SOURCE CFLAGS +=-g
LDFLAGS += $(call check_ld,--warn-common,)
else else
CFLAGS+=$(OPTIMIZATIONS) -D_GNU_SOURCE -DNDEBUG CFLAGS +=-DNDEBUG
LDFLAGS += $(call check_ld,--warn-common,)
LDFLAGS += $(call check_ld,--sort-common,) LDFLAGS += $(call check_ld,--sort-common,)
endif endif
ifneq ($(strip $(CONFIG_DEBUG_PESSIMIZE)),y)
else
CFLAGS += $(OPTIMIZATION)
endif
# warn a bit more verbosely for non-release versions # warn a bit more verbosely for non-release versions
ifneq ($(EXTRAVERSION),) ifneq ($(EXTRAVERSION),)
CHECKED_CFLAGS+=$(call check_gcc,-Wstrict-prototypes,) CHECKED_CFLAGS+=$(call check_gcc,-Wstrict-prototypes,)