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 <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
Peter Hutterer 2013-07-29 14:27:41 +10:00
parent 55191e0502
commit 1619613414
2 changed files with 7 additions and 1 deletions

View file

@ -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"

View file

@ -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