summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-02-06 18:40:49 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-02-06 18:40:49 (GMT)
commit7b3ca7accd4103bb5069d31b2389ea76c57846ca (patch)
treecdc9e63e83691131bcb427148edd340bd353d791 /configure.ac
parent3e6da2a6085a2bc04dd5324f7ee74633a53543f3 (diff)
Introduced a tracker for GObjects leaks.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac16
1 files changed, 16 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 3043e7e..11a6a85 100644
--- a/configure.ac
+++ b/configure.ac
@@ -162,6 +162,11 @@ fi
AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [compile with debugging support [default=no]]),
[], [enable_debug=no])
+AC_ARG_WITH(gobject-leak-tracker,
+ AS_HELP_STRING([--with-gobject-leak-tracker],
+ [track remaining GObject instances at exit (imply --enable-debug and GLib support) [default=no]]),
+ [], [with_gobject_leak_tracker=no])
+
AC_ARG_WITH(local-resources,
AS_HELP_STRING([--with-local-resources], [discard resources from local sources [default=yes]]),
[], [with_local_resources=yes])
@@ -172,6 +177,10 @@ CFLAGS="$CFLAGS -fshort-enums -D_LARGEFILE64_SOURCE"
#--- Is debug mode needed ?
+if test "x$with_gobject_leak_tracker" = "xyes"; then
+ enable_debug="yes"
+fi
+
if test "x$enable_debug" = "xyes"; then
DEBUG_CFLAGS="$DEBUG_CFLAGS -O0 -ggdb -gdwarf-2 -DDEBUG"
else
@@ -180,6 +189,13 @@ fi
AC_SUBST(DEBUG_CFLAGS)
+AM_CONDITIONAL([TRACK_GOBJECT_LEAKS], [test "x$with_gobject_leak_tracker" = "xyes"])
+
+if test "x$with_gobject_leak_tracker" = "xyes"; then
+ AC_DEFINE(TRACK_GOBJECT_LEAKS, 1,
+ [Define to 1 to enable code for dumping remaining GObject instances at exit.])
+fi
+
#--- Discard local sources when looking for resources ?
if test "x$with_local_resources" = "xno"; then