tests: Use pkg-config to find setbacklight CFLAGS and libs
authorDamien Lespiau <damien.lespiau@intel.com>
Wed, 25 Jul 2012 13:51:09 +0000 (14:51 +0100)
committerKristian Høgsberg <krh@bitplanet.net>
Wed, 25 Jul 2012 14:40:11 +0000 (10:40 -0400)
setbacklight depends on udev and drm, one cannot just add the -l flags
if you want to support unusual install paths.

configure.ac
tests/Makefile.am

index c35d987..a8fc7f2 100644 (file)
@@ -224,6 +224,7 @@ fi
 AC_CHECK_PROG(RSVG_CONVERT, rsvg-convert, rsvg-convert)
 AM_CONDITIONAL(HAVE_RSVG_CONVERT, test -n "$RSVG_CONVERT")
 
+PKG_CHECK_MODULES(SETBACKLIGHT, [libudev libdrm])
 
 if test "x$GCC" = "xyes"; then
        my_common_gcc_flags="-Wall -Wextra -Wno-unused-parameter \
index b788977..1f5514f 100644 (file)
@@ -35,6 +35,7 @@ setbacklight_SOURCES =                                \
        $(top_srcdir)/src/libbacklight.c        \
        $(top_srcdir)/src/libbacklight.h
 
-setbacklight_LDADD = -ludev -ldrm
+setbacklight_CFLAGS = $(AM_CFLAGS) $(SETBACKLIGHT_CFLAGS)
+setbacklight_LDADD = $(SETBACKLIGHT_LIBS)
 
 EXTRA_DIST = weston-test