1
1
# ============================================================================
2
- # http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_14 .html
2
+ # http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_17 .html
3
3
# ============================================================================
4
4
#
5
5
# SYNOPSIS
6
6
#
7
- # AX_CXX_COMPILE_STDCXX_14 ([ext|noext],[mandatory|optional])
7
+ # AX_CXX_COMPILE_STDCXX_17 ([ext|noext],[mandatory|optional])
8
8
#
9
9
# DESCRIPTION
10
10
#
11
- # Check for baseline language coverage in the compiler for the C++14
11
+ # Check for baseline language coverage in the compiler for the C++17
12
12
# standard; if necessary, add switches to CXXFLAGS to enable support.
13
13
#
14
14
# The first argument, if specified, indicates whether you insist on an
15
- # extended mode (e.g. -std=gnu++14 ) or a strict conformance mode (e.g.
16
- # -std=c++14 ). If neither is specified, you get whatever works, with
15
+ # extended mode (e.g. -std=gnu++17 ) or a strict conformance mode (e.g.
16
+ # -std=c++17 ). If neither is specified, you get whatever works, with
17
17
# preference for an extended mode.
18
18
#
19
19
# The second argument, if specified 'mandatory' or if left unspecified,
20
- # indicates that baseline C++14 support is required and that the macro
20
+ # indicates that baseline C++17 support is required and that the macro
21
21
# should error out if no mode with that support is found. If specified
22
22
# 'optional', then configuration proceeds regardless, after defining
23
- # HAVE_CXX14 if and only if a supporting mode is found.
23
+ # HAVE_CXX17 if and only if a supporting mode is found.
24
24
#
25
25
# LICENSE
26
26
#
36
36
37
37
# serial 4
38
38
39
- m4_define ( [ _AX_CXX_COMPILE_STDCXX_14_testbody ] , [ [
39
+ m4_define ( [ _AX_CXX_COMPILE_STDCXX_17_testbody ] , [ [
40
40
template <typename T>
41
41
struct check
42
42
{
@@ -63,42 +63,42 @@ m4_define([_AX_CXX_COMPILE_STDCXX_14_testbody], [[
63
63
auto l = [ ] (){};
64
64
] ] )
65
65
66
- AC_DEFUN ( [ AX_CXX_COMPILE_STDCXX_14 ] , [ dnl
66
+ AC_DEFUN ( [ AX_CXX_COMPILE_STDCXX_17 ] , [ dnl
67
67
m4_if ( [ $1 ] , [ ] , [ ] ,
68
68
[ $1 ] , [ ext] , [ ] ,
69
69
[ $1 ] , [ noext] , [ ] ,
70
- [ m4_fatal ( [ invalid argument `$1 ' to AX_CXX_COMPILE_STDCXX_14 ] ) ] ) dnl
71
- m4_if ( [ $2 ] , [ ] , [ ax_cxx_compile_cxx14_required =true] ,
72
- [ $2 ] , [ mandatory] , [ ax_cxx_compile_cxx14_required =true] ,
73
- [ $2 ] , [ optional] , [ ax_cxx_compile_cxx14_required =false] ,
74
- [ m4_fatal ( [ invalid second argument `$2 ' to AX_CXX_COMPILE_STDCXX_14 ] ) ] )
70
+ [ m4_fatal ( [ invalid argument `$1 ' to AX_CXX_COMPILE_STDCXX_17 ] ) ] ) dnl
71
+ m4_if ( [ $2 ] , [ ] , [ ax_cxx_compile_cxx17_required =true] ,
72
+ [ $2 ] , [ mandatory] , [ ax_cxx_compile_cxx17_required =true] ,
73
+ [ $2 ] , [ optional] , [ ax_cxx_compile_cxx17_required =false] ,
74
+ [ m4_fatal ( [ invalid second argument `$2 ' to AX_CXX_COMPILE_STDCXX_17 ] ) ] )
75
75
AC_LANG_PUSH ( [ C++] ) dnl
76
76
ac_success=no
77
- AC_CACHE_CHECK ( whether $CXX supports C++14 features by default ,
78
- ax_cv_cxx_compile_cxx14 ,
79
- [ AC_COMPILE_IFELSE ( [ AC_LANG_SOURCE ( [ _AX_CXX_COMPILE_STDCXX_14_testbody ] ) ] ,
80
- [ ax_cv_cxx_compile_cxx14 =yes] ,
81
- [ ax_cv_cxx_compile_cxx14 =no] ) ] )
82
- if test x$ax_cv_cxx_compile_cxx14 = xyes; then
77
+ AC_CACHE_CHECK ( whether $CXX supports C++17 features by default ,
78
+ ax_cv_cxx_compile_cxx17 ,
79
+ [ AC_COMPILE_IFELSE ( [ AC_LANG_SOURCE ( [ _AX_CXX_COMPILE_STDCXX_17_testbody ] ) ] ,
80
+ [ ax_cv_cxx_compile_cxx17 =yes] ,
81
+ [ ax_cv_cxx_compile_cxx17 =no] ) ] )
82
+ if test x$ax_cv_cxx_compile_cxx17 = xyes; then
83
83
ac_success=yes
84
84
fi
85
85
86
86
m4_if ( [ $1 ] , [ noext] , [ ] , [ dnl
87
87
if test x$ac_success = xno; then
88
- for switch in -std=gnu++14 -std=gnu++0x; do
89
- cachevar=AS_TR_SH ( [ ax_cv_cxx_compile_cxx14_ $switch] )
90
- AC_CACHE_CHECK ( whether $CXX supports C++14 features with $switch ,
88
+ for switch in -std=gnu++17 -std=gnu++0x; do
89
+ cachevar=AS_TR_SH ( [ ax_cv_cxx_compile_cxx17_ $switch] )
90
+ AC_CACHE_CHECK ( whether $CXX supports C++17 features with $switch ,
91
91
$cachevar ,
92
92
[ ac_save_CXXFLAGS="$CXXFLAGS"
93
93
CXXFLAGS="$CXXFLAGS $switch"
94
- AC_COMPILE_IFELSE ( [ AC_LANG_SOURCE ( [ _AX_CXX_COMPILE_STDCXX_14_testbody ] ) ] ,
94
+ AC_COMPILE_IFELSE ( [ AC_LANG_SOURCE ( [ _AX_CXX_COMPILE_STDCXX_17_testbody ] ) ] ,
95
95
[ eval $cachevar=yes] ,
96
96
[ eval $cachevar=no] )
97
97
CXXFLAGS="$ac_save_CXXFLAGS"] )
98
98
if eval test x\$$cachevar = xyes; then
99
99
CXXFLAGS="$CXXFLAGS $switch"
100
- CXX14_SWITCH ="$switch"
101
- AC_SUBST ( CXX14_SWITCH )
100
+ CXX17_SWITCH ="$switch"
101
+ AC_SUBST ( CXX17_SWITCH )
102
102
ac_success=yes
103
103
break
104
104
fi
@@ -107,40 +107,40 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX_14], [dnl
107
107
108
108
m4_if ( [ $1 ] , [ ext] , [ ] , [ dnl
109
109
if test x$ac_success = xno; then
110
- for switch in -std=c++14 -std=c++0x; do
111
- cachevar=AS_TR_SH ( [ ax_cv_cxx_compile_cxx14_ $switch] )
112
- AC_CACHE_CHECK ( whether $CXX supports C++14 features with $switch ,
110
+ for switch in -std=c++17 -std=c++0x; do
111
+ cachevar=AS_TR_SH ( [ ax_cv_cxx_compile_cxx17_ $switch] )
112
+ AC_CACHE_CHECK ( whether $CXX supports C++17 features with $switch ,
113
113
$cachevar ,
114
114
[ ac_save_CXXFLAGS="$CXXFLAGS"
115
115
CXXFLAGS="$CXXFLAGS $switch"
116
- AC_COMPILE_IFELSE ( [ AC_LANG_SOURCE ( [ _AX_CXX_COMPILE_STDCXX_14_testbody ] ) ] ,
116
+ AC_COMPILE_IFELSE ( [ AC_LANG_SOURCE ( [ _AX_CXX_COMPILE_STDCXX_17_testbody ] ) ] ,
117
117
[ eval $cachevar=yes] ,
118
118
[ eval $cachevar=no] )
119
119
CXXFLAGS="$ac_save_CXXFLAGS"] )
120
120
if eval test x\$$cachevar = xyes; then
121
121
CXXFLAGS="$CXXFLAGS $switch"
122
- CXX14_SWITCH ="$switch"
123
- AC_SUBST ( CXX14_SWITCH )
122
+ CXX17_SWITCH ="$switch"
123
+ AC_SUBST ( CXX17_SWITCH )
124
124
ac_success=yes
125
125
break
126
126
fi
127
127
done
128
128
fi] )
129
129
AC_LANG_POP ( [ C++] )
130
- if test x$ax_cxx_compile_cxx14_required = xtrue; then
130
+ if test x$ax_cxx_compile_cxx17_required = xtrue; then
131
131
if test x$ac_success = xno; then
132
- AC_MSG_ERROR ( [ *** A compiler with support for C++14 language features is required.] )
132
+ AC_MSG_ERROR ( [ *** A compiler with support for C++17 language features is required.] )
133
133
fi
134
134
else
135
135
if test x$ac_success = xno; then
136
- HAVE_CXX14 =0
137
- AC_MSG_NOTICE ( [ No compiler with C++14 support was found] )
136
+ HAVE_CXX17 =0
137
+ AC_MSG_NOTICE ( [ No compiler with C++17 support was found] )
138
138
else
139
- HAVE_CXX14 =1
140
- AC_DEFINE ( HAVE_CXX14 ,1 ,
141
- [ define if the compiler supports basic C++14 syntax] )
139
+ HAVE_CXX17 =1
140
+ AC_DEFINE ( HAVE_CXX17 ,1 ,
141
+ [ define if the compiler supports basic C++17 syntax] )
142
142
fi
143
143
144
- AC_SUBST ( HAVE_CXX14 )
144
+ AC_SUBST ( HAVE_CXX17 )
145
145
fi
146
146
] )
0 commit comments