aboutsummaryrefslogtreecommitdiffstats
path: root/testing/libtorrent-rasterbar/cxx14.patch
diff options
context:
space:
mode:
Diffstat (limited to 'testing/libtorrent-rasterbar/cxx14.patch')
-rw-r--r--testing/libtorrent-rasterbar/cxx14.patch74
1 files changed, 74 insertions, 0 deletions
diff --git a/testing/libtorrent-rasterbar/cxx14.patch b/testing/libtorrent-rasterbar/cxx14.patch
new file mode 100644
index 0000000000..49a6633805
--- /dev/null
+++ b/testing/libtorrent-rasterbar/cxx14.patch
@@ -0,0 +1,74 @@
+From 3276484d3310e69d032602634afbc1b126112d2d Mon Sep 17 00:00:00 2001
+From: Nam Nguyen <namn@berkeley.edu>
+Date: Thu, 14 Jan 2021 21:27:14 +0000
+Subject: [PATCH] add --with-cxx-standard=14 configure switch C++ standard is
+ specified by 11, 14 or 17. Either AX_CXX_COMPILE_STDCXX_11 or
+ AX_CXX_COMPILE_STDCXX are called appropriately.
+
+---
+ configure.ac | 45 ++++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 44 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0b9b0c446b..3fa925b1fa 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -144,7 +144,49 @@ AS_ECHO "Checking for boost libraries:"
+
+ AX_BOOST_BASE([1.58])
+
+-AX_CXX_COMPILE_STDCXX_11([noext], [mandatory])
++AC_ARG_WITH(
++ [cxx-standard],
++ [AS_HELP_STRING(
++ [--with-cxx-standard[=ARG]],
++ [specify C++ standard (e.g., 11, 14 or 17) [default=11]])],
++ [[ARG_CXX_STANDARD=$withval]],
++ [[ARG_CXX_STANDARD=default]]
++)
++
++AC_MSG_CHECKING([which c++ standard to use])
++if test "x${ARG_CXX_STANDARD}" = "x17" ; then
++ AX_CXX_COMPILE_STDCXX(17, [noext], [mandatory])
++elif test "x${ARG_CXX_STANDARD}" = "x14" ; then
++ AX_CXX_COMPILE_STDCXX(14, [noext], [mandatory])
++elif test "x${ARG_CXX_STANDARD}" = "x11" ; then
++ AX_CXX_COMPILE_STDCXX_11([noext], [mandatory])
++elif test "x${ARG_CXX_STANDARD}" != "xdefault" -a "${ARG_CXX_STANDARD}" -lt "11" ; then
++ dnl force 11 if user specified out of bounds, regardless of compiler default
++ ARG_CXX_STANDARD="11"
++ AX_CXX_COMPILE_STDCXX_11([noext], [mandatory])
++elif test "x${ARG_CXX_STANDARD}" != "xdefault" -a "${ARG_CXX_STANDARD}" -gt "17" ; then
++ dnl force 11 if user specified out of bounds, regardless of compiler default
++ ARG_CXX_STANDARD="11"
++ AX_CXX_COMPILE_STDCXX_11([noext], [mandatory])
++else
++ dnl nothing specified so use compiler default
++
++ echo '#include <iostream>' > cpp_standard.cpp
++ echo 'using std::cout; using std::endl; int main() { switch (__cplusplus) { case 201103L: cout << 11 << endl; break; case 201402L: cout << 14 << endl; break; case 201703L: cout << 17 << endl; break; default: cout << 1 << endl; } }' >> cpp_standard.cpp
++ ${CXX} cpp_standard.cpp -o cpp_standard
++ DEFAULT_CXX_STANDARD=`./cpp_standard`
++ echo $DEFAULT_CXX_STANDARD
++ if test "x${DEFAULT_CXX_STANDARD}" = "x17" ; then
++ ARG_CXX_STANDARD="17"
++ AX_CXX_COMPILE_STDCXX(17, [noext], [mandatory])
++ elif test "x${DEFAULT_CXX_STANDARD}" = "x14" ; then
++ ARG_CXX_STANDARD="14"
++ AX_CXX_COMPILE_STDCXX(14, [noext], [mandatory])
++ else
++ ARG_CXX_STANDARD="11"
++ AX_CXX_COMPILE_STDCXX_11([noext], [mandatory])
++ fi
++fi
+
+ AX_BOOST_SYSTEM()
+ AS_IF([test -z "$BOOST_SYSTEM_LIB"],
+@@ -590,6 +632,7 @@ Build options:
+ debug build: ${ARG_ENABLE_DEBUG:-no}
+ invariant checks: ${ARG_ENABLE_INVARIANT:-no}
+ logging support: ${ARG_ENABLE_LOGGING:-yes}
++ cxx standard: ${ARG_CXX_STANDARD:-default}
+
+ Features:
+ encryption support: ${ARG_ENABLE_ENCRYPTION:-yes}