[Mesa-dev] [PATCH] clover: Fix build since LLVM's switch to c++11
Tom Stellard
thomas.stellard at amd.com
Mon Mar 3 08:03:23 PST 2014
---
This patch should work for older LLVM versions too.
configure.ac | 5 +++++
src/gallium/state_trackers/clover/Makefile.am | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 0e0fd18..a1eb907 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1371,6 +1371,7 @@ AC_SUBST([LLVM_BINDIR])
AC_SUBST([LLVM_CFLAGS])
AC_SUBST([LLVM_CPPFLAGS])
AC_SUBST([LLVM_CXXFLAGS])
+AC_SUBST([LLVM_CXX_VERSION_FLAG])
AC_SUBST([LLVM_LIBDIR])
AC_SUBST([LLVM_LIBS])
AC_SUBST([LLVM_LDFLAGS])
@@ -1559,6 +1560,10 @@ if test "x$enable_gallium_llvm" = xyes; then
LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir`
LLVM_LIBDIR=`$LLVM_CONFIG --libdir`
LLVM_LDFLAGS="-Wl,-rpath,$LLVM_LIBDIR $LLVM_LDFLAGS"
+ LLVM_CXX_VERSION_FLAG=`$LLVM_CONFIG --cxxflags | grep -o '\-std=[[^ ]]\+'`
+ if test -z "$LLVM_CXX_VERSION_FLAG"; then
+ LLVM_CXX_VERSION_FLAG="-std=c++98"
+ fi
AC_COMPUTE_INT([LLVM_VERSION_MAJOR], [LLVM_VERSION_MAJOR],
[#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
diff --git a/src/gallium/state_trackers/clover/Makefile.am b/src/gallium/state_trackers/clover/Makefile.am
index ece2b38..0f1838e 100644
--- a/src/gallium/state_trackers/clover/Makefile.am
+++ b/src/gallium/state_trackers/clover/Makefile.am
@@ -37,7 +37,7 @@ libcltgsi_la_SOURCES = \
tgsi/compiler.cpp
libclllvm_la_CXXFLAGS = \
- -std=c++98 \
+ $(LLVM_CXX_VERSION_FLAG) \
$(VISIBILITY_CXXFLAGS) \
$(LLVM_CPPFLAGS) \
$(DEFINES) \
--
1.8.1.4
More information about the mesa-dev
mailing list