ax_cxx_compile_stdcxx

Synopsis

AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional])

Description

Check for baseline language coverage in the compiler for the specified version of the C++ standard. If necessary, add switches to CXX and CXXCPP to enable support. VERSION may be ’11’, ’14’, ’17’, ’20’, or ’23’ for the respective C++ standard version.

The second argument, if specified, indicates whether you insist on an extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. -std=c++11). If neither is specified, you get whatever works, with preference for no added switch, and then for an extended mode.

The third argument, if specified ’mandatory’ or if left unspecified, indicates that baseline support for the specified C++ standard is required and that the macro should error out if no mode with that support is found. If specified ’optional’, then configuration proceeds regardless, after defining HAVE_CXX${VERSION} if and only if a supporting mode is found.

Source Code

Download the latest version of ax_cxx_compile_stdcxx.m4 or browse the macro’s revision history.

License

Copyright © 2008 Benjamin Kosnik 
Copyright © 2012 Zack Weinberg 
Copyright © 2013 Roy Stogner 
Copyright © 2014, 2015 Google Inc.; contributed by Alexey Sokolov 
Copyright © 2015 Paul Norman 
Copyright © 2015 Moritz Klammler 
Copyright © 2016, 2018 Krzesimir Nowak 
Copyright © 2019 Enji Cooper 
Copyright © 2020 Jason Merrill 
Copyright © 2021 Jörn Heusipp 
Copyright © 2015, 2022, 2023, 2024 Olly Betts

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.