changeset 33160:4584cb4207f1

build: Require a C++ compiler that is compliant with C++17. * configure.ac: Unconditionally require a C++ compiler that is compliant with C++17. * m4/acinclude.m4 (OCTAVE_CHECK_QT_VERSION): Remove test that is no longer needed. * etc/NEWS.10.md: Add note about new requirement.
author Markus Mützel <markus.muetzel@gmx.de>
date Sun, 03 Mar 2024 11:16:26 +0100
parents 2ac3523783ee
children e86c59dac135
files configure.ac etc/NEWS.10.md m4/acinclude.m4
diffstat 3 files changed, 11 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Wed Mar 06 19:40:07 2024 +0100
+++ b/configure.ac	Sun Mar 03 11:16:26 2024 +0100
@@ -313,10 +313,14 @@
 AC_PROG_CXX
 AC_PROG_CXXCPP
 
-ENABLE_STD_PMR_POLYMORPHIC_ALLOCATOR=yes
+## Ensure that the C++ compiler fully supports C++17.
+## Preferably with GNU extensions if flags are required.
+AX_CXX_COMPILE_STDCXX(17, [], mandatory)
+
+ENABLE_STD_PMR_POLYMORPHIC_ALLOCATOR=no
 AC_ARG_ENABLE(std-pmr-polymorphic-allocator,
   [AS_HELP_STRING([--disable-std-pmr-polymorphic-allocator],
-    [build libraries that do not require support for std::pmr::polymorphic_allocator.  This prevents more efficient transfer of arrays at the .mex file interface.  With enabled std::pmr::polymorphic_allocator, sources including Octave headers (e.g., for .oct files) must conform to C++17.])],
+    [build libraries that do not require support for std::pmr::polymorphic_allocator.  This prevents more efficient transfer of arrays at the .mex file interface.])],
   [case $enableval in
      yes) ENABLE_STD_PMR_POLYMORPHIC_ALLOCATOR=yes ;;
      no) ENABLE_STD_PMR_POLYMORPHIC_ALLOCATOR=no ;;
@@ -340,34 +344,6 @@
 
 ### Determine C++ compiler capabilities.
 
-if test "$QT_VERSIONS" = 6; then
-  ## If QT_VERSIONS is set to 6, require that the C++ compiler fully
-  ## supports C++17.  Preferably with GNU extensions if flags are required.
-  ## We could use "AX_CXX_COMPILE_STDCXX(17, [], mandatory)" in this case.
-  ## But prefer to emit a more helpful error message.
-  AX_CXX_COMPILE_STDCXX(17, [], [])
-  if test "$HAVE_CXX17" = 0; then
-    ## The user explicitly requested Qt6.  But the C++ compiler lacks
-    ## support for C++17.
-    AC_MSG_ERROR([Qt6 requires a compiler that supports C++17.  Configure with "--with-qt=5" or "--without-qt", or use a compiler that supports C++17.])
-  fi
-elif test -z "${QT_VERSIONS+x}" || test $ENABLE_STD_PMR_POLYMORPHIC_ALLOCATOR = yes; then
-  ## If QT_VERSIONS is not explicitly set, check if the C++ compiler fully
-  ## supports C++17 (but don't require it).
-  ## The defaults for the Qt version will depend on the result of this check.
-  AX_CXX_COMPILE_STDCXX(17, [], [])
-else
-  ## Set HAVE_CXX17 to 0 because we don't require it (even if the used
-  ## C++ compiler might technically support C++17).
-  HAVE_CXX17=0
-fi
-
-if test "$HAVE_CXX17" = 0; then
-  ## Ensure that the C++ compiler fully supports C++11.
-  ## Preferably with GNU extensions if flags are required.
-  AX_CXX_COMPILE_STDCXX(11, [], mandatory)
-fi
-
 if test $ENABLE_STD_PMR_POLYMORPHIC_ALLOCATOR = yes; then
   OCTAVE_CHECK_STD_PMR_POLYMORPHIC_ALLOCATOR
 fi
--- a/etc/NEWS.10.md	Wed Mar 06 19:40:07 2024 +0100
+++ b/etc/NEWS.10.md	Sun Mar 03 11:16:26 2024 +0100
@@ -88,6 +88,11 @@
         shift                  | circshift
         sparse_auto_mutate     | none (see below)
 
+### Build system
+
+- Octave now requires a C++ compiler that is compliant with C++17 (preferably
+with GNU extensions).
+
 
 Summary of bugs fixed for version 10.1.0 (yyyy-mm-dd):
 ----------------------------------------------------
--- a/m4/acinclude.m4	Wed Mar 06 19:40:07 2024 +0100
+++ b/m4/acinclude.m4	Sun Mar 03 11:16:26 2024 +0100
@@ -1999,15 +1999,6 @@
   warn_qt_abstract_item_model=""
   warn_qt_opengl=""
 
-  if test $build_qt_gui = yes && test "$qt_version" -eq 6; then
-    ## Ensure that the C++ compiler fully supports C++17.
-    ## Preferably with GNU extensions if flags are required.
-    if test $HAVE_CXX17 -eq 0; then
-      build_qt_gui=no
-      warn_qt_cxx17="compiler doesn't support C++17; disabling Qt GUI"
-    fi
-  fi
-
   if test $build_qt_gui = yes; then
     ## Check for Qt libraries
     case "$qt_version" in