Mesa (master): configure.ac: Get complete LLVM version from header

Emil Velikov evelikov at kemper.freedesktop.org
Mon Dec 5 14:45:02 UTC 2016


Module: Mesa
Branch: master
Commit: a66cd76b16cf561c102314a6ee021727c03e52f7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a66cd76b16cf561c102314a6ee021727c03e52f7

Author: Tobias Droste <tdroste at gmx.de>
Date:   Sat Nov 19 02:39:11 2016 +0100

configure.ac: Get complete LLVM version from header

Major and minor version are included in the header file since LLVM
version 3.1.0. Since the minimal required version is 3.3.0 we can
remove the workaround if no values for major/minor were found in the
header.

Since LLVM 3.6.0 the patch version is inside the header file of LLVM.
Only radeon drivers need the patch version and they depend on
LLVM >= 3.6.0, so this is safe too.

Signed-off-by: Tobias Droste <tdroste at gmx.de>
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>

---

 configure.ac | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index b54eef3..e731cf9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -982,17 +982,15 @@ llvm_set_environment_variables() {
             [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
         AC_COMPUTE_INT([LLVM_VERSION_MINOR], [LLVM_VERSION_MINOR],
             [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
+        AC_COMPUTE_INT([LLVM_VERSION_PATCH], [LLVM_VERSION_PATCH],
+            [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
 
-        LLVM_VERSION_PATCH=`echo $LLVM_VERSION | cut -d. -f3 | egrep -o '^[[0-9]]+'`
+        # Only needed for LLVM < 3.6.0
         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}"
-        else
-            LLVM_VERSION_INT=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/\10\2/g'`
-        fi
+        LLVM_VERSION_INT="${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR}"
 
         DEFINES="${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT -DMESA_LLVM_VERSION_PATCH=$LLVM_VERSION_PATCH"
         MESA_LLVM=1




More information about the mesa-commit mailing list