Make --enable-debug turn on full debugging information, and --disable-optimize disable all optimizations.

This commit is contained in:
Josh Matthews 2013-11-12 00:50:58 +09:00
parent 651b2f072b
commit 3c80dbbf59

View file

@ -29,24 +29,23 @@ B := $(CFG_BUILD_DIR)
MKFILE_DEPS := config.stamp $(call rwildcard,$(S)mk/,*) MKFILE_DEPS := config.stamp $(call rwildcard,$(S)mk/,*)
# Enable debug!() etc even without configure --enable-debug CFG_GCCISH_CFLAGS += -DRUST_DEBUG
# The evaluation of these prints & their arguments is controlled
# at runtime by the environment variable RUST_LOG.
CFG_RUSTC_FLAGS += -Z debug-info -Z no-debug-borrows
ifdef CFG_DISABLE_OPTIMIZE ifdef CFG_DISABLE_OPTIMIZE
$(info cfg: disabling rustc optimization (CFG_DISABLE_OPTIMIZE)) $(info cfg: disabling rustc optimization (CFG_DISABLE_OPTIMIZE))
CFG_RUSTC_FLAGS += CFG_RUSTC_FLAGS +=
else else
CFG_RUSTC_FLAGS += -O CFG_RUSTC_FLAGS += -O -Z no-debug-borrows
endif endif
ifdef CFG_ENABLE_DEBUG ifdef CFG_ENABLE_DEBUG
$(info cfg: enabling more debugging (CFG_ENABLE_DEBUG)) $(info cfg: enabling more debugging (CFG_ENABLE_DEBUG))
CFG_RUSTC_FLAGS += CFG_RUSTC_FLAGS += -Z extra-debug-info
CFG_GCCISH_CFLAGS += -DRUST_DEBUG
else else
CFG_GCCISH_CFLAGS += -DRUST_NDEBUG # Enable debug!() etc even without configure --enable-debug
# The evaluation of these prints & their arguments is controlled
# at runtime by the environment variable RUST_LOG.
CFG_RUSTC_FLAGS += -Z debug-info
endif endif
export CFG_RUSTC export CFG_RUSTC