summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRandy Dunlap <rdunlap@infradead.org>2019-04-26 08:20:13 -0700
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-09-02 17:34:00 +0200
commit3c748099b5a79d74461c142248920316504c5cb0 (patch)
treef466ca02706b44a548b10911b5e0364645428750
parentd90c0838c1011e4a12f594e62a194966f52dd4ee (diff)
downloadsparse-3c748099b5a79d74461c142248920316504c5cb0.tar.gz
problem building sparse 0.6.0 (sparse-llvm)
Certain macros have to be defined in order to use the llvm DataTypes.h header file. Fixes these build errors when building sparse-llvm: CC sparse-llvm.o In file included from /usr/include/llvm-c/Types.h:17:0, from /usr/include/llvm-c/ErrorHandling.h:17, from /usr/include/llvm-c/Core.h:18, from sparse-llvm.c:6: /usr/include/llvm/Support/DataTypes.h:57:3: error: #error "Must #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h" # error "Must #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h" ^ /usr/include/llvm/Support/DataTypes.h:61:3: error: #error "Must #define __STDC_CONSTANT_MACROS before " "#including Support/DataTypes.h" # error "Must #define __STDC_CONSTANT_MACROS before " \ ^ This is from using llvm 3.8.0. Suggested-by: Ramsay Jones <ramsay@ramsayjones.plus.com> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 499eca8c..7e8c2abc 100644
--- a/Makefile
+++ b/Makefile
@@ -165,7 +165,7 @@ ifeq ($(shell expr "$(LLVM_VERSION)" : '[3-9]\.'),2)
LLVM_PROGS := sparse-llvm
$(LLVM_PROGS): LD := g++
LLVM_LDFLAGS := $(shell $(LLVM_CONFIG) --ldflags)
-LLVM_CFLAGS := -I$(shell $(LLVM_CONFIG) --includedir)
+LLVM_CFLAGS := $(shell $(LLVM_CONFIG) --cppflags)
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++)