summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Notzli <andres.noetzli@gmail.com>2017-04-19 08:46:59 -0700
committerAndres Notzli <andres.noetzli@gmail.com>2017-04-19 08:46:59 -0700
commit6cfbc6cace749c6196e2dec59b651ac5173f8ab7 (patch)
tree4db76b2e101d482feb8f93e7d9ead7c2b771fbd0
parent98f12f90488949fd0367697fb684e94938e0b62b (diff)
Add check for C++ exceptions to config scriptcheck_exceptions
Bug 687 was caused by the configuration not properly supporting C++ exceptions. To avoid such an incidence in the future, this commit adds a simple check to `configure.ac` (when not cross compiling).
-rw-r--r--configure.ac21
1 files changed, 21 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index d2c08661b..7da86d8a8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -253,6 +253,27 @@ AC_PROG_INSTALL
CVC4_GCC_VERSION
+if test $cross_compiling = "no"; then
+ AC_MSG_CHECKING([whether C++ exceptions work])
+ AC_LANG_PUSH([C++])
+ AC_RUN_IFELSE(
+ AC_LANG_PROGRAM([#include <exception>], [[
+ int result = 1;
+ try {
+ throw std::exception();
+ } catch (...) {
+ result = 0;
+ }
+ return result;
+ ]]),
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_ERROR([C++ exceptions do not work.])]
+ )
+ AC_LANG_POP([C++])
+else
+ AC_MSG_WARN([Cross compiling, cannot check whether exceptions work])
+fi
+
cvc4_use_gmp=2
cvc4_use_cln=2
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback