2 # --------------------------------------------------------------
3 # Should we used libdw? (yes, no, or auto.)
7 # - LibdwLibDir: optional path
8 # - LibdwIncludeDir: optional path
9 AC_DEFUN([FP_FIND_LIBDW],
11 AC_ARG_WITH([libdw-libraries],
12 [AS_HELP_STRING([--with-libdw-libraries=ARG],
13 [Find libraries for libdw in ARG [default=system default]])
16 LibdwLibDir="$withval"
17 LIBDW_LDFLAGS="-L$withval"
20 AC_ARG_WITH([libdw-includes],
21 [AS_HELP_STRING([--with-libdw-includes=ARG],
22 [Find includes for libdw in ARG [default=system default]])
25 LibdwIncludeDir="$withval"
26 LIBDW_CFLAGS="-I$withval"
29 AC_ARG_ENABLE(dwarf-unwind,
30 [AS_HELP_STRING([--enable-dwarf-unwind],
31 [Enable DWARF unwinding support in the runtime system via elfutils' libdw [default=no]])],
33 [enable_dwarf_unwind=no])
36 if test "$enable_dwarf_unwind" != "no" ; then
38 CFLAGS="$LIBDW_CFLAGS $CFLAGS"
40 LDFLAGS="$LIBDW_LDFLAGS $LDFLAGS"
42 AC_CHECK_HEADER([elfutils/libdwfl.h],
43 [AC_CHECK_LIB(dw, dwfl_attach_state,
46 if test "x:$enable_dwarf_unwind:$UseLibdw" = "x:yes:NO" ; then
47 AC_MSG_ERROR([Cannot find system libdw (required by --enable-dwarf-unwind)])