configure: Allow valgrind support to be manually enabled

Irrespective of the DDX debug settings, some people wish to run Xorg
under valgrind and so prefer to have the cleaner output by making the
DDX valgrind aware.

(Actually Maarten wants valgrind support enabled by default...)

Suggested-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson
2013-04-06 15:42:23 +01:00
parent 091cf6f047
commit 5332d5a7e0

View File

@@ -353,6 +353,12 @@ AC_ARG_ENABLE(debug,
[Enables internal debugging [default=no]]),
[DEBUG="$enableval"],
[DEBUG=no])
AC_ARG_ENABLE(valgrind,
AS_HELP_STRING([--enable-valgrind],
[Enables valgrindified ioctls for debugging [default=no]]),
[VG="$enableval"],
[VG=no])
# Store the list of server defined optional extensions in REQUIRED_MODULES
XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
@@ -439,12 +445,22 @@ AM_CONDITIONAL(DEBUG, test x$DEBUG != xno)
AM_CONDITIONAL(FULL_DEBUG, test x$DEBUG = xfull)
if test "x$DEBUG" = xno; then
AC_DEFINE(NDEBUG,1,[Disable internal debugging])
else
if test "x$VG" != xyes; then
VG=auto
fi
fi
if test "x$DEBUG" != xno; then
if test "x$VG" != xno; then
PKG_CHECK_MODULES(VALGRIND, [valgrind], have_valgrind=yes, have_valgrind=no)
AC_MSG_CHECKING([whether to include valgrind support])
if test x$have_valgrind = xyes; then
AC_DEFINE([HAVE_VALGRIND], 1, [Use valgrind intrinsics to suppress false warnings])
else
if test "x$VG" = xyes; then
AC_MSG_ERROR([valgrind support requested, but valgrind-dev headers not found])
fi
fi
AC_MSG_RESULT([$have_valgrind ($VG)])
fi
if test "x$DEBUG" = xsync; then
AC_DEFINE(DEBUG_SYNC,1,[Enable synchronous rendering for debugging])