Currently it's possible to have non-empty CAIRO_LIBS (because cairo was
(mis)detected) and HAVE_CAIRO=0 (because user supplied
--disable-cairo-tests).

Signed-off-by: Marcin Ślusarz <marcin.slusarz at gmail.com>
---
 tests/kms/Makefile.am      | 9 +++++++--
 tests/modetest/Makefile.am | 5 ++++-
 tests/util/Makefile.am     | 2 ++
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/tests/kms/Makefile.am b/tests/kms/Makefile.am
index 6645af7..1003829 100644
--- a/tests/kms/Makefile.am
+++ b/tests/kms/Makefile.am
@@ -30,7 +30,12 @@ noinst_PROGRAMS = \
 endif

 kms_steal_crtc_SOURCES = kms-steal-crtc.c
-kms_steal_crtc_LDADD = libkms-test.la ../util/libutil.la $(CAIRO_LIBS)
+kms_steal_crtc_LDADD = libkms-test.la ../util/libutil.la

 kms_universal_planes_SOURCES = kms-universal-planes.c
-kms_universal_planes_LDADD = libkms-test.la $(CAIRO_LIBS)
+kms_universal_planes_LDADD = libkms-test.la
+
+if HAVE_CAIRO
+kms_steal_crtc_LDADD += $(CAIRO_LIBS)
+kms_universal_planes_LDADD += $(CAIRO_LIBS)
+endif
diff --git a/tests/modetest/Makefile.am b/tests/modetest/Makefile.am
index 25ce372..40dad3e 100644
--- a/tests/modetest/Makefile.am
+++ b/tests/modetest/Makefile.am
@@ -20,7 +20,10 @@ modetest_SOURCES = $(MODETEST_FILES)
 modetest_LDADD = \
        $(top_builddir)/libdrm.la \
        $(top_builddir)/tests/util/libutil.la \
-       $(CAIRO_LIBS) \
        -lpthread

+if HAVE_CAIRO
+modetest_LDADD += $(CAIRO_LIBS)
+endif
+
 EXTRA_DIST = Android.mk
diff --git a/tests/util/Makefile.am b/tests/util/Makefile.am
index f8e0b17..f366f26 100644
--- a/tests/util/Makefile.am
+++ b/tests/util/Makefile.am
@@ -7,7 +7,9 @@ libutil_la_CPPFLAGS = \
        -I$(top_srcdir)/include/drm \
        -I$(top_srcdir)

+if HAVE_CAIRO
 libutil_la_CFLAGS = \
        $(CAIRO_CFLAGS)
+endif

 libutil_la_SOURCES = $(UTIL_FILES)
-- 
2.1.4

Reply via email to