]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/libdrm.git/commitdiff
configure.ac: Allow forcible disabling of Cairo support
authorDaniel Stone <daniel@fooishbar.org>
Thu, 4 Oct 2012 01:21:57 +0000 (01:21 +0000)
committerDave Airlie <airlied@redhat.com>
Mon, 8 Oct 2012 05:49:23 +0000 (15:49 +1000)
We don't want to build libdrm tests with Cairo support under Poky, since
they're never used and also cause a build loop from libdrm -> cairo ->
mesa-dri -> libdrm.

To avoid variance in build results, introduce a --disable-cairo-tests
switch.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
configure.ac
tests/modetest/Makefile.am

index 290362c468d4f05e7d0d58ec26355d32619df48a..8c28107a9a674226b954cba46dc575a5ae3c2d13 100644 (file)
@@ -222,11 +222,23 @@ if test "x$EXYNOS" = xyes; then
        AC_DEFINE(HAVE_EXYNOS, 1, [Have EXYNOS support])
 fi
 
+AC_ARG_ENABLE([cairo-tests],
+              [AS_HELP_STRING([--enable-cairo-tests],
+                              [Enable support for Cairo rendering in tests (default: auto)])],
+              [CAIRO=$enableval], [CAIRO=auto])
 PKG_CHECK_MODULES(CAIRO, cairo, [HAVE_CAIRO=yes], [HAVE_CAIRO=no])
-if test "x$HAVE_CAIRO" = xyes; then
-       AC_DEFINE(HAVE_CAIRO, 1, [Have cairo support])
+AC_MSG_CHECKING([whether to enable Cairo tests])
+if test "x$CAIRO" = xauto; then
+       CAIRO="$HAVE_CAIRO"
 fi
-AM_CONDITIONAL(HAVE_CAIRO, [test "x$HAVE_CAIRO" = xyes])
+if test "x$CAIRO" = xyes; then
+       if ! test "x$HAVE_CAIRO" = xyes; then
+               AC_MSG_ERROR([Cairo support required but not present])
+       fi
+       AC_DEFINE(HAVE_CAIRO, 1, [Have Cairo support])
+fi
+AC_MSG_RESULT([$CAIRO])
+AM_CONDITIONAL(HAVE_CAIRO, [test "x$CAIRO" = xyes])
 
 # For enumerating devices in test case
 PKG_CHECK_MODULES(LIBUDEV, libudev, [HAVE_LIBUDEV=yes], [HAVE_LIBUDEV=no])
index b5ec7717bb214e60ccc15e31161fd253d5bd2859..065ae1323b34494e2879f76bcb08332cbe6216cc 100644 (file)
@@ -1,8 +1,7 @@
 AM_CFLAGS = \
        -I$(top_srcdir)/include/drm \
        -I$(top_srcdir)/libkms/ \
-       -I$(top_srcdir) \
-       $(CAIRO_CFLAGS)
+       -I$(top_srcdir)
 
 noinst_PROGRAMS = \
        modetest
@@ -12,5 +11,9 @@ modetest_SOURCES = \
 
 modetest_LDADD = \
        $(top_builddir)/libdrm.la \
-       $(top_builddir)/libkms/libkms.la \
-       $(CAIRO_LIBS)
+       $(top_builddir)/libkms/libkms.la
+
+if HAVE_CAIRO
+AM_CFLAGS += $(CAIRO_CFLAGS)
+modetest_LDADD += $(CAIRO_LIBS)
+endif