summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorAndrzej Rybczak <electricityispower@gmail.com>2012-09-02 21:29:47 +0200
committerAndrzej Rybczak <electricityispower@gmail.com>2012-09-02 21:56:44 +0200
commit3b0756eb2f09556383085f4d80309fc52bbb4eda (patch)
treed3fe786a0a113feb46e99c3894f8ca9007287354 /configure.in
parent594f73c626eba7d52847409fad94986070b3b133 (diff)
configure: add checks for used c++11 features
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in32
1 files changed, 31 insertions, 1 deletions
diff --git a/configure.in b/configure.in
index fc6e5228..834ffe86 100644
--- a/configure.in
+++ b/configure.in
@@ -50,10 +50,40 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]])],
AC_MSG_RESULT([yes])
std_cpp0x="-std=c++0x",
AC_MSG_RESULT([no])
- AC_MSG_ERROR([[Your compiler doesn't seem to support C++0x, please upgrade (GCC >= 4.4)]])
+ AC_MSG_ERROR([[Your compiler doesn't seem to support C++0x, please upgrade (GCC >= 4.5)]])
)
CXXFLAGS="$old_CXXFLAGS $std_cpp0x"
+dnl ==========================================
+dnl = checking for initializer lists support =
+dnl ==========================================
+AC_MSG_CHECKING([whether compiler supports initializer lists])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <vector>], [[std::vector<int> test = { 1, 2, 3 }; test.push_back(4);]])],
+ AC_MSG_RESULT([yes]),
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([[Your compiler doesn't seem to support initializer lists, please upgrade (GCC >= 4.5)]])
+)
+
+dnl =====================================
+dnl = checking for auto keyword support =
+dnl =====================================
+AC_MSG_CHECKING([whether compiler supports auto keyword])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[auto test = new int; *test = 1;]])],
+ AC_MSG_RESULT([yes]),
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([[Your compiler doesn't seem to support auto keyword, please upgrade (GCC >= 4.5)]])
+)
+
+dnl =========================================
+dnl = checking for lambda functions support =
+dnl =========================================
+AC_MSG_CHECKING([whether compiler supports lambda functions])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <functional>], [[int a = 5; std::function<int(int)> f = [&a](int b) { return a + b; }; f(8);]])],
+ AC_MSG_RESULT([yes]),
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([[Your compiler doesn't seem to support lambda functions, please upgrade (GCC >= 4.5)]])
+)
+
dnl ==============================
dnl = checking for regex (win32) =
dnl ==============================