diff options
author | Ian Stakenvicius <axs@gentoo.org> | 2012-09-14 21:04:42 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-09-14 21:04:42 +0100 |
commit | 3b9259f7cedc179617bc24b3912d2d8d75c5a824 (patch) | |
tree | f288c11abb18177527c60bd291178c9dab9c1b79 | |
parent | d995705fb01842652a79076cbecee4392f653bfe (diff) |
configure: Make udev dependency optional
In order to support buildbots where the udev headers may exist on the
build system but not the target, we need explicit control over optional
dependencies.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54942
-rw-r--r-- | configure.ac | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index f94f1401..2d651e1a 100644 --- a/configure.ac +++ b/configure.ac @@ -85,9 +85,20 @@ fi PKG_CHECK_MODULES(GEN4ASM, [intel-gen4asm >= 1.2], [gen4asm=yes], [gen4asm=no]) AM_CONDITIONAL(HAVE_GEN4ASM, test x$gen4asm = xyes) -PKG_CHECK_MODULES(UDEV, [libudev], [udev=yes], [udev=no]) -if test x"$udev" = xyes; then - AC_DEFINE(HAVE_UDEV,1,[Enable udev-based monitor hotplug detection]) +AC_ARG_ENABLE(udev, + AS_HELP_STRING([--disable-udev], + [Disable udev-based monitor hotplug detection [default=auto]]), + [UDEV="$enableval"], + [UDEV=auto]) + +if test x$UDEV != "xno"; then + PKG_CHECK_MODULES(UDEV, [libudev], [udev=yes], [udev=no]) + if test x$UDEV == xyes -a x$udev != xyes; then + AC_MSG_ERROR([udev support requested but not found (libudev)]) + fi + if test x$udev = xyes; then + AC_DEFINE(HAVE_UDEV,1,[Enable udev-based monitor hotplug detection]) + fi fi PKG_CHECK_MODULES(X11, [x11 xrender xext pixman-1], [x11=yes], [x11=no]) |