Browse code

Makefile: MEMDBG var to control mem debugging mode

- to compile with memory debugging
make MEMDBG=1 cfg; make ...

Daniel-Constantin Mierla authored on 08/02/2010 22:16:47
Showing 1 changed files
... ...
@@ -152,6 +152,11 @@ PATCHLEVEL = 0
152 152
 SUBLEVEL =  99
153 153
 EXTRAVERSION = -dev1
154 154
 
155
+# memory debugger switcher
156
+# 0 - off (release mode)
157
+# 1 - on (devel mode)
158
+MEMDBG ?= 0
159
+
155 160
 SER_VER = $(shell expr $(VERSION) \* 1000000 + $(PATCHLEVEL) \* 1000 + \
156 161
 			$(SUBLEVEL) )
157 162
 RELEASE:=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
... ...
@@ -619,15 +624,12 @@ C_DEFS= $(extra_defs) \
619 619
 	 -DUSE_DNS_FAILOVER \
620 620
 	 -DUSE_DST_BLACKLIST \
621 621
 	 -DUSE_NAPTR \
622
-	 -DDBG_QM_MALLOC \
623 622
 	 #-DUSE_DNS_CACHE_STATS \
624 623
 	 #-DUSE_DST_BLACKLIST_STATS \
625 624
 	 #-DDNS_WATCHDOG_SUPPORT \
626 625
 	 #-DLL_MALLOC \
627 626
 	 #-DSF_MALLOC \
628 627
 	 #-DDL_MALLOC \
629
-	 #-DF_MALLOC \
630
-	 #-DDBG_QM_MALLOC \
631 628
 	 #-DDBG_F_MALLOC \
632 629
 	 #-DNO_DEBUG \
633 630
 	 #-DEXTRA_DEBUG \
... ...
@@ -647,6 +649,11 @@ C_DEFS= $(extra_defs) \
647 647
 # use make mode=debug all instead. Anyway no by default ser is  compiled w/ 
648 648
 # debugging symbols in all cases (-g). --andrei
649 649
 
650
+ifeq ($(MEMDBG), 1)
651
+	C_DEFS+= -DDBG_QM_MALLOC
652
+else
653
+	C_DEFS+= -DF_MALLOC
654
+endif
650 655
 ifeq ($(CORE_TLS), 1)
651 656
 	C_DEFS+= -DUSE_TLS -DCORE_TLS
652 657
 endif