Make libkms build default OS-dependent
authorAlan Coopersmith <alan.coopersmith@oracle.com>
Fri, 16 Apr 2010 17:12:37 +0000 (10:12 -0700)
committerAlan Coopersmith <alan.coopersmith@oracle.com>
Sat, 17 Apr 2010 00:37:58 +0000 (17:37 -0700)
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
configure.ac

index fcfd07b..3794838 100644 (file)
@@ -46,8 +46,8 @@ AC_ARG_ENABLE(udev,   AS_HELP_STRING([--enable-udev],
 
 AC_ARG_ENABLE(libkms,
              AS_HELP_STRING([--disable-libkms],
-             [Disable KMS mm abstraction library (default: enabled)]),
-             [LIBKMS=$enableval], [LIBKMS=yes])
+             [Disable KMS mm abstraction library (default: auto)]),
+             [LIBKMS=$enableval], [LIBKMS=auto])
 
 AC_ARG_ENABLE(intel,
              AS_HELP_STRING([--disable-intel],
@@ -146,6 +146,14 @@ if test "x$UDEV" = xyes; then
        AC_DEFINE(UDEV, 1, [Have UDEV support])
 fi
 
+AC_CANONICAL_HOST
+if test "x$LIBKMS" = xauto ; then
+       case $host_os in
+               linux*)         LIBKMS="yes" ;;
+               *)              LIBKMS="no" ;;
+       esac
+fi
+
 AM_CONDITIONAL(HAVE_LIBKMS, [test "x$LIBKMS" = xyes])
 
 AM_CONDITIONAL(HAVE_VMWGFX, [test "x$VMWGFX" = xyes])