summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2017-01-18 13:54:02 +0000
committerEmil Velikov <[email protected]>2017-02-10 13:55:59 +0000
commitd0c7c6a8ccd67eba8f190985dee7ef3dee570bd7 (patch)
tree1376fd7f6c98585a9146fc6b9bd99205144543c5 /configure.ac
parent619b102ecba50c130b40edbb2f0c75cc9b6acccb (diff)
configure.ac: set LLVM_{C, CXX, LD}FLAGS only as needed
Earlier refactoring commits started setting the above regardless if LLVM is used or not. Move them to the respective section to restore the original functionality. Since we require the preprocessor flags (includes in particular) for the header version parsing keep those as-is. They are not used outside of configure.ac thus should not cause any side-effects. As-is adding the C/CXXFLAGS can lead to build issues on when cross-compiling. Cc: Ilia Mirkin <[email protected]> Cc: Tomasz Figa <[email protected]> Cc: "17.0" <[email protected]> Reported-by: Ilia Mirkin <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Tobias Droste <[email protected]> (cherry picked from commit 4d8bb9cf8c8e8bd3185461760ca89e6021c0b8e0) Conflicts: configure.ac
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac11
1 files changed, 6 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 3906ac7c893..4703b6a5be3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -969,17 +969,14 @@ strip_unwanted_llvm_flags() {
llvm_set_environment_variables() {
if test "x$LLVM_CONFIG" != xno; then
LLVM_VERSION=`$LLVM_CONFIG --version | egrep -o '^[[0-9.]]+'`
- LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
LLVM_BINDIR=`$LLVM_CONFIG --bindir`
LLVM_CPPFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cppflags"`
- LLVM_CFLAGS=$LLVM_CPPFLAGS # CPPFLAGS seem to be sufficient
- LLVM_CXXFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cxxflags"`
LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir`
LLVM_LIBDIR=`$LLVM_CONFIG --libdir`
- # We need to respect LLVM_CFLAGS when compiling LLVM headers.
+ # We need to respect LLVM_CPPFLAGS when compiling LLVM headers.
save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $LLVM_CFLAGS"
+ CFLAGS="$CFLAGS $LLVM_CPPFLAGS"
AC_COMPUTE_INT([LLVM_VERSION_MAJOR], [LLVM_VERSION_MAJOR],
[#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
@@ -2411,6 +2408,10 @@ dnl
if test "x$enable_gallium_llvm" = xyes; then
DEFINES="${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT -DMESA_LLVM_VERSION_PATCH=$LLVM_VERSION_PATCH"
+ LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
+ LLVM_CFLAGS=$LLVM_CPPFLAGS # CPPFLAGS seem to be sufficient
+ LLVM_CXXFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cxxflags"`
+
dnl Set LLVM_LIBS - This is done after the driver configuration so
dnl that drivers can add additional components to LLVM_COMPONENTS.
dnl Previously, gallium drivers were updating LLVM_LIBS directly