configure: modern c++ flags; suppress some libmemcached warnings
authorMichael Wallner <mike@php.net>
Thu, 9 Jan 2020 19:25:54 +0000 (20:25 +0100)
committerMichael Wallner <mike@php.net>
Thu, 9 Jan 2020 19:25:54 +0000 (20:25 +0100)
configure.ac

index 98de0a3e4e25af50cde6b0aadcb21003acd96cb7..49dc5953405cc00e40ef3bfafbb2a633f3b3e4a9 100644 (file)
@@ -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], [