changeset 30512:9b41aba64c12 stable

build: Enable use of std::pmr::polymorphic_allocator optionally only (bug #61472). * configure.ac: Add new configure option "--enable-std-pmr-polymorphic-allocator" which is set to "no" by default.
author Markus Mützel <markus.muetzel@gmx.de>
date Sun, 19 Dec 2021 17:48:11 +0100
parents 84344af9b019
children 772e8f8e9054 c8eb0f15fc5c
files configure.ac
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Sun Dec 19 14:36:18 2021 +0100
+++ b/configure.ac	Sun Dec 19 17:48:11 2021 +0100
@@ -400,7 +400,19 @@
   OCTAVE_CONFIGURE_WARNING([warn_stl_algo_h])
 fi
 
-OCTAVE_CHECK_STD_PMR_POLYMORPHIC_ALLOCATOR
+ENABLE_STD_PMR_POLYMORPHIC_ALLOCATOR=no
+AC_ARG_ENABLE(std-pmr-polymorphic-allocator,
+  [AS_HELP_STRING([--enable-std-pmr-polymorphic-allocator],
+    [build libraries requiring std::pmr::polymorphic_allocator if possible. This allows more efficient transfer of arrays at the .mex file interface. That also means that all libraries including Octave headers (e.g., .oct files) must be able to compile with that C++17 feature.])],
+  [case $enableval in
+     yes) ENABLE_STD_PMR_POLYMORPHIC_ALLOCATOR=yes ;;
+     no) ENABLE_STD_PMR_POLYMORPHIC_ALLOCATOR=no ;;
+     *) AC_MSG_ERROR([bad value $enableval for --enable-std-pmr-polymorphic-allocator]) ;;
+   esac])
+
+if test $ENABLE_STD_PMR_POLYMORPHIC_ALLOCATOR = yes; then
+  OCTAVE_CHECK_STD_PMR_POLYMORPHIC_ALLOCATOR
+fi
 
 ### Check version number when using gcc.
 dnl It might be different from the g++ version number.