[MEDIUM] Added easier support for Doug Lea's malloc (dlmalloc)

It's now as easy as passing "DLMALLOC_SRC=<path_to_dlmalloc.c>" to
build with support for dlmalloc. The dlmalloc source is not provided
with haproxy in order to ensure that people will use either the most
recent, or the most suited version for their platform. The minimal
mmap size is specified in DLMALLOC_THRES, which defaults to 4096. It
should be increased on platforms with larger pages (eg: 8 kB on some
64 bit systems).
diff --git a/Makefile.osx b/Makefile.osx
index 0a2aa74..f588478 100644
--- a/Makefile.osx
+++ b/Makefile.osx
@@ -1,6 +1,11 @@
 # This makefile is dedicated to darwin (and possibly other BSDs)
 # You should use it this way :
 #   make TARGET=os CPU=cpu
+#
+# Some optional components may be added, such as DLMALLOC :
+#
+#   make DLMALLOC_SRC=/usr/local/src/dlmalloc.c \
+#        OPT_OBJS=src/dlmalloc.o
 
 VERSION := 1.3.12
 
@@ -71,6 +76,9 @@
 # - use -DTPROXY to compile with transparent proxy support.
 DEFINE = -DTPROXY 
 
+# May be changed to patch PAGE_SIZE on every platform when using dlmalloc
+DLMALLOC_THRES=4096
+
 # global options
 TARGET_OPTS=$(COPTS.$(TARGET))
 REGEX_OPTS=$(COPTS.$(REGEX))
@@ -100,6 +108,9 @@
 .c.o:
 	$(CC) $(CFLAGS) -c -o $@ $<
 
+src/dlmalloc.o: $(DLMALLOC_SRC)
+	$(CC) $(CFLAGS) -DDEFAULT_MMAP_THRESHOLD=$(DLMALLOC_THRES) -c -o $@ $<
+
 clean:
 	rm -f *.[oas] src/*.[oas] core haproxy test
 	for dir in . src include/* doc; do rm -f $$dir/*~ $$dir/*.rej;done