Skip to content

Commit 6d79ed1

Browse files
committed
mk: Fix --llvm-root finding tools
LLVM's tools are not contained in the local directory if --llvm-root is used by the ./configure script. This fixes the installation path to be the root provided by --llvm-root.
1 parent ea72398 commit 6d79ed1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mk/main.mk

+4
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,12 @@ LLVM_TOOLS=bugpoint llc llvm-ar llvm-as llvm-dis llvm-mc opt llvm-extract
218218
define DEF_LLVM_VARS
219219
# The configure script defines these variables with the target triples
220220
# separated by Z. This defines new ones with the expected format.
221+
ifeq ($$(CFG_LLVM_ROOT),)
221222
CFG_LLVM_BUILD_DIR_$(1):=$$(CFG_LLVM_BUILD_DIR_$(subst -,_,$(1)))
222223
CFG_LLVM_INST_DIR_$(1):=$$(CFG_LLVM_INST_DIR_$(subst -,_,$(1)))
224+
else
225+
CFG_LLVM_INST_DIR_$(1):=$$(CFG_LLVM_ROOT)
226+
endif
223227

224228
# Any rules that depend on LLVM should depend on LLVM_CONFIG
225229
LLVM_CONFIG_$(1):=$$(CFG_LLVM_INST_DIR_$(1))/bin/llvm-config$$(X_$(1))

0 commit comments

Comments
 (0)