[Mesa-dev] [PATCH v2 3/6] configure.ac: Move LLVM oCL checks to the oCL section

Tobias Droste tdroste at gmx.de
Tue Oct 11 01:44:54 UTC 2016


This consolidates all openCL checks inside one
"if test "x$enable_opencl" = xyes; then [...] fi"

Uses new helper functions to add the LLVM components.

WARNING: Still a broken build!!!

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

diff --git a/configure.ac b/configure.ac
index be802d7..3b87856 100644
--- a/configure.ac
+++ b/configure.ac
@@ -953,24 +953,8 @@ if test "x$LLVM_CONFIG" != xno; then
         AC_MSG_ERROR([LLVM $LLVM_REQUIRED_VERSION_MAJOR.$LLVM_REQUIRED_VERSION_MINOR or newer is required])
     fi
 
-    if test "x$enable_opencl" = xyes; then
-        llvm_check_version_for "3" "6" "0" "opencl"
-
-        LLVM_COMPONENTS="${LLVM_COMPONENTS} all-targets ipo linker instrumentation"
-        LLVM_COMPONENTS="${LLVM_COMPONENTS} irreader option objcarcopts profiledata"
-    fi
     DEFINES="${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT -DMESA_LLVM_VERSION_PATCH=$LLVM_VERSION_PATCH"
     MESA_LLVM=1
-
-    dnl Check for Clang internal headers
-    if test "x$enable_opencl" = xyes; then
-        if test -z "$CLANG_LIBDIR"; then
-            CLANG_LIBDIR=${LLVM_LIBDIR}
-        fi
-        CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
-        AS_IF([test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"],
-            [AC_MSG_ERROR([Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries.])])
-    fi
 else
     MESA_LLVM=0
     LLVM_VERSION_INT=0
@@ -2224,6 +2208,25 @@ if test "x$enable_opencl" = xyes; then
     if test "x$have_libelf" != xyes; then
        AC_MSG_ERROR([Clover requires libelf])
     fi
+
+    llvm_check_version_for "3" "6" "0" "opencl"
+
+    llvm_add_component "all-targets" "opencl"
+    llvm_add_component "ipos" "opencl"
+    llvm_add_component "linker" "opencl"
+    llvm_add_component "instrumentation" "opencl"
+    llvm_add_component "irreader" "yes" "opencl"
+    llvm_add_component "option" "yes" "opencl"
+    llvm_add_component "objcarcopts" "opencl"
+    llvm_add_component "profiledata" "opencl"
+
+    dnl Check for Clang internal headers
+    if test -z "$CLANG_LIBDIR"; then
+        CLANG_LIBDIR=${LLVM_LIBDIR}
+    fi
+    CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
+    AS_IF([test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"],
+        [AC_MSG_ERROR([Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries.])])
 fi
 AM_CONDITIONAL(HAVE_CLOVER, test "x$enable_opencl" = xyes)
 AM_CONDITIONAL(HAVE_CLOVER_ICD, test "x$enable_opencl_icd" = xyes)
@@ -2363,10 +2366,6 @@ if test "x$enable_gallium_llvm" = xyes || test "x$HAVE_RADEON_VULKAN" = xyes; th
 else
     MESA_LLVM=0
     LLVM_VERSION_INT=0
-
-    if test "x$enable_opencl" = xyes; then
-        AC_MSG_ERROR([cannot enable OpenCL without LLVM])
-    fi
 fi
 
 dnl Directory for XVMC libs
-- 
2.10.0



More information about the mesa-dev mailing list