summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-10-12 23:58:47 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-10-12 23:58:47 +0100
commitfc8f6be5a9bd84e10149770b76ff9353d25ce2a7 (patch)
treecb6fa084d1dcafa02bbb858a796d1ab2268258b7
parenta107e5b12960f64722bff424502a4fc0ad33dc8f (diff)
configure: Conditionally build libdrm_intel
Only build libdrm_intel automatically if we have support for atomic operations. To force configure to build drm pass --enable-intel, which will cause the configure to error if no support is found. Or pass --disable-intel to explicitly prevent libdrm_intel from being built. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--configure.ac19
1 files changed, 14 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 870c0567..0c216cea 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,8 +45,8 @@ AC_ARG_ENABLE(udev, AS_HELP_STRING([--enable-udev],
AC_ARG_ENABLE(intel,
AS_HELP_STRING([--disable-intel],
- [Enable support for intel's KMS API (default: enabled)]),
- [INTEL=$enableval], [INTEL=yes])
+ [Enable support for intel's KMS API (default: auto)]),
+ [INTEL=$enableval], [INTEL=auto])
AC_ARG_ENABLE(nouveau-experimental-api,
AS_HELP_STRING([--enable-nouveau-experimental-api],
@@ -151,9 +151,7 @@ if test "x$HAVE_LIBUDEV" = xyes; then
fi
AM_CONDITIONAL(HAVE_LIBUDEV, [test "x$HAVE_LIBUDEV" = xyes])
-AM_CONDITIONAL(HAVE_INTEL, [test "x$INTEL" = xyes])
-
-if test "x$INTEL" = xyes; then
+if test "x$INTEL" != "xno"; then
# Check for atomic intrinsics
AC_CACHE_CHECK([for native atomic primitives], drm_cv_atomic_primitives,
[
@@ -170,8 +168,19 @@ if test "x$INTEL" = xyes; then
AC_DEFINE(HAVE_INTEL_ATOMIC_PRIMITIVES, 1,
[Enable if your compiler supports the Intel __sync_* atomic primitives])
fi
+
+ if test "x$drm_cv_atomic_primitives" = "xnone"; then
+ if test "x$INTEL" != "xauto"; then
+ AC_MSG_ERROR([libdrm_intel depends upon atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or disable support for Intel GPUs by passing --disable-intel to ./configue])
+ else
+ INTEL=no
+ fi
+ fi
fi
+AM_CONDITIONAL(HAVE_INTEL, [test "x$INTEL" != "xno"])
+
+
AC_SUBST(WARN_CFLAGS)
AC_OUTPUT([
Makefile