summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorAkim Demaille <akim@epita.fr>2001-09-22 17:19:03 +0000
committerAkim Demaille <akim@epita.fr>2001-09-22 17:19:03 +0000
commitf2632e420f295bf6680a3e2e4994d331fa40d982 (patch)
tree1f61b8081e64c4fe3289aedbdfdc6e4ae39af86a /m4
parent19f01e885f8d3f1708a486c35902a1f457068475 (diff)
downloadbison-f2632e420f295bf6680a3e2e4994d331fa40d982.tar.gz
* configure.in: Invoke AM_LIB_DMALLOC.
* src/system.h: Use dmalloc. * src/LR0.c: Be sure to have pointers initialized to NULL. (allocate_itemsets): Allocate kernel_items only if needed.
Diffstat (limited to 'm4')
-rw-r--r--m4/Makefile.am1
-rw-r--r--m4/Makefile.in1
-rw-r--r--m4/dmalloc.m422
3 files changed, 24 insertions, 0 deletions
diff --git a/m4/Makefile.am b/m4/Makefile.am
index 3ed90aa4..a476511c 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -2,6 +2,7 @@
EXTRA_DIST = \
c-bs-a.m4 \
codeset.m4 \
+dmalloc.m4 \
error.m4 \
gettext.m4 \
glibc21.m4 \
diff --git a/m4/Makefile.in b/m4/Makefile.in
index 40e050d6..479108ff 100644
--- a/m4/Makefile.in
+++ b/m4/Makefile.in
@@ -99,6 +99,7 @@ install_sh = @install_sh@
EXTRA_DIST = \
c-bs-a.m4 \
codeset.m4 \
+dmalloc.m4 \
error.m4 \
gettext.m4 \
glibc21.m4 \
diff --git a/m4/dmalloc.m4 b/m4/dmalloc.m4
new file mode 100644
index 00000000..f7246708
--- /dev/null
+++ b/m4/dmalloc.m4
@@ -0,0 +1,22 @@
+## ----------------------------------- ##
+## Check if --with-dmalloc was given. ##
+## From Franc,ois Pinard ##
+## ----------------------------------- ##
+
+# serial 1
+
+AC_DEFUN([AM_WITH_DMALLOC],
+[AC_MSG_CHECKING([if malloc debugging is wanted])
+AC_ARG_WITH(dmalloc,
+[ --with-dmalloc use dmalloc, as in
+ http://www.dmalloc.com/dmalloc.tar.gz],
+[if test "$withval" = yes; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(WITH_DMALLOC,1,
+ [Define if using the dmalloc debugging malloc package])
+ LIBS="$LIBS -ldmalloc"
+ LDFLAGS="$LDFLAGS -g"
+else
+ AC_MSG_RESULT(no)
+fi], [AC_MSG_RESULT(no)])
+])