xref: /freebsd-src/sys/contrib/openzfs/config/user-backtrace.m4 (revision b985c9cafd2aedac5cf92428c0211485ea4ede24)
1*b985c9caSMartin Matuskadnl
2*b985c9caSMartin Matuskadnl backtrace(), for userspace assertions. glibc has this directly in libc.
3*b985c9caSMartin Matuskadnl FreeBSD and (sometimes) musl have it in a separate -lexecinfo. It's assumed
4*b985c9caSMartin Matuskadnl that this will also get the companion function backtrace_symbols().
5*b985c9caSMartin Matuskadnl
6*b985c9caSMartin MatuskaAC_DEFUN([ZFS_AC_CONFIG_USER_BACKTRACE], [
7*b985c9caSMartin Matuska	AX_SAVE_FLAGS
8*b985c9caSMartin Matuska	LIBS=""
9*b985c9caSMartin Matuska	AC_SEARCH_LIBS([backtrace], [execinfo], [
10*b985c9caSMartin Matuska		AC_DEFINE(HAVE_BACKTRACE, 1, [backtrace() is available])
11*b985c9caSMartin Matuska		AC_SUBST([BACKTRACE_LIBS], ["$LIBS"])
12*b985c9caSMartin Matuska	])
13*b985c9caSMartin Matuska	AX_RESTORE_FLAGS
14*b985c9caSMartin Matuska])
15