[Mesa-stable] [PATCH] configure.ac: Compute LLVM_VERSION_PATCH using llvm-config

Tom Stellard thomas.stellard at amd.com
Thu Sep 25 12:55:40 PDT 2014


This is the only guaranteed way get the patch level for llvm,
since the define cannot always be found in config.h depending
on the version of llvm or the build system used.

CC: mesa-stable at lists.freedesktop.org
---
 configure.ac | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index bad1528..a097a5c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1704,11 +1704,10 @@ if test "x$enable_gallium_llvm" = xyes; then
         AC_COMPUTE_INT([LLVM_VERSION_MINOR], [LLVM_VERSION_MINOR],
             [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
 
-        dnl In LLVM 3.4.1 patch level was defined in config.h and not
-        dnl llvm-config.h
-        AC_COMPUTE_INT([LLVM_VERSION_PATCH], [LLVM_VERSION_PATCH],
-            [#include "${LLVM_INCLUDEDIR}/llvm/Config/config.h"],
-            LLVM_VERSION_PATCH=0) dnl Default if LLVM_VERSION_PATCH not found
+        LLVM_VERSION_PATCH=`echo $LLVM_VERSION | cut -d. -f3 | egrep -o '^[[0-9]]+'`
+        if test -z "$LLVM_VERSION_PATCH"; then
+            LLVM_VERSION_PATCH=0
+        fi
 
         if test -n "${LLVM_VERSION_MAJOR}"; then
             LLVM_VERSION_INT="${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR}"
-- 
1.8.3.1



More information about the mesa-stable mailing list