1 # Check for GNU-style execinfo.h.
3 dnl Copyright 2012-2013 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 AC_DEFUN([gl_EXECINFO_H],
10 AC_CHECK_HEADERS_ONCE([execinfo.h])
13 EXECINFO_H='execinfo.h'
15 if test $ac_cv_header_execinfo_h = yes; then
17 AC_SEARCH_LIBS([backtrace_symbols_fd], [execinfo],
18 [test "$ac_cv_search_backtrace_symbols_fd" = "none required" ||
19 LIB_EXECINFO=$ac_cv_search_backtrace_symbols_fd])
21 test "$ac_cv_search_backtrace_symbols_fd" = no || EXECINFO_H=''
24 if test -n "$EXECINFO_H"; then
28 AC_SUBST([EXECINFO_H])
29 AC_SUBST([LIB_EXECINFO])
30 AM_CONDITIONAL([GL_GENERATE_EXECINFO_H], [test -n "$EXECINFO_H"])