configure: use feature detection for -rdynamic

Fixes the Cygwin build, works on OS X.

Work on #170.
This commit is contained in:
David Adam 2015-06-20 21:33:36 +08:00
parent 7d94b7fd1b
commit 8db162e048

View file

@ -210,9 +210,18 @@ CXXFLAGS="$CXXFLAGS -Wall -Wno-sign-compare"
# This is needed in order to get the really cool backtraces on Linux
#
if test `uname` != "Darwin"; then
LDFLAGS_FISH="$LDFLAGS_FISH -rdynamic"
fi
AC_MSG_CHECKING([for -rdynamic linker flag])
prev_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -rdynamic"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
[
AC_MSG_RESULT([yes])
LDFLAGS_FISH="$LDFLAGS_FISH -rdynamic"
], [
AC_MSG_RESULT([no])
LDFLAGS_FISH="$LDFLAGS_FISH"
])
LDFLAGS="$prev_LDFLAGS"
#
# On Cygwin, we need to add some flags for ncurses.