added valgrind support

SVN revision: 17245
This commit is contained in:
tsauerbeck 2005-10-06 18:49:53 +00:00 committed by tsauerbeck
parent 09e9b162f3
commit f31a511494
3 changed files with 40 additions and 2 deletions

View File

@ -35,7 +35,32 @@ if test "x$res" = "xno"; then
fi
AC_SUBST(fnmatch_libs)
# Setting have_valgrind to "no" seems pointless, but we just need to
# put something in as the 4th parameter, so configure doesn't abort
# when valgrind.pc isn't found.
have_valgrind="no"
PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0, have_valgrind=yes, have_valgrind=no)
AC_ARG_ENABLE(valgrind,
[ --enable-valgrind enable valgrind support], [
if [ test "$enableval" = "yes" ]; then
AC_MSG_RESULT(yes)
have_valgrind="yes"
else
AC_MSG_RESULT(no)
have_valgrind="no"
VALGRIND_CFLAGS=""
VALGRIND_LIBS=""
fi
], [
have_valgrind=$have_valgrind
]
)
if test x$have_valgrind = "xyes"; then
AC_DEFINE(HAVE_VALGRIND, 1, [Valgrind support])
fi
MODULE_ARCH="$host_os-$host_cpu"
AC_SUBST(MODULE_ARCH)
AC_DEFINE_UNQUOTED(MODULE_ARCH, "$MODULE_ARCH", "Module architecture")

View File

@ -6,6 +6,7 @@ INCLUDES = -I$(includedir) \
@e_cflags@ \
@x_cflags@ \
@cf_cflags@ \
@VALGRIND_CFLAGS@ \
@EDJE_DEF@
bin_PROGRAMS = \
@ -148,7 +149,7 @@ enlightenment_SOURCES = \
e_main.c \
$(enlightenment_src)
enlightenment_LDFLAGS = -export-dynamic @e_libs@ @x_libs@ @dlopen_libs@ @cf_libs@
enlightenment_LDFLAGS = -export-dynamic @e_libs@ @x_libs@ @dlopen_libs@ @cf_libs@ @VALGRIND_LIBS@
enlightenment_remote_SOURCES = \
e.h \

View File

@ -4,6 +4,10 @@
#include "e.h"
#include "config.h"
#ifdef HAVE_VALGRIND
# include <memcheck.h>
#endif
/* TODO List:
*
* * add module types/classes
@ -65,6 +69,14 @@ int
e_module_shutdown(void)
{
Evas_List *l, *tmp;
#ifdef HAVE_VALGRIND
/* do a leak check now before we dlclose() all those plugins, cause
* that means we won't get a decent backtrace to leaks in there
*/
VALGRIND_DO_LEAK_CHECK
#endif
for (l = _e_modules; l;)
{
tmp = l;