From 978c9b90d55d754a235ad45dc946eed3047687ac Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 29 Aug 2015 19:14:24 -0400 Subject: [PATCH] Check for execinfo.h by configure The current header depends on glibc/uClibc version checks to determine whether execinfo.h exists which breaks other C libs. Instead, add an explicit configure check for it. * configure.ac: Check execinfo.h presence, define GC_MISSING_EXECINFO_H otherwise. * include/gc_config_macros.h [__GLIBC__] (GC_HAVE_BUILTIN_BACKTRACE): Check absence of GC_MISSING_EXECINFO_H instead of __UCLIBC__. --- configure.ac | 6 ++++++ include/gc_config_macros.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 4ca7b0ab..5a84cc58 100644 --- a/configure.ac +++ b/configure.ac @@ -473,6 +473,12 @@ case "$host" in esac AM_CONDITIONAL(AVOID_CPP_LIB,test $avoid_cpp_lib = yes) +# Check for various headers. +AC_CHECK_HEADERS([execinfo.h]) +if test "$ac_cv_header_execinfo_h" != "yes"; then + AC_DEFINE([GC_MISSING_EXECINFO_H], [1], [Missing execinfo.h header]) +fi + # extra LD Flags which are required for targets case "${host}" in *-*-darwin*) diff --git a/include/gc_config_macros.h b/include/gc_config_macros.h index e9671294..0009b7be 100644 --- a/include/gc_config_macros.h +++ b/include/gc_config_macros.h @@ -287,7 +287,8 @@ # include # endif # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \ - && !defined(__ia64__) && !defined(__UCLIBC__) \ + && !defined(__ia64__) \ + && !defined(GC_MISSING_EXECINFO_H) \ && !defined(GC_HAVE_BUILTIN_BACKTRACE) # define GC_HAVE_BUILTIN_BACKTRACE # endif -- 2.50.1