You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by rr...@apache.org on 2018/08/08 16:22:36 UTC

[trafficserver] branch master updated: Detects compiler support of C++17 at configure time

This is an automated email from the ASF dual-hosted git repository.

rrm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 47cb274  Detects compiler support of C++17 at configure time
47cb274 is described below

commit 47cb274d799d5331dad19027705d8c5719959b8c
Author: Randall Meyer <ra...@yahoo.com>
AuthorDate: Wed Jun 13 10:18:11 2018 -0700

    Detects compiler support of C++17 at configure time
    
    Addresses issue #3769
---
 configure.ac | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/configure.ac b/configure.ac
index e85747e..ab0d2d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -663,6 +663,25 @@ CXXFLAGS="${_ts_saved_CXXFLAGS}"
 # All compilers we support have 'gnu99' as an available C standard
 TS_ADDTO(AM_CFLAGS, [-std=gnu99])
 
+ac_save_CXX="$CXX"
+CXX="$CXX -std=c++17"
+AC_LANG_PUSH(C++)
+AC_MSG_CHECKING([checking whether $CXX supports -std=c++17])
+AC_COMPILE_IFELSE([
+    AC_LANG_PROGRAM([
+#if __cplusplus < 201703L
+#error "This is not C++17"
+#endif
+    ], []
+    )], [
+    AC_MSG_RESULT(yes)
+    ], [
+    AC_MSG_RESULT(no)
+    AC_MSG_ERROR([*** A compiler with support for -std=c++17 is required.])
+])
+AC_LANG_POP
+CXX="$ac_save_CXX"
+
 TS_ADDTO(AM_CXXFLAGS, [-std=c++17])
 
 dnl AC_PROG_SED is only available from version 2.6 (released in 2003). CentosOS