[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_GLIBC_STACKTRACE, 1,
- [Define if deal.II is linked against the GNU C library,
- which provides stacktrace debug information that can be
+ [Define if deal.II is linked against a libc that
+ provides stacktrace debug information that can be
printed out in the exception class])
AC_MSG_CHECKING(whether compiler accepts -rdynamic)
])
+
+dnl -------------------------------------------------------------
+dnl Check whether the compiler offers a way to demangle symbols
+dnl from within the program. Used inside the exception stacktrace
+dnl mechanism.
+dnl
+dnl The example code is taken from
+dnl http://gcc.gnu.org/onlinedocs/libstdc++/18_support/howto.html#6
+dnl
+dnl Usage: DEAL_II_HAVE_DEMANGLER
+dnl
+dnl -------------------------------------------------------------
+AC_DEFUN(DEAL_II_HAVE_DEMANGLER, dnl
+[
+ AC_MSG_CHECKING(for libstdc++ demangler)
+ AC_LANG(C++)
+ CXXFLAGS="$CXXFLAGSG"
+ AC_TRY_LINK(
+ [
+#include <exception>
+#include <iostream>
+#include <cxxabi.h>
+
+struct empty { };
+
+template <typename T, int N>
+ struct bar { };
+ ],
+ [
+ int status;
+ char *realname;
+
+ // exception classes not in <stdexcept>, thrown by the implementation
+ // instead of the user
+ std::bad_exception e;
+ realname = abi::__cxa_demangle(e.what(), 0, 0, &status);
+ std::cout << e.what() << "\t=> " << realname << "\t: " << status << '\n';
+ free(realname);
+
+
+ // typeid
+ bar<empty,17> u;
+ const std::type_info &ti = typeid(u);
+
+ realname = abi::__cxa_demangle(ti.name(), 0, 0, &status);
+ std::cout << ti.name() << "\t=> " << realname << "\t: " << status << '\n';
+ free(realname);
+
+ return 0;
+ ],
+ [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_LIBSTDCXX_DEMANGLER, 1,
+ [Define if the std c++ library provides a demangler conforming
+ to the GCC libstdc++ interface.])
+ ],
+ [
+ AC_MSG_RESULT(no)
+ ])
+])
+
+
dnl -------------------------------------------------------------
dnl On some Cygwin systems, a system header file includes this
dnl preprocessor define:
/* Define to 1 if you have the `gethostname' function. */
#undef HAVE_GETHOSTNAME
-/* Define if deal.II is linked against the GNU C library, which provides
- stacktrace debug information that can be printed out in the exception class
- */
+/* Define if deal.II is linked against a libc that provides stacktrace debug
+ information that can be printed out in the exception class */
#undef HAVE_GLIBC_STACKTRACE
/* Availability of the MA27 algorithm from HSL */
/* Define to 1 if you have the `lapack' library (-llapack). */
#undef HAVE_LIBLAPACK
+/* Define if the std c++ library provides a demangler conforming to the GCC
+ libstdc++ interface. */
+#undef HAVE_LIBSTDCXX_DEMANGLER
+
/* Define to 1 if you have the `umfpack' library (-lumfpack). */
#undef HAVE_LIBUMFPACK
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: checking for libstdc++ demangler" >&5
+echo $ECHO_N "checking for libstdc++ demangler... $ECHO_C" >&6
+ ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ CXXFLAGS="$CXXFLAGSG"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#include <exception>
+#include <iostream>
+#include <cxxabi.h>
+
+struct empty { };
+
+template <typename T, int N>
+ struct bar { };
+
+int
+main ()
+{
+
+ int status;
+ char *realname;
+
+ // exception classes not in <stdexcept>, thrown by the implementation
+ // instead of the user
+ std::bad_exception e;
+ realname = abi::__cxa_demangle(e.what(), 0, 0, &status);
+ std::cout << e.what() << "\t=> " << realname << "\t: " << status << '\n';
+ free(realname);
+
+
+ // typeid
+ bar<empty,17> u;
+ const std::type_info &ti = typeid(u);
+
+ realname = abi::__cxa_demangle(ti.name(), 0, 0, &status);
+ std::cout << ti.name() << "\t=> " << realname << "\t: " << status << '\n';
+ free(realname);
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBSTDCXX_DEMANGLER 1
+_ACEOF
+
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+
ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
DEAL_II_HAVE_BUILTIN_EXPECT
DEAL_II_HAVE_VERBOSE_TERMINATE
DEAL_II_HAVE_GLIBC_STACKTRACE
+DEAL_II_HAVE_DEMANGLER
DEAL_II_CHECK_MIN_VECTOR_CAPACITY
DEAL_II_CHECK_ABORT
DEAL_II_CHECK_GETRUSAGE