diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index f86ce4c8a3..68e44661ef 100644 --- a/configure.ac +++ b/configure.ac @@ -1221,15 +1221,46 @@ AC_DEFINE_UNQUOTED([RTS_LINKER_USE_MMAP], [$RtsLinkerUseMmap], dnl ** Have libdw? dnl -------------------------------------------------------------- +AC_ARG_WITH([libdw-libraries], + [AC_HELP_STRING([--with-libdw-libraries=ARG], + [Find libraries for libdw in ARG [default=system default]]) + ], + [ + LibdwLibDir="$withval" + LIBDW_LDFLAGS="-L$withval" + ]) + +AC_SUBST(LibdwLibDir) + +AC_ARG_WITH([libdw-includes], + [AC_HELP_STRING([--with-libdw-includes=ARG], + [Find includes for libdw in ARG [default=system default]]) + ], + [ + LibdwIncludeDir="$withval" + LIBDW_CFLAGS="-I$withval" + ]) + +AC_SUBST(LibdwIncludeDir) + UseLibdw=NO USE_LIBDW=0 AC_ARG_ENABLE(dwarf-unwind, [AC_HELP_STRING([--enable-dwarf-unwind], [Enable DWARF unwinding support in the runtime system via elfutils' libdw [default=no]])]) if test "$enable_dwarf_unwind" = "yes" ; then + CFLAGS2="$CFLAGS" + CFLAGS="$LIBDW_CFLAGS $CFLAGS" + LDFLAGS2="$LDFLAGS" + LDFLAGS="$LIBDW_LDFLAGS $LDFLAGS" + AC_CHECK_LIB(dw, dwfl_attach_state, - [UseLibdw=YES], + [AC_CHECK_HEADERS([elfutils/libdw.h], [break], []) + UseLibdw=YES], [AC_MSG_ERROR([Cannot find system libdw (required by --enable-dwarf-unwind)])]) + + CFLAGS="$CFLAGS2" + LDFLAGS="$LDFLAGS2" fi AC_SUBST(UseLibdw) |