[Mesa-dev] [PATCH v3 12/25] configure.ac: Move gallium LLVM checks

Tobias Droste tdroste at gmx.de
Tue Oct 11 23:02:39 UTC 2016


There's already a function for gallium LLVM checks.
Move the remaining code to this function and call it for every driver
that uses LLVM.

Signed-off-by: Tobias Droste <tdroste at gmx.de>
---
 configure.ac | 31 +++++++++++++------------------
 1 file changed, 13 insertions(+), 18 deletions(-)

diff --git a/configure.ac b/configure.ac
index 283e553..61a0253 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2310,18 +2310,6 @@ if test "x$enable_gallium_llvm" = xauto; then
     esac
 fi
 
-gallium_llvm_check() {
-    LLVM_REQUIRED_VERSION_MAJOR="3"
-    LLVM_REQUIRED_VERSION_MINOR="3"
-    if test "$LLVM_VERSION_INT" -lt "${LLVM_REQUIRED_VERSION_MAJOR}0${LLVM_REQUIRED_VERSION_MINOR}"; then
-        AC_MSG_ERROR([LLVM $LLVM_REQUIRED_VERSION_MAJOR.$LLVM_REQUIRED_VERSION_MINOR or newer is required])
-    fi
-}
-
-if test "x$enable_gallium_llvm" = xyes; then
-    gallium_llvm_check
-fi
-
 dnl Directory for XVMC libs
 AC_ARG_WITH([xvmc-libdir],
     [AS_HELP_STRING([--with-xvmc-libdir=DIR],
@@ -2378,12 +2366,16 @@ gallium_require_drm() {
 }
 
 gallium_require_llvm() {
-    if test "x$MESA_LLVM" = x0; then
-        case "$host" in *gnux32) return;; esac
-        case "$host_cpu" in
-        i*86|x86_64|amd64) AC_MSG_ERROR([LLVM is required to build $1 on x86 and x86_64]);;
-        esac
-    fi
+    case "$host" in *gnux32) return;; esac
+    case "$host_cpu" in
+    i*86|x86_64|amd64)
+        LLVM_REQUIRED_VERSION_MAJOR="3"
+        LLVM_REQUIRED_VERSION_MINOR="3"
+        if test "$LLVM_VERSION_INT" -lt "${LLVM_REQUIRED_VERSION_MAJOR}0${LLVM_REQUIRED_VERSION_MINOR}"; then
+            AC_MSG_ERROR([LLVM $LLVM_REQUIRED_VERSION_MAJOR.$LLVM_REQUIRED_VERSION_MINOR or newer is required])
+        fi
+        ;;
+    esac
 }
 
 gallium_require_drm_loader() {
@@ -2519,6 +2511,7 @@ if test -n "$with_gallium_drivers"; then
             gallium_require_drm_loader
             if test "x$enable_opencl" = xyes; then
                 radeon_gallium_llvm_check "r600g" "3" "6" "0"
+                gallium_require_llvm "r600"
                 LLVM_COMPONENTS="${LLVM_COMPONENTS} bitreader asmparser"
             fi
             ;;
@@ -2529,6 +2522,7 @@ if test -n "$with_gallium_drivers"; then
             gallium_require_drm "radeonsi"
             gallium_require_drm_loader
             radeon_gallium_llvm_check "radeonsi" "3" "6" "0"
+            gallium_require_llvm "radeonsi"
             require_egl_drm "radeonsi"
             ;;
         xnouveau)
@@ -2546,6 +2540,7 @@ if test -n "$with_gallium_drivers"; then
         xswrast)
             HAVE_GALLIUM_SOFTPIPE=yes
             if test "x$MESA_LLVM" = x1; then
+                gallium_require_llvm "llvmpipe"
                 HAVE_GALLIUM_LLVMPIPE=yes
             fi
             ;;
-- 
2.10.0



More information about the mesa-dev mailing list