Skip to content

Commit 4481069

Browse files
committed
Add option to build with a LLVM prefix instead of system LLVM/Built LLVM
This patch allows the use of a LLVM prefix instead of system or built in-tree LLVM, this is part of the effort to distribute gnat-llvm in alire.
1 parent 57afbd5 commit 4481069

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

llvm-interface/Makefile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,20 @@ ifneq ($(wildcard $(LLVM_BUILD_DIR)/bin/llvm-config),)
2828
LLVM_SRC=$(shell cd `$(LLVM_CONFIG) --includedir`/../..;pwd)
2929
CLANG_CXXFLAGS=-I$(LLVM_BUILD_DIR)/tools/clang/include -I$(LLVM_SRC)/clang/include
3030
else
31-
LLVM_CONFIG=llvm-config
32-
CLANG_CXXFLAGS=
31+
# Allows the use of alternate named binaries
32+
ifneq ($(LLVM_CONFIG),)
33+
LLVM_CONFIG:=$(LLVM_CONFIG)
34+
else
35+
LLVM_CONFIG=llvm-config
36+
endif
37+
38+
# Allows the use of a custom LLVM prefix
39+
ifneq ($(LLVM_PREFIX),)
40+
LLVM_CONFIG:=$(LLVM_PREFIX)/$(LLVM_CONFIG)
41+
CLANG_CXXFLAGS=-I$(shell $(LLVM_CONFIG) --prefix)/tools/clang/include -I$(shell cd `$(LLVM_CONFIG) --prefix`/..;pwd)/clang/include
42+
else
43+
CLANG_CXXFLAGS=
44+
endif
3345
endif
3446

3547
LDFLAGS=$(shell $(LLVM_CONFIG) --libs all --ldflags --system-libs)

0 commit comments

Comments
 (0)