libprocess: Added -Wno-unused-local-typedef for clang 3.6

Review: https://reviews.apache.org/r/32748


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/06dd75ce
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/06dd75ce
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/06dd75ce

Branch: refs/heads/master
Commit: 06dd75ce37ce3ba8466c3a3d90e0d12c0a308f4f
Parents: 6da1d4e
Author: Cody Maloney <[email protected]>
Authored: Wed Apr 15 19:47:11 2015 +0200
Committer: Till Toenshoff <[email protected]>
Committed: Thu Apr 16 09:54:23 2015 +0200

----------------------------------------------------------------------
 3rdparty/libprocess/configure.ac | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/06dd75ce/3rdparty/libprocess/configure.ac
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/configure.ac b/3rdparty/libprocess/configure.ac
index a126ecf..723777d 100644
--- a/3rdparty/libprocess/configure.ac
+++ b/3rdparty/libprocess/configure.ac
@@ -659,6 +659,33 @@ if test "x$CLANG" = "xno"; then
   if test "x$is_gxx47" = "xyes"; then
     AC_MSG_ERROR([Unable to build with g++-4.7 due to missing C++11 features])
   fi
+
+# CLANG=yes
+else
+
+  # Check if -Wno-unused-local-typedef is needed by checking a sample
+  # compilation which contains a local unused typedef.
+  # This is needed because Boost 1.53.0 fails to compile with upstream
+  # Clang 3.6 without -Wno-unused-local-typedef. Apple LLVM based on
+  # Clang 3.6 doesn't have the same behavior.
+  AC_LANG_PUSH([C++])
+  AC_COMPILE_IFELSE(
+  [AC_LANG_SOURCE([[
+    #pragma clang diagnostic error "-Wunused-local-typedef"
+
+    int foo()
+    {
+      typedef int return_type;
+      return 5;
+    }
+  ]])],
+  [warn_local_typedefs=no], [warn_local_typedefs=yes])
+  AC_LANG_POP([C++])
+
+  if test "x$warn_local_typedefs" = "xyes"; then
+    AC_MSG_NOTICE([Disabling warnings about unused local typedefs])
+    CXXFLAGS="${CXXFLAGS} -Wno-unused-local-typedef"
+  fi
 fi
 
 

Reply via email to