Skip to content

Commit 082ed11

Browse files
committed
Make sure earlier HAVE_CXX* values get set too
Just because we have e.g. C++14 support doesn't mean we *lack* C++11 support.
1 parent ac4423d commit 082ed11

File tree

1 file changed

+15
-36
lines changed

1 file changed

+15
-36
lines changed

acsm_cxx_compiler_standard.m4

+15-36
Original file line numberDiff line numberDiff line change
@@ -94,73 +94,52 @@ AS_IF([test "$acsm_CXX_STD_MAX" -ge "$acsm_CXX_STD_MIN"],
9494
acsm_found_cxx=0
9595
acsm_cxx_version=0
9696
97-
AS_IF([test "$acsm_found_cxx" = "0"],
98-
[
97+
dnl We test for every standard in our range, so that later standards
98+
dnl still "count" as earlier standards too.
9999
AS_IF([test 2017 -le "$acsm_CXX_STD_MAX"],
100100
[
101101
AS_IF([test 2017 -gt "$acsm_CXX_STD_MIN"],
102102
[AX_CXX_COMPILE_STDCXX([17],[$3],[optional])],
103-
[AS_IF([test 2017 -eq "$acsm_CXX_STD_MIN"],
104-
[AX_CXX_COMPILE_STDCXX([17],[$3],[mandatory])])])
103+
[AX_CXX_COMPILE_STDCXX([17],[$3],[mandatory])])
105104
AS_IF([test "$HAVE_CXX17" = "1"],
106105
[
107106
AC_MSG_NOTICE([Found C++17 standard support])
108-
109-
dnl For our purposes C++17 includes C++11 and C++14; there
110-
dnl are more people relying on e.g. HAVE_CXX11 than there
111-
dnl are relying on C++11 standards that have been removed
112-
dnl from C++17
113-
HAVE_CXX14=1
114-
HAVE_CXX11=1
115-
AC_SUBST(HAVE_CXX14)
116-
AC_SUBST(HAVE_CXX11)
117-
acsm_found_cxx=1
118-
acsm_cxx_version=17],
107+
AS_IF([test $acsm_found_cxx -eq 0],
108+
[acsm_cxx_version=17])
109+
acsm_found_cxx=1],
119110
[AS_IF([test "$HAVE_CXX17" = "0"],
120111
[AC_MSG_NOTICE([Did not find C++17 standard support])])])
121112
])
122-
])
123113
124-
AS_IF([test "$acsm_found_cxx" = "0"],
125-
[
126114
AS_IF([test 2014 -le "$acsm_CXX_STD_MAX"],
127115
[
128116
AS_IF([test 2014 -gt "$acsm_CXX_STD_MIN"],
129117
[AX_CXX_COMPILE_STDCXX([14],[$3],[optional])],
130-
[AS_IF([test 2014 -eq "$acsm_CXX_STD_MIN"],
131-
[AX_CXX_COMPILE_STDCXX([14],[$3],[mandatory])])])
118+
[AX_CXX_COMPILE_STDCXX([14],[$3],[mandatory])])
132119
AS_IF([test "$HAVE_CXX14" = "1"],
133120
[
134121
AC_MSG_NOTICE([Found C++14 standard support])
135-
136-
dnl For our purposes C++14 includes C++11; there
137-
dnl are people relying on HAVE_CXX11
138-
HAVE_CXX11=1
139-
AC_SUBST(HAVE_CXX11)
140-
acsm_found_cxx=1
141-
acsm_cxx_version=14],
122+
AS_IF([test $acsm_found_cxx -eq 0],
123+
[acsm_cxx_version=14])
124+
acsm_found_cxx=1],
142125
[AS_IF([test "$HAVE_CXX14" = "0"],
143126
[AC_MSG_NOTICE([Did not find C++14 standard support])])])
144127
])
145-
])
146128
147-
AS_IF([test "$acsm_found_cxx" = "0"],
148-
[
149129
AS_IF([test 2011 -le "$acsm_CXX_STD_MAX"],
150130
[
151-
AS_IF([test 2011 -ge "$acsm_CXX_STD_MIN"],
131+
AS_IF([test 2011 -gt "$acsm_CXX_STD_MIN"],
152132
[AX_CXX_COMPILE_STDCXX([11],[$3],[optional])],
153-
[AS_IF([test 2011 -eq "$acsm_CXX_STD_MIN"],
154-
[AX_CXX_COMPILE_STDCXX([11],[$3],[mandatory])])])
133+
[AX_CXX_COMPILE_STDCXX([11],[$3],[mandatory])])
155134
AS_IF([test "$HAVE_CXX11" = "1"],
156135
[
157136
AC_MSG_NOTICE([Found C++11 standard support])
158-
acsm_found_cxx=1
159-
acsm_cxx_version=11],
137+
AS_IF([test $acsm_found_cxx -eq 0],
138+
[acsm_cxx_version=11])
139+
acsm_found_cxx=1],
160140
[AS_IF([test "$HAVE_CXX11" = "0"],
161141
[AC_MSG_NOTICE([Did not find C++11 standard support])])])
162142
])
163-
])
164143
165144
AS_IF([test "$acsm_found_cxx" = "1"],
166145
[AC_MSG_NOTICE([Using support for C++$acsm_cxx_version standard])],

0 commit comments

Comments
 (0)