[gtk+/wip/otte/vulkan: 34/62] configure: Improve Vulkan detection



commit 3f7cc013cc588fd1ce4d53921bc5cfe51af21bfe
Author: Benjamin Otte <otte redhat com>
Date:   Sun Dec 4 18:10:18 2016 +0100

    configure: Improve Vulkan detection
    
    1. Output Vulkan status in summary
    2. Add missing "test" call
    3. Check for glslc
    
    The glslc check will be necessary later for the code that automatically
    compiles the Vulkan glsl source to Spir-V.
    Nothing happens if glslc is not available - unless you modify the glsl.

 configure.ac |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index df3a187..8093384 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1321,27 +1321,29 @@ fi
 
 # Check for Vulkan support.
 
-have_vulkan="no"
 if test "x$enable_vulkan" != "xno"; then
       vulkan_error=""
       AC_CHECK_HEADER([vulkan/vulkan.h], [], [vulkan_error="Vulkan header not found"])
       AC_CHECK_LIB([vulkan], [vkCreateInstance], [], [vulkan_error="Vulkan library not found"])
-      if "x$vulkan_error" != "x"; then
+      if test "x$vulkan_result" != "x"; then
           if "x$enable_vulkan" = "xyes"; then
               AC_MSG_ERROR($vulkan_error)
           else
               AC_MSG_WARN($vulkan_error)
           fi
+          vulkan_result="no ($vulkan_error)"
       else
           GDK_EXTRA_LIBS="-lvulkan"
-          have_vulkan="yes"
           GDK_WINDOWING="$GDK_WINDOWING
 #define GDK_WINDOWING_VULKAN"
+          AC_PATH_PROG([GLSLC], [glslc])
+          vulkan_result="yes"
       fi
 else
       AC_MSG_WARN(Vulkan support explicitly disabled)
+      vulkan_result="no (Vulkan support explicitly disabled)"
 fi
-AM_CONDITIONAL(HAVE_VULKAN, test "$have_vulkan" = "yes")
+AM_CONDITIONAL(HAVE_VULKAN, test "$vulkan_result" = "yes")
 
 # Check for Pango flags
 
@@ -2063,6 +2065,7 @@ echo "        GDK backends:         $GDK_BACKENDS"
 if test "$enable_x11_backend" = "yes"; then
 echo "        X11 extensions:       $X_EXTENSIONS"
 fi
+echo "        Vulkan support:       $vulkan_result"
 echo "        Print backends:       $PRINT_BACKENDS"
 echo "        Dynamic modules:      $build_dynamic_modules"
 echo "        Included immodules:   $included_immodules"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]