Check the llvm version against a fixed list.

This change is thanks to Peter Hull, who independently resolved
the 2.8 vs 2.8svn issue this way. His patch checked the version
string against a fixed set of options, which is easier to read
and simpler to adjust in the future.
(cherry picked from commit 83cc297561a78ad13fcd1c2943f17ace81c725b8)
This commit is contained in:
Ralph Giles 2010-10-20 15:59:01 -07:00 committed by Graydon Hoare
parent c3879c19c2
commit 6b9a9a7874

View File

@ -168,14 +168,13 @@ endif
ifneq ($(CFG_LLVM_CONFIG),)
CFG_LLVM_VERSION := $(shell $(CFG_LLVM_CONFIG) --version)
$(info cfg: found llvm-config at $(CFG_LLVM_CONFIG))
ifneq ($(findstring 2.8,$(CFG_LLVM_VERSION)),)
$(info cfg: using LLVM version $(CFG_LLVM_VERSION))
else ifneq ($(findstring 2.9,$(CFG_LLVM_VERSION)),)
CFG_LLVM_ALLOWED_VERSIONS := 2.8svn 2.8 2.9svn
ifneq ($(findstring $(CFG_LLVM_VERSION),$(CFG_LLVM_ALLOWED_VERSIONS)),)
$(info cfg: using LLVM version $(CFG_LLVM_VERSION))
else
CFG_LLVM_CONFIG :=
$(info cfg: incompatible LLVM version $(CFG_LLVM_VERSION), \
expected 2.8)
expected one of $(CFG_LLVM_ALLOWED_VERSIONS)
endif
endif
ifneq ($(CFG_LLVM_CONFIG),)