summaryrefslogtreecommitdiff
path: root/net-misc/dahdi-tools/files/dahdi-tools-3.1.0-execinfo.patch
blob: b222a85d8cb9f6b122938105dd3ef0e347926a36 (plain)
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
31
32
33
34
35
36
37
38
39
40
--- a/configure.ac	2020-03-28 22:28:35.614340050 +0200
+++ b/configure.ac	2020-03-28 22:28:55.084181570 +0200
@@ -161,6 +161,7 @@
 # Checks for header files.
 AC_CHECK_HEADERS([sys/soundcard.h linux/soundcard.h])
 AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netinet/in.h stdint.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h unistd.h])
+AC_CHECK_HEADERS([execinfo.h])
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_C_INLINE
--- a/xpp/xtalk/debug.c	2020-03-28 22:41:43.507810560 +0200
+++ b/xpp/xtalk/debug.c	2020-03-28 22:41:10.538087608 +0200
@@ -27,8 +27,10 @@
 #include <stdarg.h>
 #include <syslog.h>
-#include <execinfo.h>
 #include <xtalk/debug.h>
 #include <autoconfig.h>
+#ifdef HAVE_EXECINFO_H
+#include <execinfo.h>
+#endif
 
 int	verbose = LOG_INFO;
 int	debug_mask;
@@ -61,6 +63,7 @@
 /* from glibc info(1) */
 void print_backtrace(FILE *fp)
 {
+#ifdef HAVE_EXECINFO_H
 	void	*array[10];
 	size_t	size;
 	char	**strings;
@@ -71,4 +74,7 @@
 	for (i = 0; i < size; i++)
 		fprintf(fp, "%s\n", strings[i]);
 	free(strings);
+#else
+	fprintf(fp, "backtrace information only available if execinfo.h is available.\n");
+#endif
 }