aboutsummaryrefslogtreecommitdiff
path: root/Makefile.rules
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2007-06-28 19:36:08 +0000
committerDavid Greene <greened@obbligato.org>2007-06-28 19:36:08 +0000
commita696d24ad275608540aba1e5c668bbd52e04317e (patch)
tree6fad9d35105e5dfcbaa83e58a78ef2a7b92f904b /Makefile.rules
parent31ed0fb804dd86fb15093e114701932119914400 (diff)
Add support for building with _GLIBCXX_DEBUG. New configure option
--enable-expensive-checks allows the developer to enable runtime checking that can greatly increase compile time. Currently it only turns on _GLIBCXX_DEBUG. Other expensive debugging checks added later should be controlled by this configure option. This patch also updates llvm-config with a --cppflags option to inform llvm-gcc how to build itself so that it is compatible with an llvm that was built with _GLIBCXX_DEBUG. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37777 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Makefile.rules')
-rw-r--r--Makefile.rules10
1 files changed, 9 insertions, 1 deletions
diff --git a/Makefile.rules b/Makefile.rules
index d83f2fa548..3da11351c0 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -260,6 +260,13 @@ else
C.Flags += -D_DEBUG
endif
+# If DISABLE_EXPENSIVE_CHECKS=1 is specified (make command line or configured),
+# then disable expensive checks by defining the appropriate preprocessor symbols.
+ifdef ENABLE_EXPENSIVE_CHECKS
+ BuildMode := $(BuildMode)+Checks
+ CXX.Flags += -D_GLIBCXX_DEBUG
+endif
+
ifeq ($(ENABLE_PIC),1)
CXX.Flags += -fPIC
C.Flags += -fPIC
@@ -267,7 +274,8 @@ endif
CXX.Flags += $(CXXFLAGS) -Woverloaded-virtual
C.Flags += $(CFLAGS)
-CPP.BaseFlags += $(CPPFLAGS)
+CPP.Defines += $(CPPFLAGS)
+CPP.BaseFlags += $(CPP.Defines)
LD.Flags += $(LDFLAGS)
AR.Flags := cru
LibTool.Flags := --tag=CXX