[Mesa-dev] [RFC PATCH 07/17] configure.ac: Check for SPIRV-Tools header and library

Pierre Moreau pierre.morrow at free.fr
Wed May 3 21:56:55 UTC 2017


Signed-off-by: Pierre Moreau <pierre.morrow at free.fr>
---
 configure.ac | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/configure.ac b/configure.ac
index ba042791ad..602aeb279d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2064,6 +2064,11 @@ AC_ARG_WITH([clang-libdir],
 
 PKG_CHECK_EXISTS([libclc], [have_libclc=yes], [have_libclc=no])
 
+AC_LANG_PUSH([C++])
+AC_SEARCH_LIBS([_ZNK8spvtools10SpirvTools8ValidateEPKjm], [SPIRV-Tools], [have_spirv_tools=yes], [have_spirv_tools=no])
+AC_CHECK_HEADER([spirv-tools/libspirv.hpp], [have_spirv_tools_headers=yes; break;])
+AC_LANG_POP([C++])
+
 if test "x$enable_opencl" = xyes; then
     if test -z "$with_gallium_drivers"; then
         AC_MSG_ERROR([cannot enable OpenCL without Gallium])
@@ -2123,6 +2128,17 @@ if test "x$enable_opencl" = xyes; then
     llvm_add_component "objcarcopts" "opencl"
     llvm_add_component "profiledata" "opencl"
 
+    if test "x$have_spirv_tools_headers" != xyes; then
+       AC_MSG_ERROR([Failed to find spirv-tools/libspirv.hpp, which is
+                     required to build clover])
+    fi
+
+    if test "x$have_spirv_tools" != xyes; then
+       AC_MSG_ERROR([Failed to find a library implementing
+                     _ZNK8spvtools10SpirvTools8ValidateEPKjm which is required
+                     to build clover])
+    fi
+
     dnl Check for Clang internal headers
     if test -z "$CLANG_LIBDIR"; then
         CLANG_LIBDIR=${LLVM_LIBDIR}
-- 
2.12.2



More information about the mesa-dev mailing list