File: acx_with_libunwind.m4

package info (click to toggle)
madness 0.10.1%2Bgit20200818.eee5fd9f-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 34,980 kB
  • sloc: cpp: 280,841; ansic: 12,626; python: 4,961; fortran: 4,245; xml: 1,053; makefile: 714; sh: 276; perl: 244; yacc: 227; lex: 188; asm: 141; csh: 55
file content (30 lines) | stat: -rw-r--r-- 989 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
AC_DEFUN([ACX_WITH_LIBUNWIND], [
  acx_with_libunwind=""
  AC_ARG_WITH([libunwind],
    [AS_HELP_STRING([--with-libunwind@<:@=Install DIR@:>@],
      [Enables use of libunwind, required for Google profiler and heap checker])],
    [
      case $withval in
      yes)
        acx_with_libunwind="yes"
      ;;
      no)
        acx_with_libunwind="no"
      ;;
      *)
        CPPFLAGS="$CPPFLAGS -I$with_libunwind/include"
        LIBS="$LIBS -L$with_libunwind/lib"
        acx_with_libunwind="$withval"
      esac
    ],
    [acx_with_libunwind="no"]
  )
  if test $acx_with_libunwind != "no"; then
    AC_LANG_SAVE
    AC_LANG_C
    AC_CHECK_HEADER([libunwind.h], [], [AC_MSG_ERROR([Unable to compile with the libunwind.])])
    AC_CHECK_LIB([unwind], [_Unwind_GetRegionStart], [LIBS="$LIBS -lunwind"], [AC_MSG_ERROR(["Unable to link with libunwind])])
    AC_DEFINE(MADNESS_HAS_LIBUNWIND, [1], [Define if should use libunwind for Google performance tools])
    AC_LANG_RESTORE
  fi
])