You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2016/03/18 01:30:01 UTC

[4/4] mesos git commit: Fixed m4 macro to enable strict C++11 conformance in libprocess.

Fixed m4 macro to enable strict C++11 conformance in libprocess.

If the compiler supports C++11 or greater by default, we might
still need to specify "-std=c++11" to disable compiler support for
GNU-specific extensions or C++14. This is the case for GCC 6, which
defaults to "-std=g++14".

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


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

Branch: refs/heads/master
Commit: e376d3aa0074710278224ccd17afd51971820dfb
Parents: 796556d
Author: Neil Conway <ne...@gmail.com>
Authored: Thu Mar 17 17:27:43 2016 -0700
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Thu Mar 17 17:29:43 2016 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/m4/ax_cxx_compile_stdcxx.m4 | 46 +++++++++++---------
 1 file changed, 25 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/e376d3aa/3rdparty/libprocess/m4/ax_cxx_compile_stdcxx.m4
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/m4/ax_cxx_compile_stdcxx.m4 b/3rdparty/libprocess/m4/ax_cxx_compile_stdcxx.m4
index 8adc765..fa54631 100644
--- a/3rdparty/libprocess/m4/ax_cxx_compile_stdcxx.m4
+++ b/3rdparty/libprocess/m4/ax_cxx_compile_stdcxx.m4
@@ -89,27 +89,31 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
   fi])
 
   m4_if([$2], [ext], [], [dnl
-  if test x$ac_success = xno; then
-    dnl HP's aCC needs +std=c++11 according to:
-    dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf
-    dnl Cray's crayCC needs "-h std=c++11"
-    for switch in -std=c++$1 -std=c++0x +std=c++$1 "-h std=c++$1"; do
-      cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
-      AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
-                     $cachevar,
-        [ac_save_CXX="$CXX"
-         CXX="$CXX $switch"
-         AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
-          [eval $cachevar=yes],
-          [eval $cachevar=no])
-         CXX="$ac_save_CXX"])
-      if eval test x\$$cachevar = xyes; then
-        CXX="$CXX $switch"
-        ac_success=yes
-        break
-      fi
-    done
-  fi])
+  dnl Note that in "noext" mode, we still want to specify a "-std" flag
+  dnl if the compiler accepts it (even if the compiler supports the
+  dnl desired C++ dialect without any flags), because the default compiler
+  dnl dialect might include support for extensions.
+  dnl HP's aCC needs +std=c++11 according to:
+  dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf
+  dnl Cray's crayCC needs "-h std=c++11"
+  for switch in -std=c++$1 -std=c++0x +std=c++$1 "-h std=c++$1"; do
+    cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
+    AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
+                   $cachevar,
+      [ac_save_CXX="$CXX"
+       CXX="$CXX $switch"
+       AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
+        [eval $cachevar=yes],
+        [eval $cachevar=no])
+       CXX="$ac_save_CXX"])
+    if eval test x\$$cachevar = xyes; then
+      CXX="$CXX $switch"
+      ac_success=yes
+      break
+    fi
+  done
+  ])
+
   AC_LANG_POP([C++])
   if test x$ax_cxx_compile_cxx$1_required = xtrue; then
     if test x$ac_success = xno; then