@@ -1238,7 +1238,16 @@ AS_IF([test "x$enable_Werror" = "xyes" || test "x$enable_Werror" = "xauto"],
1238
1238
# One of big missing features in gcc-4.8 was std::regex support fixed in 4.9
1239
1239
# Testing code from https://stackoverflow.com/a/41186162/4715872
1240
1240
# caveats apply (use of unguaranteed private macros)
1241
+ AC_ARG_ENABLE([gcc-std-regex],
1242
+ AS_HELP_STRING([--enable-gcc-std-regex],
1243
+ [Check for std::regex support if compiler is GCC, assuming it means satisfactory level of C++11 there [default=yes]]),
1244
+ [enable_gcc_std_regex=$enableval],
1245
+ [enable_gcc_std_regex=$defaultval])
1246
+
1247
+ AM_CONDITIONAL([ENABLE_GCC_STD_REGEX], [test x$enable_gcc_std_regex != xno])
1248
+
1241
1249
AS_IF([test -n "$CXX"],[AS_IF([$CXX --version 2>&1 | grep 'Free Software Foundation' > /dev/null && test "x$GCC" = "xyes"],
1250
+ [AS_IF([test "x$enable_gcc_std_regex" = "xyes" || test "x$enable_gcc_std_regex" = "xauto"],
1242
1251
[AC_MSG_CHECKING([for GNU C++11 support level expected by gcc-4.9 release or newer])
1243
1252
CXXFLAGS="$CXXFLAGS --std=c++11"
1244
1253
AC_LANG_PUSH([C++])
@@ -1269,9 +1278,12 @@ int main() {
1269
1278
#endif
1270
1279
return result ? EXIT_SUCCESS : EXIT_FAILURE;
1271
1280
}
1272
- ], AC_MSG_RESULT([ok]), AC_MSG_ERROR([test for std::regex failed]) )
1281
+ ], AC_MSG_RESULT([ok]), AC_MSG_ERROR([test for std::regex failed]) )
1273
1282
AC_LANG_POP([C++])
1274
1283
]
1284
+ ,[AC_MSG_WARN([Not checking for GNU C++11 support level expected by gcc-4.9 release or newer, due to explicit configure option])
1285
+ AC_MSG_WARN([YOU ARE AT RISK OF SOMETHING NOT WORKING WITH THIS BUILD OF THE CODEBASE])]
1286
+ )]
1275
1287
)])
1276
1288
1277
1289
.endif
0 commit comments