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>
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"
+if BUILD_TESTS
noinst_PROGRAMS = test-libevdev
TESTS = $(noinst_PROGRAMS)
clean-local: gcov-clean
rm -f *.gcno *.gcda
+endif