asterisk/autoconf
George Joseph 62ec48cf1c Add C++ Standard detection to configure and fix a new C++20 compile issue
* The autoconf-archive package contains macros useful for detecting C++
  standard and testing other C++ capabilities but that package was never
  included in the install_prereq script so many existing build environments
  won't have it.  Even if it is installed, older versions won't newer C++
  standards and will actually cause an error if you try to test for that
  version. To make it available for those environments, the
  ax_cxx_compile_stdcxx.m4 macro has copied from the latest release of
  autoconf-archive into the autoconf directory.

* A convenience wrapper(ast_cxx_check_std) around ax_cxx_compile_stdcxx was
  also added so checking the standard version and setting the
  asterisk-specific PBX_ variables becomes a one-liner:
  `AST_CXX_CHECK_STD([std], [force_latest_std])`.
  Calling that with a version of `17` for instance, will set PBX_CXX17
  to 0 or 1 depending on whether the current c++ compiler supports stdc++17.
  HAVE_CXX17 will also be 'defined" or not depending on the result.

* C++ compilers hardly ever default to the latest standard they support.  g++
  version 14 for instance supports up to C++23 but only uses C++17 by default.
  If you want to use C++23, you have to add `-std=gnu++=23` to the g++
  command line.  If you set the second argument of AST_CXX_CHECK_STD to "yes",
  the macro will automatically keep the highest `-std=gnu++` value that
  worked and pass that to the Makefiles.

* The autoconf-archive package was added to install_prereq for future use.

* Updated configure.ac to use AST_CXX_CHECK_STD() to check for C++
  versions 11, 14, 17, 20 and 23.

* Updated configure.ac to accept the `--enable-latest-cxx-std` option which
  will set the second option to AST_CXX_CHECK_STD() to "yes".  The default
  is "no".

* ast_copy_string() in strings.h declares the 'sz' variable as volatile and
  does an `sz--` on it later.  C++20 no longer allows the `++` and `--`
  increment and decrement operators to be used on variables declared as
  volatile however so that was changed to `sz -= 1`.
2025-01-06 19:08:23 +00:00
..
ast_c_compile_check.m4 Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
ast_c_declare_check.m4 Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
ast_c_define_check.m4 Remove as much trailing whitespace as possible. 2017-12-22 09:23:22 -05:00
ast_check_gnu_make.m4 Merged revisions 180941 via svnmerge from 2009-03-10 22:03:41 +00:00
ast_check_mandatory.m4 Merged revisions 151240 via svnmerge from 2008-10-20 04:59:04 +00:00
ast_check_raii.m4 BuildSystem: Enable ./configure in Solaris 11. 2018-06-21 11:59:35 +02:00
ast_check_strsep_array_bounds.m4 Update configure.ac/Makefile for clang 2015-05-03 10:05:07 -05:00
ast_cxx_check_std.m4 Add C++ Standard detection to configure and fix a new C++20 compile issue 2025-01-06 19:08:23 +00:00
ast_ext_lib.m4 configure.ac: Check for unbound version >= 1.5 2018-09-25 13:30:09 -06:00
ast_ext_tool_check.m4 Build System: Strip '-std=c99' from CFLAGS provided by libraries. 2018-04-04 11:04:46 -04:00
ast_func_fork.m4 Merged revisions 277738 via svnmerge from 2010-07-17 17:42:32 +00:00
ast_gcc_attribute.m4 autoconf: Remove use of m4_ifblank. 2017-12-02 16:59:31 -05:00
ast_pkgconfig.m4 ast_pkgconfig.m4: AST_PKG_CONFIG_CHECK() relies on sed. 2022-05-22 16:35:46 -05:00
ast_prog_egrep.m4 Merged revisions 151240 via svnmerge from 2008-10-20 04:59:04 +00:00
ast_prog_ld.m4 BuildSystem: Avoid obsolete warning with HELP_STRING on autoconf. 2016-06-21 15:08:06 +02:00
ast_prog_ld_gnu.m4 Merged revisions 151240 via svnmerge from 2008-10-20 04:59:04 +00:00
ast_prog_sed.m4 Merged revisions 180941 via svnmerge from 2009-03-10 22:03:41 +00:00
ax_cxx_compile_stdcxx.m4 Add C++ Standard detection to configure and fix a new C++20 compile issue 2025-01-06 19:08:23 +00:00
ax_pthread.m4 configure: Remove obsolete and deprecated constructs. 2023-06-12 17:19:58 +00:00
libcurl.m4 Fix declaration of PBX_CURL for ./configure --without-libcurl 2018-07-13 23:44:53 -04:00