2009-11-12 Jeffrey Stedfast <fejj@novell.com>
[moon.git] / m4 / unwind.m4
blob85ab3bb7cbb0a71cbce2c409cf2397bd140ff76c
1 AC_DEFUN([MOONLIGHT_CHECK_UNWIND],
3         AC_CHECK_HEADER(libunwind.h)
5         AC_MSG_CHECKING(for libunwind)
7         LDFLAGS_save="$LDFLAGS"
8         LIBS_save="$LIBS"
10         LDFLAGS="$LDFLAGS -liberty -lunwind"
11         LIBS="$LIBS -liberty -lunwind"
13         AC_CHECK_LIB(unwind, backtrace, have_unwind_libs="yes", have_unwind_libs="no")
15         LDFLAGS="$LDFLAGS_save"
16         LIBS="$LIBS_save"
18         if test "$have_unwind_libs" = "no"; then
19                 AC_MSG_RESULT([no])
20         else
21                 AC_MSG_RESULT([yes])
22                 if test "x$with_debug" = "xyes"; then
23                         UNWIND_LIBS="-liberty -lunwind"
24                         AC_DEFINE([HAVE_UNWIND], [1], [libunwind support])
25                 fi
26         fi