summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorRobert Foss <robert.foss@collabora.com>2016-07-27 13:17:35 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-08-04 13:13:05 +0200
commit0fbab814cad28ce661f30d685c147e28d5779ab4 (patch)
treea3c462dc57f891e51eaa0a610dedc530d0115e1c /configure.ac
parent12f052b5604fffb852bf66250b89fec56641733c (diff)
configure.ac: Test for libdrm_intel and build for it if present
Test for libdrm_intel and build for it if present. Also expose the HAVE_INTEL #define to allow code to be conditionally compiled. Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac19
1 files changed, 18 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index e1f850d2..cbf77247 100644
--- a/configure.ac
+++ b/configure.ac
@@ -119,7 +119,7 @@ if test "x$GCC" = "xyes"; then
fi
AC_SUBST(ASSEMBLER_WARN_CFLAGS)
-PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.67 libdrm])
+PKG_CHECK_MODULES(DRM, [libdrm])
PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
case "$target_cpu" in
@@ -169,6 +169,23 @@ PKG_CHECK_MODULES(GLIB, glib-2.0)
# -----------------------------------------------------------------------------
# Configuration options
# -----------------------------------------------------------------------------
+AC_ARG_ENABLE(intel, AS_HELP_STRING([--disable-intel],
+ [Enable building of intel specific parts (default: auto)]),
+ [INTEL=$enableval], [INTEL=auto])
+if test "x$INTEL" = xauto; then
+ PKG_CHECK_EXISTS([libdrm_intel >= 2.4.64], [INTEL=yes], [INTEL=no])
+fi
+if test "x$INTEL" = xyes; then
+ PKG_CHECK_MODULES(DRM_INTEL, [libdrm_intel >= 2.4.64])
+ AC_DEFINE(HAVE_LIBDRM_INTEL, 1, [Have intel support])
+ DRM_LIBS="$DRM_LIBS $DRM_INTEL_LIBS"
+ AC_SUBST([DRM_LIBS])
+else
+ DRM_INTEL_CFLAGS=$(top_srcdir)/lib/stubs/drm/
+ AC_SUBST([DRM_INTEL_CFLAGS])
+fi
+AM_CONDITIONAL(HAVE_LIBDRM_INTEL, [test "x$INTEL" = xyes])
+
# for dma-buf tests
AC_ARG_ENABLE(nouveau, AS_HELP_STRING([--disable-nouveau],
[Enable use of nouveau API for prime tests (default: auto)]),