Description: Enforce the use of the installed libevdev for tests
Author: Stephen Kitt <skitt@debian.org>

Note that this is only intended for running the autopkgtest
test-suite; if used for the build it requires libevdev-dev to be
installed...

--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -6,14 +6,6 @@
 
 TESTS = $(run_tests)
 
-libevdev_sources = $(top_srcdir)/libevdev/libevdev.c \
-		   $(top_srcdir)/libevdev/libevdev.h \
-		   $(top_srcdir)/libevdev/libevdev-names.c \
-		   $(top_srcdir)/libevdev/libevdev-uinput.h \
-		   $(top_srcdir)/libevdev/libevdev-uinput.c \
-		   $(top_srcdir)/libevdev/libevdev-uinput-int.h \
-		   $(top_srcdir)/libevdev/libevdev-util.h \
-		   $(top_srcdir)/libevdev/libevdev-int.h
 common_sources = $(libevdev_sources) \
 		 test-common-uinput.c \
 		 test-common-uinput.h \
@@ -21,7 +13,7 @@
 		 test-common.h
 
 # include builddir for event-names.h
-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include -I$(top_builddir)/libevdev $(CHECK_CFLAGS) $(GCOV_CFLAGS)
+AM_CPPFLAGS = $(CHECK_CFLAGS) $(GCOV_CFLAGS)
 
 test_libevdev_SOURCES = \
 			test-main.c \
@@ -34,19 +26,17 @@
 			test-uinput.c \
 			$(common_sources)
 
-test_libevdev_LDADD =  $(CHECK_LIBS) $(GCOV_LDFLAGS)
+test_libevdev_LDADD =  $(CHECK_LIBS) $(GCOV_LDFLAGS) -levdev
 
 test_compile_pedantic_SOURCES = test-compile-pedantic.c
 test_compile_pedantic_CFLAGS = $(AM_CPPFLAGS) -pedantic -Werror -std=c90
 
 test_link_SOURCES = test-link.c
-test_link_CFLAGS = -I$(top_srcdir)
-test_link_LDADD = $(top_builddir)/libevdev/libevdev.la
+test_link_LDADD = -levdev
 
 test_kernel_SOURCES = \
 		      test-kernel.c \
 		      $(common_sources)
-test_kernel_CFLAGS = -I$(top_srcdir)
 test_kernel_LDADD = \
 		    $(CHECK_LIBS) \
 		    $(top_builddir)/libevdev/libevdev.la
