[Mesa-dev] [PATCH 07/28] configure: move vulkan sha1 requirement to a separate function

Emil Velikov emil.l.velikov at gmail.com
Thu Dec 8 19:21:47 UTC 2016


From: Emil Velikov <emil.velikov at collabora.com>

We'll be adding more common requirements, so there's no point in
duplicating things even more.

Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
 configure.ac | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index ed1f96a..997eeaf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1875,6 +1875,12 @@ AC_ARG_WITH([vulkan-icddir],
     [VULKAN_ICD_INSTALL_DIR='${datarootdir}/vulkan/icd.d'])
 AC_SUBST([VULKAN_ICD_INSTALL_DIR])
 
+require_sha1() {
+    if test "x$with_sha1" == "x"; then
+        AC_MSG_ERROR([$1 Vulkan driver requires SHA1])
+    fi
+}
+
 if test -n "$with_vulkan_drivers"; then
     VULKAN_DRIVERS=`IFS=', '; echo $with_vulkan_drivers`
     for driver in $VULKAN_DRIVERS; do
@@ -1883,20 +1889,15 @@ if test -n "$with_vulkan_drivers"; then
             if test "x$HAVE_I965_DRI" != xyes; then
                 AC_MSG_ERROR([Intel Vulkan driver requires the i965 dri driver])
             fi
-            if test "x$with_sha1" == "x"; then
-                AC_MSG_ERROR([Intel Vulkan driver requires SHA1])
-            fi
+            require_sha1 "Intel"
             HAVE_INTEL_VULKAN=yes;
-
             ;;
         xradeon)
             PKG_CHECK_MODULES([AMDGPU], [libdrm_amdgpu >= $LIBDRM_AMDGPU_REQUIRED])
             radeon_llvm_check $LLVM_REQUIRED_RADV "radv"
+            require_sha1 "radv"
             HAVE_RADEON_VULKAN=yes;
-            if test "x$with_sha1" == "x"; then
-                AC_MSG_ERROR([radv vulkan driver requires SHA1])
-            fi
-	    ;;
+            ;;
         *)
             AC_MSG_ERROR([Vulkan driver '$driver' does not exist])
             ;;
-- 
2.10.2



More information about the mesa-dev mailing list