[Libclc-dev] [PATCH] LLVM 3.5 and newer use llvm-config.h instead of config.h

Niels Ole Salscheider niels_ole at salscheider-online.de
Sat Aug 9 03:43:28 PDT 2014


Signed-off-by: Niels Ole Salscheider <niels_ole at salscheider-online.de>
---
 configure.py               | 3 +++
 utils/prepare-builtins.cpp | 5 +++++
 2 files changed, 8 insertions(+)

diff --git a/configure.py b/configure.py
index 768a6ad..f28c847 100755
--- a/configure.py
+++ b/configure.py
@@ -73,6 +73,9 @@ llvm_core_libs = llvm_config(['--libs', 'core', 'bitreader', 'bitwriter']) + ' '
                  llvm_config(['--ldflags'])
 llvm_cxxflags = llvm_config(['--cxxflags']) + ' -fno-exceptions -fno-rtti'
 
+if (int(llvm_version[0]) == 3 and int(llvm_version[1]) >= 5) or int(llvm_version[0]) > 3:
+    llvm_cxxflags = llvm_cxxflags + ' -DLLVM_NEW_CONFIG_INCLUDE'
+
 llvm_clang = os.path.join(llvm_bindir, 'clang')
 llvm_link = os.path.join(llvm_bindir, 'llvm-link')
 llvm_opt = os.path.join(llvm_bindir, 'opt')
diff --git a/utils/prepare-builtins.cpp b/utils/prepare-builtins.cpp
index ce84148..20fcd1b 100644
--- a/utils/prepare-builtins.cpp
+++ b/utils/prepare-builtins.cpp
@@ -10,7 +10,12 @@
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Support/ErrorOr.h"
 #include "llvm/Support/ToolOutputFile.h"
+
+#ifdef LLVM_NEW_CONFIG_INCLUDE
+#include "llvm/Config/llvm-config.h"
+#else
 #include "llvm/Config/config.h"
+#endif
 
 #define LLVM_350_AND_NEWER \
   (LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 5))
-- 
2.0.4





More information about the Libclc-dev mailing list