diff options
author | Chris Wilson <chris+github@qwirx.com> | 2011-02-27 23:33:01 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2011-02-27 23:33:01 +0000 |
commit | bf8af0417b007ed0206b9c9835ea6a1a02c618fe (patch) | |
tree | 46eae615c83f32f86b28a8aff23f779833a1cadd /configure.ac | |
parent | 6f45f9cc539bd5e7edd4aa62bda12a843b5ceb1c (diff) |
Fix build on solaris/gcc by checking whether -rdynamic is supported or not.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index 63a94ccc..9f970d1f 100644 --- a/configure.ac +++ b/configure.ac @@ -26,11 +26,18 @@ if test "x$GXX" = "xyes"; then # Use -Wall if we have gcc. This gives better warnings AC_SUBST([CXXFLAGS_STRICT], ['-Wall -Wundef']) - # Use -rdynamic if we have gcc, but not mingw. This is needed for backtrace - case $target_os in - mingw*) ;; - *) AC_SUBST([LDADD_RDYNAMIC], ['-rdynamic']) ;; - esac + # Check whether gcc supports -rdynamic, thanks to Steve Ellcey + # [http://readlist.com/lists/gcc.gnu.org/gcc/6/31502.html] + # This is needed to get symbols in backtraces. + # Note that this apparently fails on HP-UX + LDFLAGS="$LDFLAGS -rdynamic" + AC_MSG_CHECKING([whether gcc accepts -rdynamic]) + AC_TRY_LINK([], [return 0;], + [AC_MSG_RESULT([yes]); have_rdynamic=yes], + [AC_MSG_RESULT([no])]) + if test x"$have_rdynamic" = x"yes" ; then + AC_SUBST([LDADD_RDYNAMIC], ['-rdynamic']) + fi fi AC_PATH_PROG([PERL], [perl], [AC_MSG_ERROR([[perl executable was not found]])]) |