diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2015-06-14 11:46:15 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2015-06-14 11:46:15 +0200 |
commit | 9fdfa1ac5e6b0ea5754b0f91278270b4831bc6a2 (patch) | |
tree | dd8a5b6866f7a9eb53c72e74dd064c4cd9c50203 | |
parent | 158838f9b52d21610626f55964170a3e82f6ccdb (diff) | |
parent | 9d1d5475fdf28a459b8671472026b8a9d6c42370 (diff) |
Merge remote-tracking branch 'origin/master' into diskstreaming
-rw-r--r-- | configure.ac | 50 |
1 files changed, 46 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index 17aae11..7934cc2 100644 --- a/configure.ac +++ b/configure.ac @@ -6,16 +6,58 @@ AM_INIT_AUTOMAKE AC_PROG_CXX AM_PROG_CC_C_O -dnl Compile with C++11 support. -#AX_CXX_COMPILE_STDCXX_11 -CXXFLAGS="$CXXFLAGS -std=c++0x" - LT_INIT AC_CONFIG_HEADERS(config.h) need_jack=no +dnl =========================== +dnl Compile with C++11 support. +dnl =========================== +AC_LANG_PUSH([C++]) +TMP_CXXFLAGS="$CXXFLAGS" +CXXFLAGS=-std=c++11 +AC_MSG_CHECKING([whether CXX supports -std=c++11]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], + [AC_MSG_RESULT([yes])], + [ + AC_MSG_RESULT([no]) + CXXFLAGS=-std=c++0x + AC_MSG_CHECKING([whether CXX supports -std=c++0x]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], + [AC_MSG_RESULT([yes])], + [ + AC_MSG_RESULT([no]) + AC_MSG_ERROR([Compiler does not support c++11]) + ] + ) +] +) +CXXFLAGS="$TMP_CXXFLAGS $CXXFLAGS" +AC_LANG_POP([C++]) + +dnl =========================== +dnl Check for override /final keywords support +dnl =========================== +AC_LANG_PUSH([C++]) +AC_MSG_CHECKING([whether 'override' and 'final' keywords are supported]) +AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [ + class A { virtual void foo() {} }; + class B : public A { virtual void foo() override {} }; + class C : public B { virtual void foo() final {} }; + ] + ) + ], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no (deploying fix)]) + CXXFLAGS="$CXXFLAGS -Doverride=\"\" -Dfinal=\"\"" + ] +) +AC_LANG_POP([C++]) + dnl ====================== dnl Init pkg-config dnl ====================== |