Begin transition to C++11 by warning if using a pre-C++11 GCC compiler

This commit is contained in:
Jonathan Campbell
2018-01-22 01:40:21 -08:00
parent de909a1d8a
commit f149d6f35a
28 changed files with 273 additions and 37 deletions

View File

@@ -119,10 +119,20 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#endif
])],[],[AC_DEFINE([socklen_t],[int],[Define to `int` if you don't have socklen_t])])
dnl C++0x is now considered deprecated.
dnl This warning will stay here for a long enough period of time before making C++11 mandatory.
dnl AC_CHECK_CXXFLAGS will prepend gnu++11 to CXXFLAGS if supported, for us.
dnl our code adds -std=gnu++0x if not supported where the function would not do anything.
AC_MSG_CHECKING([checking for C++11 support])
AC_CHECK_CXXFLAGS([ -std=gnu++11 ], [ ], [ CXXFLAGS="$CXXFLAGS -std=gnu++0x" ])
AC_CHECK_CXXFLAGS([ -std=gnu++11 ], [ ], [
CXXFLAGS="$CXXFLAGS -std=gnu++0x";
warn_cpp0x=1
])
if test x$warn_cpp0x = x1; then
AC_MSG_WARN([ C++0x is considered deprecated. Please use a C++11 compiler. C++0x support will be removed at a future date. ])
fi
dnl TEST: Environ can be included
AC_MSG_CHECKING(if environ can be included)