summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-08-24 21:27:32 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2012-08-24 21:27:32 -0700
commit7d896ca9f363843d687fd7a9a04b1fb917a42aae (patch)
tree1ab9e2f099cd7c96ce225296eb69bd05500c3924 /m4
parentf4a681b077a4af9f1eb36e0a109003262e2dafd1 (diff)
downloademacs-7d896ca9f363843d687fd7a9a04b1fb917a42aae.tar.gz
* lib/execinfo.c, lib/execinfo.in.h, m4/execinfo.m4: New files.
Diffstat (limited to 'm4')
-rw-r--r--m4/execinfo.m431
1 files changed, 31 insertions, 0 deletions
diff --git a/m4/execinfo.m4 b/m4/execinfo.m4
new file mode 100644
index 00000000000..f1f3cd91638
--- /dev/null
+++ b/m4/execinfo.m4
@@ -0,0 +1,31 @@
+# Check for GNU-style execinfo.h.
+
+dnl Copyright 2012 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_EXECINFO_H],
+[
+ AC_CHECK_HEADERS_ONCE([execinfo.h])
+
+ LIB_EXECINFO=''
+ EXECINFO_H='execinfo.h'
+
+ if test $ac_cv_header_execinfo_h = yes; then
+ gl_saved_libs=$LIBS
+ AC_SEARCH_LIBS([backtrace_symbols_fd], [execinfo],
+ [test "$ac_cv_search_backtrace_symbols_fd" = "none required" ||
+ LIB_EXECINFO=$ac_cv_search_backtrace_symbols_fd])
+ LIBS=$gl_saved_libs
+ test "$ac_cv_search_backtrace_symbols_fd" = no || EXECINFO_H=''
+ fi
+
+ if test -n "$EXECINFO_H"; then
+ AC_LIBOBJ([execinfo])
+ fi
+
+ AC_SUBST([EXECINFO_H])
+ AC_SUBST([LIB_EXECINFO])
+ AM_CONDITIONAL([GL_GENERATE_EXECINFO_H], [test -n "$EXECINFO_H"])
+])