diff options
author | Ben Gamari <ben@smart-cactus.org> | 2019-09-26 16:06:28 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-11-06 08:05:57 -0500 |
commit | ce9e2a1a9307bf43ead278dd1fc8db4325d82340 (patch) | |
tree | bd134ac511b2d20755290d9b63505cffeb2a9518 /configure.ac | |
parent | 3ce18700f80a12c48a029b49c6201ad2410071bb (diff) | |
download | haskell-ce9e2a1a9307bf43ead278dd1fc8db4325d82340.tar.gz |
configure: Add --with-libdw-{includes,libraries} flags
Fixing #17255.
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) |