C Stack Compatibility
*********************
-If the system does not support the C-level :manpage:`backtrace(3)`,
-:manpage:`backtrace_symbols(3)`, or :manpage:`dladdr(3)`, then C stack dumps
-will not work. An error will be printed instead of the stack.
+If the system does not support the C-level :manpage:`backtrace(3)`
+or :manpage:`dladdr1(3)`, then C stack dumps will not work.
+An error will be printed instead of the stack.
Additionally, some compilers do not support :term:`CPython's <CPython>`
implementation of C stack dumps. As a result, a different error may be printed
cat >>confdefs.h <<_ACEOF
#define `printf "%s\n" "HAVE_$ac_header" | sed "$as_sed_cpp"` 1
_ACEOF
- ac_fn_c_check_func "$LINENO" "backtrace" "ac_cv_func_backtrace"
-if test "x$ac_cv_func_backtrace" = xyes
-then :
- printf "%s\n" "#define HAVE_BACKTRACE 1" >>confdefs.h
-fi
-ac_fn_c_check_func "$LINENO" "backtrace_symbols" "ac_cv_func_backtrace_symbols"
-if test "x$ac_cv_func_backtrace_symbols" = xyes
-then :
- printf "%s\n" "#define HAVE_BACKTRACE_SYMBOLS 1" >>confdefs.h
-fi
-ac_fn_c_check_func "$LINENO" "dladdr1" "ac_cv_func_dladdr1"
-if test "x$ac_cv_func_dladdr1" = xyes
+ for ac_func in backtrace dladdr1
+do :
+ as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | sed "$as_sed_sh"`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"
then :
- printf "%s\n" "#define HAVE_DLADDR1 1" >>confdefs.h
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_$ac_func" | sed "$as_sed_cpp"` 1
+_ACEOF
+
+ # dladdr1 requires -ldl
+ as_fn_append LDFLAGS " -ldl"
fi
+done
+
fi
done
AC_HEADER_MAJOR
# for faulthandler
-AC_CHECK_HEADERS([execinfo.h link.h dlfcn.h],
- [AC_CHECK_FUNCS(backtrace backtrace_symbols dladdr1)])
+AC_CHECK_HEADERS([execinfo.h link.h dlfcn.h], [
+ AC_CHECK_FUNCS([backtrace dladdr1], [
+ # dladdr1 requires -ldl
+ AS_VAR_APPEND([LDFLAGS], [" -ldl"])
+ ])
+])
# bluetooth/bluetooth.h has been known to not compile with -std=c99.
# http://permalink.gmane.org/gmane.linux.bluez.kernel/22294
/* Define to 1 if you have the 'backtrace' function. */
#undef HAVE_BACKTRACE
-/* Define to 1 if you have the 'backtrace_symbols' function. */
-#undef HAVE_BACKTRACE_SYMBOLS
-
/* Define if you have the 'bind' function. */
#undef HAVE_BIND