diff mbox

Add explicit control over udev and cairo usage.

Message ID 1266930531-28472-1-git-send-email-zlin@exherbo.org (mailing list archive)
State New, archived
Headers show

Commit Message

Bo Ørsted Andresen Feb. 23, 2010, 1:08 p.m. UTC
None
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index ef7700f..3fcdb44 100644
--- a/configure.ac
+++ b/configure.ac
@@ -40,9 +40,6 @@  AC_SUBST(PTHREADSTUBS_LIBS)
 
 pkgconfigdir=${libdir}/pkgconfig
 AC_SUBST(pkgconfigdir)
-AC_ARG_ENABLE(udev,	AS_HELP_STRING([--enable-udev],
-				[Enable support for using udev instead of mknod (default: disabled)]),
-				[UDEV=$enableval], [UDEV=no])
 
 AC_ARG_ENABLE(libkms,
 	      AS_HELP_STRING([--disable-libkms],
@@ -142,10 +139,6 @@  AC_CACHE_CHECK([for supported warning flags], libdrm_cv_warn_cflags, [
 	AC_MSG_CHECKING([which warning flags were supported])])
 WARN_CFLAGS="$libdrm_cv_warn_cflags"
 
-if test "x$UDEV" = xyes; then
-	AC_DEFINE(UDEV, 1, [Have UDEV support])
-fi
-
 AM_CONDITIONAL(HAVE_LIBKMS, [test "x$LIBKMS" = xyes])
 
 AM_CONDITIONAL(HAVE_VMWGFX, [test "x$VMWGFX" = xyes])
@@ -157,18 +150,34 @@  AM_CONDITIONAL(HAVE_NOUVEAU, [test "x$NOUVEAU" = xyes])
 
 AM_CONDITIONAL(HAVE_RADEON, [test "x$RADEON" = xyes])
 
-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_ARG_WITH(cairo,
+            AS_HELP_STRING([--with-cairo],
+                           [enable use of cairo for tests (default: disabled)]),,
+            [with_cairo=no])
+
+if test x"$with_cairo" != x"no" ; then
+   PKG_CHECK_MODULES(CAIRO, cairo,,
+                     AC_MSG_ERROR([cairo support explicitly requested, but cairo not found]))
+   AC_DEFINE(HAVE_CAIRO, 1, [Have cairo support])
 fi
-AM_CONDITIONAL(HAVE_CAIRO, [test "x$HAVE_CAIRO" = xyes])
+
+AM_CONDITIONAL(HAVE_CAIRO, [test x"$with_cairo" != x"no"])
+
 
 # For enumerating devices in test case
-PKG_CHECK_MODULES(LIBUDEV, libudev, [HAVE_LIBUDEV=yes], [HAVE_LIBUDEV=no])
-if test "x$HAVE_LIBUDEV" = xyes; then
-   	AC_DEFINE(HAVE_LIBUDEV, 1, [Have libudev support])
+AC_ARG_ENABLE(udev,
+              AS_HELP_STRING([--enable-udev],
+                             [enable support for using udev instead of mknod (default: disabled)]),,
+              [enable_udev=no])
+
+if test x"$enable_udev" != x"no" ; then
+   PKG_CHECK_MODULES(LIBUDEV, libudev,,
+                     AC_MSG_ERROR([udev support explicitly requested, but libudev not found]))
+   AC_DEFINE(UDEV, 1, [Have udev support])
+   AC_DEFINE(HAVE_LIBUDEV, 1, [Have libudev support])
 fi
-AM_CONDITIONAL(HAVE_LIBUDEV, [test "x$HAVE_LIBUDEV" = xyes])
+
+AM_CONDITIONAL(HAVE_LIBUDEV, [test x"$enable_udev" != x"no"])
 
 if test "x$INTEL" != "xno"; then
     # Check for atomic intrinsics