From 81a2cf7de059954f9f026a6064f9dc4424a31196 Mon Sep 17 00:00:00 2001 From: Sean V Kelley Date: Fri, 3 Feb 2017 22:17:33 -0800 Subject: [PATCH] config: Add va_messaging flag on by default, but allows optional disabling. fixes #21 Signed-off-by: Sean V Kelley --- configure.ac | 11 +++++++++++ va/va.c | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/configure.ac b/configure.ac index 540bdce..b14d624 100644 --- a/configure.ac +++ b/configure.ac @@ -153,6 +153,11 @@ AC_ARG_ENABLE([wayland], [build with VA/Wayland API support @<:@default=yes@:>@])], [], [enable_wayland="yes"]) +AC_ARG_ENABLE([va-messaging], + [AC_HELP_STRING([--enable-va-messaging], + [build with va info and error messaging @<:@default=yes@:>@])], + [], [enable_va_messaging="yes"]) + AC_ARG_ENABLE(dummy-driver, [AC_HELP_STRING([--enable-dummy-driver], [build dummy video driver @<:@default=yes@:>@])], @@ -186,6 +191,11 @@ if test "$enable_docs" = "yes"; then fi AM_CONDITIONAL(ENABLE_DOCS, test "$enable_docs" = "yes") +# Check for va messaging +if test "$enable_va_messaging" = "yes"; then + AC_DEFINE([ENABLE_VA_MESSAGING], [1], [Defined to 1 if va messaging is needed]) +fi + # Check for __attribute__((visibility())) AC_CACHE_CHECK([whether __attribute__((visibility())) is supported], ac_cv_have_gnuc_visibility_attribute, @@ -340,4 +350,5 @@ echo Default driver path .............. : $LIBVA_DRIVERS_PATH echo Extra window systems ............. : $BACKENDS echo Build dummy driver ............... : $enable_dummy_driver echo Build documentation .............. : $enable_docs +echo Build with messaging ............. : $enable_va_messaging echo diff --git a/va/va.c b/va/va.c index 5040dc1..d83fd60 100644 --- a/va/va.c +++ b/va/va.c @@ -155,6 +155,7 @@ vaMessageCallback vaSetInfoCallback(vaMessageCallback callback) void va_errorMessage(const char *msg, ...) { +#if ENABLE_VA_MESSAGING char buf[512], *dynbuf; va_list args; int n, len; @@ -179,10 +180,12 @@ void va_errorMessage(const char *msg, ...) } else if (len > 0) va_log_error(buf); +#endif } void va_infoMessage(const char *msg, ...) { +#if ENABLE_VA_MESSAGING char buf[512], *dynbuf; va_list args; int n, len; @@ -207,6 +210,7 @@ void va_infoMessage(const char *msg, ...) } else if (len > 0) va_log_info(buf); +#endif } static bool va_checkVtable(void *ptr, char *function) -- 2.11.0