aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorQuentin Monnet <quentin@isovalent.com>2020-04-20 16:53:52 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-05-14 22:58:51 +0200
commit1bca83e8bfdca64fd6374fb6e3403f517c58dcb1 (patch)
tree1590520cf384cbf28a5bc1cca30b6a47322fdcf6
parentc51a0382202e992c1d0c4fa87fad7eb625a73a2a (diff)
downloadsparse-1bca83e8bfdca64fd6374fb6e3403f517c58dcb1.tar.gz
build: fix LLVM version detection
The regex match used for detecting the LLVM version works for versions with a single-digit major number. Now that LLVM v10 is out, detection can fail, resulting in sparse-llvm not being built. Fix detection by extracting the major version number to compare with the minimum supported. Signed-off-by: Quentin Monnet <quentin@isovalent.com> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--Makefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 85d15edc..e93cfd66 100644
--- a/Makefile
+++ b/Makefile
@@ -183,7 +183,8 @@ arch := x32
endif
ifneq ($(filter ${arch},i386 i486 i586 i686 x86_64 amd64),)
LLVM_VERSION:=$(shell $(LLVM_CONFIG) --version)
-ifeq ($(shell expr "$(LLVM_VERSION)" : '[3-9]\.'),2)
+LLVM_VERSION_MAJOR:=$(firstword $(subst ., ,$(LLVM_VERSION)))
+ifeq ($(shell expr "$(LLVM_VERSION_MAJOR)" '>=' 3),1)
LLVM_PROGS := sparse-llvm
$(LLVM_PROGS): LD := g++
LLVM_LDFLAGS := $(shell $(LLVM_CONFIG) --ldflags)