blob: fd79991aab1a2a113218dd3559915d70f29d586c [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001From: Otavio Salvador <otavio@ossystems.com.br>
2Subject: [PATCH] Properly get LLVM version when using LLVM Git releases
Brad Bishopd7bf8c12018-02-25 22:55:05 -05003
Brad Bishop316dfdd2018-06-25 12:45:53 -04004$ llvm-config-host --version
Brad Bishopd7bf8c12018-02-25 22:55:05 -050055.0.0git-9a5c333388c
6
Brad Bishop316dfdd2018-06-25 12:45:53 -04007We need to ignore everything after 5.0.0 which is what the cut cmd is
8doing
Brad Bishopd7bf8c12018-02-25 22:55:05 -05009
10Upstream-Status: Pending
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
Brad Bishop316dfdd2018-06-25 12:45:53 -040012Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
13---
14 configure.ac | 4 ++--
15 1 file changed, 2 insertions(+), 2 deletions(-)
Brad Bishopd7bf8c12018-02-25 22:55:05 -050016
Brad Bishop316dfdd2018-06-25 12:45:53 -040017diff --git a/configure.ac b/configure.ac
18index a02173f244..b107f04c2e 100644
19--- a/configure.ac
20+++ b/configure.ac
21@@ -995,7 +995,7 @@ strip_unwanted_llvm_flags() {
Brad Bishopd7bf8c12018-02-25 22:55:05 -050022
23 llvm_set_environment_variables() {
24 if test "x$LLVM_CONFIG" != xno; then
25- LLVM_VERSION=`$LLVM_CONFIG --version | egrep -o '^[[0-9.]]+'`
26+ LLVM_VERSION=`$LLVM_CONFIG --version | cut -c1-5`
27 LLVM_CPPFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cppflags"`
28 LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir`
29 LLVM_LIBDIR=`$LLVM_CONFIG --libdir`
Brad Bishop316dfdd2018-06-25 12:45:53 -040030@@ -2644,7 +2644,7 @@ detect_old_buggy_llvm() {
31 dnl ourselves.
Brad Bishopd7bf8c12018-02-25 22:55:05 -050032 dnl (See https://llvm.org/bugs/show_bug.cgi?id=6823)
Brad Bishop316dfdd2018-06-25 12:45:53 -040033 dnl We can't use $LLVM_VERSION because it has 'svn' stripped out,
34- LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version`
35+ LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version | cut -c1-5`
36 AS_IF([test -f "$LLVM_LIBDIR/lib$LLVM_SO_NAME.$IMP_LIB_EXT"], [llvm_have_one_so=yes])
Brad Bishopd7bf8c12018-02-25 22:55:05 -050037
Brad Bishop316dfdd2018-06-25 12:45:53 -040038 if test "x$llvm_have_one_so" = xyes; then
39--
402.15.1
41