File tree 1 file changed +19
-3
lines changed
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
9
9
10
10
# Default tool selection.
11
11
CLANG ?= 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
14
30
15
31
# Go binary and GOROOT to select
16
32
GO ?= go
@@ -23,7 +39,7 @@ MD5SUM = md5sum
23
39
TINYGO ?= tinygo
24
40
25
41
# Use CCACHE for LLVM if possible
26
- ifneq (, $(shell which ccache) )
42
+ ifneq (, $(shell command -v ccache 2> /dev/null ) )
27
43
LLVM_OPTION += '-DLLVM_CCACHE_BUILD=ON'
28
44
endif
29
45
You can’t perform that action at this time.
0 commit comments