From 1619613414b2f9f73b89b12f4d0be683465bf093 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 29 Jul 2013 14:27:41 +1000 Subject: [PATCH] Make the tests optional to drop unneeded dependencies libevdev has no external dependencies and both check and libudev are only required for running the unit-tests. Make them optional. Signed-off-by: Peter Hutterer Reviewed-by: Benjamin Tissoires --- configure.ac | 6 +++++- test/Makefile.am | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index cfa9746..68df538 100644 --- a/configure.ac +++ b/configure.ac @@ -33,7 +33,11 @@ LT_PREREQ([2.2]) LT_INIT PKG_PROG_PKG_CONFIG() -PKG_CHECK_MODULES(CHECK, [check]) +PKG_CHECK_MODULES(CHECK, [check], [HAVE_CHECK="yes"], [HAVE_CHECK="no"]) +if test "x$HAVE_CHECK" != "xyes"; then + AC_MSG_WARN([check not found - skipping building unit tests]) +fi +AM_CONDITIONAL(BUILD_TESTS, [test "x$HAVE_CHECK" = "xyes"]) if test "x$GCC" = "xyes"; then GCC_CFLAGS="-Wall -Wextra -Wno-unused-parameter -g -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden" diff --git a/test/Makefile.am b/test/Makefile.am index e2c1ca1..12f7176 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,3 +1,4 @@ +if BUILD_TESTS noinst_PROGRAMS = test-libevdev TESTS = $(noinst_PROGRAMS) @@ -71,3 +72,4 @@ endif clean-local: gcov-clean rm -f *.gcno *.gcda +endif -- 2.7.4