summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--acconfig.h.in2
-rw-r--r--configure.in.in13
-rw-r--r--main/php.h4
3 files changed, 19 insertions, 0 deletions
diff --git a/acconfig.h.in b/acconfig.h.in
index 55c94a3790..b89717449d 100644
--- a/acconfig.h.in
+++ b/acconfig.h.in
@@ -10,6 +10,8 @@
#define CONFIGURATION_FILE_PATH "php3.ini"
#define USE_CONFIG_FILE 1
+#undef HAVE_DMALLOC
+
/* Some global constants defined by conigure */
#undef PHP_BUILD_DATE
#undef PHP_OS
diff --git a/configure.in.in b/configure.in.in
index 5e70749521..1a8ef8a8e5 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -838,6 +838,19 @@ AC_ARG_ENABLE(url-fopen-wrapper,
AC_MSG_RESULT(yes)
])
+DMALLOC_RESULT=no
+AC_MSG_CHECKING(whether to enable dmalloc)
+AC_ARG_ENABLE(dmalloc,
+[ --enable-dmalloc Enable dmalloc],
+[
+ if test "$enableval" = "yes" ; then
+ AC_DEFINE(HAVE_DMALLOC, 1)
+ AC_ADD_LIBRARY(dmalloc)
+ CFLAGS="$CFLAGS -DDMALLOC_FUNC_CHECK"
+ DMALLOC_RESULT=yes
+ fi
+])
+AC_MSG_RESULT($DMALLOC_RESULT)
divert(3)
diff --git a/main/php.h b/main/php.h
index 8872f198a0..75e392d567 100644
--- a/main/php.h
+++ b/main/php.h
@@ -33,6 +33,10 @@
#ifndef _PHP_H
#define _PHP_H
+#ifdef HAVE_DMALLOC
+#include <dmalloc.h>
+#endif
+
#define PHP_API_VERSION 19990421
#define YYDEBUG 0