summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac6
1 files changed, 6 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 655b76ed6e6..182d0726c30 100644
--- a/configure.ac
+++ b/configure.ac
@@ -979,6 +979,10 @@ llvm_set_environment_variables() {
LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir`
LLVM_LIBDIR=`$LLVM_CONFIG --libdir`
+ # We need to respect LLVM_CFLAGS when compiling LLVM headers.
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $LLVM_CFLAGS"
+
AC_COMPUTE_INT([LLVM_VERSION_MAJOR], [LLVM_VERSION_MAJOR],
[#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
AC_COMPUTE_INT([LLVM_VERSION_MINOR], [LLVM_VERSION_MINOR],
@@ -986,6 +990,8 @@ llvm_set_environment_variables() {
AC_COMPUTE_INT([LLVM_VERSION_PATCH], [LLVM_VERSION_PATCH],
[#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
+ CFLAGS="$save_CFLAGS"
+
# Only needed for LLVM < 3.6.0
if test -z "$LLVM_VERSION_PATCH"; then
LLVM_VERSION_PATCH=0