[PATCH weston 20/20] configure: make setbacklight optional

Pekka Paalanen ppaalanen at gmail.com
Fri Aug 3 04:39:16 PDT 2012


Modify the pkg-config check for setbacklight so that failure only
disables building setbacklight, instead of failing the whole configure.

Signed-off-by: Pekka Paalanen <ppaalanen at gmail.com>
---
 configure.ac      |    3 ++-
 tests/Makefile.am |    6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 754469f..f8a1b6a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -216,7 +216,8 @@ 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])
+PKG_CHECK_MODULES(SETBACKLIGHT, [libudev libdrm], enable_setbacklight=yes, enable_setbacklight=no)
+AM_CONDITIONAL(BUILD_SETBACKLIGHT, test "x$enable_setbacklight" = "xyes")
 
 if test "x$GCC" = "xyes"; then
 	my_common_gcc_flags="-Wall -Wextra -Wno-unused-parameter \
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 1f5514f..80f6db8 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -22,7 +22,7 @@ event_test_la_SOURCES = event-test.c $(test_runner_src)
 test_client_SOURCES = test-client.c
 test_client_LDADD = $(SIMPLE_CLIENT_LIBS)
 
-noinst_PROGRAMS = setbacklight matrix-test
+noinst_PROGRAMS = $(setbacklight) matrix-test
 
 matrix_test_SOURCES =				\
 	matrix-test.c				\
@@ -38,4 +38,8 @@ setbacklight_SOURCES =				\
 setbacklight_CFLAGS = $(AM_CFLAGS) $(SETBACKLIGHT_CFLAGS)
 setbacklight_LDADD = $(SETBACKLIGHT_LIBS)
 
+if BUILD_SETBACKLIGHT
+setbacklight = setbacklight
+endif
+
 EXTRA_DIST = weston-test
-- 
1.7.8.6



More information about the wayland-devel mailing list