aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Makefile
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-12-18 20:52:50 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-12-18 22:38:06 +0100
commite870df7a36207ae81764ef2a4c0ab1443cdce27b (patch)
tree91195d6d4df3dcb17906542feb334601c8eec4ed /Makefile
parent65840c61dc7a43c962ef9649abdb05efe7479ba3 (diff)
downloadsparse-dev-e870df7a36207ae81764ef2a4c0ab1443cdce27b.tar.gz
build: check if sparse-llvm needs libc++
The output of 'llvm-config --system-libs' is not really complete as libc++ may be needed but not reported as such by this command. So, use the output of 'llvm-config --cxxflags' to check this. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index beaff7a9..e3e9bc64 100644
--- a/Makefile
+++ b/Makefile
@@ -163,6 +163,7 @@ LLVM_LDFLAGS := $(shell $(LLVM_CONFIG) --ldflags)
LLVM_CFLAGS := -I$(shell $(LLVM_CONFIG) --includedir)
LLVM_LIBS := $(shell $(LLVM_CONFIG) --libs)
LLVM_LIBS += $(shell $(LLVM_CONFIG) --system-libs 2>/dev/null)
+LLVM_LIBS += $(shell $(LLVM_CONFIG) --cxxflags | grep -F -q -e '-stdlib=libc++' && echo -lc++)
PROGRAMS += $(LLVM_PROGS)
INST_PROGRAMS += sparse-llvm sparsec
sparse-llvm-cflags := $(LLVM_CFLAGS)