diff --git a/README b/README index d3d6257499..4b19c23c8b 100644 --- a/README +++ b/README @@ -11,6 +11,24 @@ EFL is a collection of libraries for handling many common tasks a developer man have such as data structures, communication, rendering, widgets and more. +VALGRIND DEPENDENCY: +------------------------------------------------------------------------------ +EFL uses the concept of memory pools (mempool) and this will confuse +valgrind memcheck tool. By using memory pool, the memory is still +owned by EFL, then valgrind won't alert on memory leaks or use of +unused memory. EFL will use memcheck.h from valgrind to declare its +memory pools to valgrind, producing better debugging results. + +However valgrind is only available to limited platforms, making us +hard to declare it a mandatory requirement. Based on +--with-profile={dev,debug} valgrind will be used if available or will +be issued a warning. You can force valgrind with --enable-valgrind, or +disable it and the warning with --disable-valgrind. + +EFL does NOT link to valgrind libraries. Then there is NO runtime +dependency on valgrind. + + BULLET PHYSICS DEPENDENCY: ------------------------------------------------------------------------------ EFL comes with EPhysics(a physics wrapper library) enabled by default, to diff --git a/configure.ac b/configure.ac index 49909c3313..6a84b5ad75 100644 --- a/configure.ac +++ b/configure.ac @@ -708,7 +708,7 @@ case "${build_profile}" in dev) with_max_log_level="" have_stringshare_usage="no" - want_valgrind="no" + want_valgrind="auto" want_debug_malloc="no" want_debug_threads="no" want_default_mempool="no" @@ -717,7 +717,7 @@ case "${build_profile}" in debug) with_max_log_level="" have_stringshare_usage="yes" - want_valgrind="no" + want_valgrind="auto" want_debug_malloc="yes" want_debug_threads="yes" want_default_mempool="yes" @@ -759,6 +759,23 @@ EFL_ADD_LIBS([EINA], [-lm]) ## Options # Valgrind +AC_ARG_ENABLE([valgrind], + [AC_HELP_STRING([--disable-valgrind], + [enable valgrind mempool declaration. @<:@default=disabled@:>@])], + [ + if test "x${enableval}" = "xyes" ; then + want_valgrind="yes" + else + want_valgrind="no" + fi + ]) + +if test "${want_valgrind}" = "auto"; then + PKG_CHECK_EXISTS([valgrind >= 2.4.0], [want_valgrind="yes"], + [want_valgrind="no" + AC_MSG_WARN([valgrind support desired by --with-profile=${build_profile} but not found. If your platform supports it, install valgrind.])]) +fi + if test "${want_valgrind}" = "no"; then AC_DEFINE([NVALGRIND], [1], [Valgrind support disabled]) else