OSDN Git Service

drm: replace HASH_DEBUG with DEBUG
[android-x86/external-libdrm.git] / configure.ac
index 253f48b..155d577 100644 (file)
@@ -20,7 +20,7 @@
 
 AC_PREREQ([2.63])
 AC_INIT([libdrm],
-        [2.4.58],
+        [2.4.60],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=DRI],
         [libdrm])
 
@@ -30,7 +30,6 @@ AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_AUX_DIR([build-aux])
 
 AM_INIT_AUTOMAKE([1.10 foreign dist-bzip2])
-AM_MAINTAINER_MODE([enable])
 
 # Enable quiet compiles on automake 1.11.
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
@@ -42,6 +41,8 @@ AC_USE_SYSTEM_EXTENSIONS
 AC_SYS_LARGEFILE
 AC_FUNC_ALLOCA
 
+AC_CHECK_HEADERS([sys/mkdev.h])
+
 # Initialize libtool
 LT_PREREQ([2.2])
 LT_INIT([disable-static])
@@ -60,12 +61,12 @@ AC_ARG_ENABLE([udev],
 
 AC_ARG_ENABLE(libkms,
              AS_HELP_STRING([--disable-libkms],
-             [Disable KMS mm abstraction library (default: auto)]),
+             [Disable KMS mm abstraction library (default: auto, enabled on supported platforms)]),
              [LIBKMS=$enableval], [LIBKMS=auto])
 
 AC_ARG_ENABLE(intel,
              AS_HELP_STRING([--disable-intel],
-             [Enable support for intel's KMS API (default: auto)]),
+             [Enable support for intel's KMS API (default: auto, enabled on x86)]),
              [INTEL=$enableval], [INTEL=auto])
 
 AC_ARG_ENABLE(radeon,
@@ -93,10 +94,15 @@ AC_ARG_ENABLE(exynos-experimental-api,
              [Enable support for EXYNOS's experimental API (default: disabled)]),
              [EXYNOS=$enableval], [EXYNOS=no])
 
-AC_ARG_ENABLE(freedreno-experimental-api,
-             AS_HELP_STRING([--enable-freedreno-experimental-api],
-             [Enable support for freedreno's experimental API (default: disabled)]),
-             [FREEDRENO=$enableval], [FREEDRENO=no])
+AC_ARG_ENABLE(freedreno,
+             AS_HELP_STRING([--disable-freedreno],
+             [Enable support for freedreno's KMS API (default: auto, enabled on arm)]),
+             [FREEDRENO=$enableval], [FREEDRENO=auto])
+
+AC_ARG_ENABLE(freedreno-kgsl,
+             AS_HELP_STRING([--enable-freedreno-kgsl],
+             [Enable support for freedreno's to use downstream android kernel API (default: disabled)]),
+             [FREEDRENO_KGSL=$enableval], [FREEDRENO_KGSL=no])
 
 AC_ARG_ENABLE(tegra-experimental-api,
              AS_HELP_STRING([--enable-tegra-experimental-api],
@@ -209,45 +215,56 @@ if test "x$drm_cv_atomic_primitives" = "xlibatomic-ops"; then
        AC_DEFINE(HAVE_LIB_ATOMIC_OPS, 1, [Enable if you have libatomic-ops-dev installed])
 fi
 
-if test "x$INTEL" != "xno" -o "x$RADEON" != "xno" -o "x$NOUVEAU" != "xno"; then
-       if test "x$drm_cv_atomic_primitives" = "xnone"; then
-               if test "x$INTEL" != "xauto"; then
-                       if test "x$INTEL" != "xno"; then
-                               AC_MSG_ERROR([libdrm_intel depends upon atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package, or, failing both of those, disable support for Intel GPUs by passing --disable-intel to ./configure])
-                       fi
-               else
-                       AC_MSG_WARN([Disabling libdrm_intel. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package.])
-                       INTEL=no
-               fi
-               if test "x$RADEON" != "xauto"; then
-                       if test "x$RADEON" != "xno"; then
-                               AC_MSG_ERROR([libdrm_radeon depends upon atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package, or, failing both of those, disable support for Radeon GPUs by passing --disable-radeon to ./configure])
-                       fi
-               else
-                       AC_MSG_WARN([Disabling libdrm_radeon. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package.])
-                       RADEON=no
-               fi
-               if test "x$NOUVEAU" != "xauto"; then
-                       if test "x$NOUVEAU" != "xno"; then
-                               AC_MSG_ERROR([libdrm_nouveau depends upon atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package, or, failing both of those, disable support for NVIDIA GPUs by passing --disable-nouveau to ./configure])
-                       fi
-               else
-                       AC_MSG_WARN([Disabling libdrm_nouveau. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package.])
-                       NOUVEAU=no
-               fi
-       else
-               if test "x$INTEL" != "xno"; then
-                       case $host_cpu in
-                               i?86|x86_64) INTEL=yes ;;
-                               *) INTEL=no ;;
-                       esac
-               fi
-               if test "x$RADEON" != "xno"; then
-                       RADEON=yes
-               fi
-               if test "x$NOUVEAU" != "xno"; then
-                       NOUVEAU=yes
-               fi
+dnl Print out the approapriate message considering the value set be the
+dnl respective in $1.
+dnl $1 - value to be evaluated. Eg. $INTEL, $NOUVEAU, ...
+dnl $2 - libdrm shortname. Eg. intel, freedreno, ...
+dnl $3 - GPU name/brand. Eg. Intel, NVIDIA Tegra, ...
+dnl $4 - Configure switch. Eg. intel, omap-experimental-api, ...
+AC_DEFUN([LIBDRM_ATOMICS_NOT_FOUND_MSG], [
+       case "x$1" in
+               xyes)   AC_MSG_ERROR([libdrm_$2 depends upon atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package, or, failing both of those, disable support for $3 GPUs by passing --disable-$4 to ./configure]) ;;
+               xauto)  AC_MSG_WARN([Disabling $2. It depends on atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package.]) ;;
+               *)      ;;
+       esac
+])
+
+if test "x$drm_cv_atomic_primitives" = "xnone"; then
+       LIBDRM_ATOMICS_NOT_FOUND_MSG($INTEL, intel, Intel, intel)
+       INTEL=no
+
+       LIBDRM_ATOMICS_NOT_FOUND_MSG($RADEON, radeon, Radeon, radeon)
+       RADEON=no
+
+       LIBDRM_ATOMICS_NOT_FOUND_MSG($NOUVEAU, nouveau, NVIDIA, nouveau)
+       NOUVEAU=no
+
+       LIBDRM_ATOMICS_NOT_FOUND_MSG($OMAP, omap, OMAP, omap-experimental-api)
+       OMAP=no
+
+       LIBDRM_ATOMICS_NOT_FOUND_MSG($FREEDRENO, freedreno, Qualcomm Adreno, freedreno)
+       FREEDRENO=no
+
+       LIBDRM_ATOMICS_NOT_FOUND_MSG($TEGRA, tegra, NVIDIA Tegra, tegra-experimental-api)
+       TEGRA=no
+else
+       if test "x$INTEL" = xauto; then
+               case $host_cpu in
+                       i?86|x86_64)    INTEL=yes ;;
+                       *)              INTEL=no ;;
+               esac
+       fi
+       if test "x$RADEON" = xauto; then
+               RADEON=yes
+       fi
+       if test "x$NOUVEAU" = xauto; then
+               NOUVEAU=yes
+       fi
+       if test "x$FREEDRENO" = xauto; then
+               case $host_cpu in
+                       arm*|aarch64)   FREEDRENO=yes ;;
+                       *)              FREEDRENO=no ;;
+               esac
        fi
 fi
 
@@ -304,6 +321,16 @@ if test "x$FREEDRENO" = xyes; then
        AC_DEFINE(HAVE_FREEDRENO, 1, [Have freedreno support])
 fi
 
+if test "x$FREEDRENO_KGSL" = xyes; then
+       if test "x$FREEDRENO" != xyes; then
+               AC_MSG_ERROR([Cannot enable freedreno KGSL interface if freedreno is disabled])
+       fi
+fi
+AM_CONDITIONAL(HAVE_FREEDRENO_KGSL, [test "x$FREEDRENO_KGSL" = xyes])
+if test "x$FREEDRENO_KGSL" = xyes; then
+       AC_DEFINE(HAVE_FREEDRENO_KGSL, 1, [Have freedreno support for KGSL kernel interface])
+fi
+
 AM_CONDITIONAL(HAVE_RADEON, [test "x$RADEON" = xyes])
 if test "x$RADEON" = xyes; then
        AC_DEFINE(HAVE_RADEON, 1, [Have radeon support])
@@ -423,6 +450,8 @@ AC_CONFIG_FILES([
        tests/radeon/Makefile
        tests/vbltest/Makefile
        tests/exynos/Makefile
+       tests/tegra/Makefile
+       tests/nouveau/Makefile
        man/Makefile
        libdrm.pc])
 AC_OUTPUT
@@ -437,6 +466,6 @@ echo "  Radeon API     $RADEON"
 echo "  Nouveau API    $NOUVEAU"
 echo "  OMAP API       $OMAP"
 echo "  EXYNOS API     $EXYNOS"
-echo "  Freedreno API  $FREEDRENO"
+echo "  Freedreno API  $FREEDRENO (kgsl: $FREEDRENO_KGSL)"
 echo "  Tegra API      $TEGRA"
 echo ""