configure: check for -std=c++11 support and enable st/mesa test accordingly

Add a check that tests whether the c++ compiler supports c++11, either
by default, by adding the compiler flag -std=c++11, or by adding a
compiler flag that the user has specified via the environment variable
CXX11_CXXFLAGS.

The test only does a very shallow check of c++11 support, i.e. it tests
whether the define  __cplusplus >= 201103L to confirm language support
by the compiler, and it checks whether the header <tuple> is available
to test the availability of the c++11 standard library.

A make file conditional HAVE_STD_CXX11 is provided that is used in this
patch to enable the test in st/mesa if C++11 support is available.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102665
Acked-by: Emil Velikov <emil.velikov@collabora.com>
This commit is contained in:
Gert Wollny
2017-10-18 17:05:25 +02:00
committed by Emil Velikov
parent 6dd56fafe2
commit 09ad2576ec
2 changed files with 59 additions and 1 deletions
+3 -1
View File
@@ -5,7 +5,7 @@ AM_CFLAGS = \
AM_CXXFLAGS = \
$(GALLIUM_DRIVER_CXXFLAGS) \
-std=c++11
$(CXX11_CXXFLAGS)
AM_CPPFLAGS = \
-I$(top_srcdir)/src/gtest/include \
@@ -15,8 +15,10 @@ AM_CPPFLAGS = \
-I$(top_builddir)/src/compiler/glsl \
$(DEFINES)
if HAVE_STD_CXX11
TESTS = st-renumerate-test
check_PROGRAMS = st-renumerate-test
endif
st_renumerate_test_SOURCES = \
test_glsl_to_tgsi_lifetime.cpp