From: wolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Date: Thu, 7 Jul 2005 18:16:53 +0000 (+0000)
Subject: Check whether we can link with -rdynamic.
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a70509cdce915f18cdbd130c2e73f0137346887b;p=dealii-svn.git

Check whether we can link with -rdynamic.


git-svn-id: https://svn.dealii.org/trunk@11099 0785d39b-7218-0410-832d-ea1e28bc413d
---

diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4
index 972d6dd30e..daea901439 100644
--- a/deal.II/aclocal.m4
+++ b/deal.II/aclocal.m4
@@ -4002,7 +4002,10 @@ void f (const std::ostream &out);
 
 dnl -------------------------------------------------------------
 dnl Check whether glibc-like stacktrace information is available
-dnl for the Exception class
+dnl for the Exception class. If it is, then try to also determine
+dnl whether the compiler accepts the -rdynamic flag, since that is
+dnl recommended for linking if one wants to have meaningful
+dnl backtraces.
 dnl
 dnl Usage: DEAL_II_HAVE_GLIBC_STACKTRACE
 dnl
@@ -4028,6 +4031,20 @@ AC_DEFUN(DEAL_II_HAVE_GLIBC_STACKTRACE, dnl
                 [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])
+
+      AC_MSG_CHECKING(whether compiler accepts -rdynamic)
+
+      CXXFLAGS="$CXXFLAGSG -rdynamic"
+      AC_TRY_LINK(
+        [],
+        [;],
+        [
+          AC_MSG_RESULT(yes)
+          LDFLAGS="$LDFLAGS -rdynamic"
+        ],
+        [
+          AC_MSG_RESULT(no)
+        ])
     ],
     [
       AC_MSG_RESULT(no)