mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-07 20:43:40 +00:00
Makefile: fix LLVM tools detection for wasi-libc
This makes the `make wasi-libc` command much more reliable and makes the CI configuration simpler. Also, it avoids warnings when they are not relevant.
This commit is contained in:
@@ -7,26 +7,26 @@ LLVM_BUILDDIR ?= llvm-build
|
||||
CLANG_SRC ?= llvm-project/clang
|
||||
LLD_SRC ?= llvm-project/lld
|
||||
|
||||
# Default tool selection.
|
||||
CLANG ?= clang-9
|
||||
|
||||
# Try to autodetect llvm-ar and llvm-nm
|
||||
ifneq (, $(shell command -v llvm-ar-9 2> /dev/null))
|
||||
# Try to autodetect LLVM build tools.
|
||||
ifneq (, $(shell command -v llvm-build/bin/clang 2> /dev/null))
|
||||
CLANG ?= $(abspath llvm-build/bin/clang)
|
||||
else
|
||||
CLANG ?= clang-9
|
||||
endif
|
||||
ifneq (, $(shell command -v llvm-build/bin/llvm-ar 2> /dev/null))
|
||||
LLVM_AR ?= $(abspath llvm-build/bin/llvm-ar)
|
||||
else ifneq (, $(shell command -v llvm-ar-9 2> /dev/null))
|
||||
LLVM_AR ?= llvm-ar-9
|
||||
else ifneq (, $(shell command -v llvm-ar 2> /dev/null))
|
||||
else
|
||||
LLVM_AR ?= llvm-ar
|
||||
endif
|
||||
ifneq (, $(shell command -v llvm-nm-9 2> /dev/null))
|
||||
ifneq (, $(shell command -v llvm-build/bin/llvm-nm 2> /dev/null))
|
||||
LLVM_NM ?= $(abspath llvm-build/bin/llvm-nm)
|
||||
else ifneq (, $(shell command -v llvm-nm-9 2> /dev/null))
|
||||
LLVM_NM ?= llvm-nm-9
|
||||
else ifneq (, $(shell command -v llvm-nm 2> /dev/null))
|
||||
else
|
||||
LLVM_NM ?= llvm-nm
|
||||
endif
|
||||
ifndef LLVM_AR
|
||||
$(warning llvm-ar not found)
|
||||
endif
|
||||
ifndef LLVM_NM
|
||||
$(warning llvm-nm not found)
|
||||
endif
|
||||
|
||||
# Go binary and GOROOT to select
|
||||
GO ?= go
|
||||
|
||||
Reference in New Issue
Block a user