[Mesa-dev] [PATCH] configure.ac: detect LLVM patch level when built via cmake

Jonathan Gray jsg at jsg.id.au
Fri Sep 5 08:43:55 PDT 2014


In LLVM 3.4.1 and 3.4.2 the patch level was only set in config.h when
LLVM was built via autoconf and not when it was built with cmake.
Fall back to retrieving the patch level from llvm-config --version to
handle this case.

Cc: "10.2 10.3" <mesa-stable at lists.freedesktop.org>
Signed-off-by: Jonathan Gray <jsg at jsg.id.au>
---
 configure.ac | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/configure.ac b/configure.ac
index 99ae6ba..98cd938 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1705,6 +1705,15 @@ if test "x$enable_gallium_llvm" = xyes; then
             [#include "${LLVM_INCLUDEDIR}/llvm/Config/config.h"],
             LLVM_VERSION_PATCH=0) dnl Default if LLVM_VERSION_PATCH not found
 
+        dnl In LLVM 3.4.1 and 3.4.2 the patch level was only set in config.h
+        dnl for autoconf builds and not cmake builds
+        if test "$LLVM_VERSION_PATCH" -eq 0; then
+            LLVM_VERSION_PATCH=`echo $LLVM_VERSION | cut -d. -f3`
+            if test -z "$LLVM_VERSION_PATCH"; then
+                LLVM_VERSION_PATCH=0
+            fi
+        fi
+
         if test -n "${LLVM_VERSION_MAJOR}"; then
             LLVM_VERSION_INT="${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR}"
         else
-- 
1.9.3



More information about the mesa-dev mailing list