From: Michael Wallner Date: Thu, 9 Jan 2020 19:25:54 +0000 (+0100) Subject: configure: modern c++ flags; suppress some libmemcached warnings X-Git-Tag: pre_cmake~60 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=701592b9754d2ace633882791c755826e3a8af68;p=awesomized%2Flibmemcached configure: modern c++ flags; suppress some libmemcached warnings --- diff --git a/configure.ac b/configure.ac index 98de0a3e..49dc5953 100644 --- a/configure.ac +++ b/configure.ac @@ -65,13 +65,29 @@ AC_SUBST([lt_cv_dlopen_libs]) AC_PROG_CC_C99 AS_IF([test "x${ac_cv_prog_cc_c99}" == "xno"],[AC_MSG_ERROR([No c99 compatible compiler found])]) -AC_DEFUN([CHECK_CXX0X],[ - AC_LANG_PUSH([C++]) - AX_CHECK_COMPILE_FLAG([-std=c++0x],[ - CXX="$CXX -std=c++0x"]) - AC_LANG_POP([C++]) - ]) -CHECK_CXX0X +AC_LANG_PUSH([C++]) +AX_CHECK_COMPILE_FLAG([-std=gnu++14], [ + AX_APPEND_COMPILE_FLAGS(["-std=gnu++14"]) +], [ + AX_CHECK_COMPILE_FLAG([-std=c++14], [ + AX_APPEND_COMPILE_FLAGS(["-std=c++14"]) + ], [ + AX_CHECK_COMPILE_FLAG([-std=gnu++11], [ + AX_APPEND_COMPILE_FLAGS(["-std=gnu++11"]) + ], [ + AX_CHECK_COMPILE_FLAG([-std=c++11], [ + AX_APPEND_COMPILE_FLAGS(["-std=c++11"]) + ], [ + AX_CHECK_COMPILE_FLAG([-std=gnu++0x], [ + AX_APPEND_COMPILE_FLAGS(["-std=gnu++0x"]) + ], [ + AX_APPEND_COMPILE_FLAGS(["-std=c++0x"]) + ]) + ]) + ]) + ]) +]) +AC_LANG_POP([C++]) AC_LANG_PUSH([C]) @@ -341,6 +357,12 @@ AX_ENDIAN AX_ASSERT AX_HARDEN_COMPILER_FLAGS +# override sompe flags specific to libmemcached +AX_APPEND_COMPILE_FLAGS([-Wno-long-long]) +AC_LANG_PUSH([C++]) +AX_APPEND_COMPILE_FLAGS([-Wno-long-long -Wno-old-style-cast]) +AC_LANG_POP([C++]) + AC_ARG_ENABLE([warnings-as-errors], AS_HELP_STRING([--enable-warnings-as-errors], [Build with -Werror enabled]), , [enable_warnings_as_errors=no]) AC_CACHE_CHECK([if all warnings should produce an error], [ac_cv_warnings_as_errors], [