File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,24 @@ LLD_SRC ?= llvm-project/lld
99
1010# Default tool selection.
1111CLANG ?= clang-9
12- LLVM_AR ?= llvm-ar-9
13- LLVM_NM ?= llvm-nm-9
12+
13+ # Try to autodetect llvm-ar and llvm-nm
14+ ifneq (, $(shell command -v llvm-ar-9 2> /dev/null) )
15+ LLVM_AR ?= llvm-ar-9
16+ else ifneq (, $(shell command -v llvm-ar 2> /dev/null))
17+ LLVM_AR ?= llvm-ar
18+ endif
19+ ifneq (, $(shell command -v llvm-nm-9 2> /dev/null) )
20+ LLVM_NM ?= llvm-nm-9
21+ else ifneq (, $(shell command -v llvm-nm 2> /dev/null))
22+ LLVM_NM ?= llvm-nm
23+ endif
24+ ifndef LLVM_AR
25+ $(warning llvm-ar not found)
26+ endif
27+ ifndef LLVM_NM
28+ $(warning llvm-nm not found)
29+ endif
1430
1531# Go binary and GOROOT to select
1632GO ?= go
@@ -23,7 +39,7 @@ MD5SUM = md5sum
2339TINYGO ?= tinygo
2440
2541# Use CCACHE for LLVM if possible
26- ifneq (, $(shell which ccache) )
42+ ifneq (, $(shell command -v ccache 2> /dev/null ) )
2743 LLVM_OPTION += '-DLLVM_CCACHE_BUILD=ON'
2844endif
2945
You can’t perform that action at this time.
0 commit comments