From 200019c0c66ec757353ffaaea8d9c98da37f26c8 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Wed, 30 May 2012 15:53:42 +0300 Subject: [PATCH] compositor: check for execinfo.h Some systems may not have execinfo.h. Add a configure test for it, and if it is not found, make the backtrace() call a no-operation. Signed-off-by: Pekka Paalanen --- configure.ac | 2 ++ shared/os-compatibility.h | 10 ++++++++++ src/compositor.c | 1 - 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 4dfd161f..ad8a44a5 100644 --- a/configure.ac +++ b/configure.ac @@ -24,6 +24,8 @@ AC_CHECK_FUNC([dlopen], [], AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl")) AC_SUBST(DLOPEN_LIBS) +AC_CHECK_HEADERS([execinfo.h]) + PKG_CHECK_MODULES(COMPOSITOR, [wayland-server egl >= 7.10 glesv2 xkbcommon pixman-1]) diff --git a/shared/os-compatibility.h b/shared/os-compatibility.h index 77e86728..ca753b6d 100644 --- a/shared/os-compatibility.h +++ b/shared/os-compatibility.h @@ -23,6 +23,16 @@ #ifndef OS_COMPATIBILITY_H #define OS_COMPATIBILITY_H +#ifdef HAVE_EXECINFO_H +#include +#else +static inline int +backtrace(void **buffer, int size) +{ + return 0; +} +#endif + int os_socketpair_cloexec(int domain, int type, int protocol, int *sv); diff --git a/src/compositor.c b/src/compositor.c index e99f0517..4f10abac 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -42,7 +42,6 @@ #include #include #include -#include #include #include "compositor.h"