# HG changeset patch # User Markus Mützel # Date 1639932491 -3600 # Node ID 9b41aba64c12cc9d9af5ad5a1efec9f98b69bd0e # Parent 84344af9b0199398e64e10ba8968f6f56ad4d988 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. diff -r 84344af9b019 -r 9b41aba64c12 configure.ac --- 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.