]> granicus.if.org Git - gc/commitdiff
Check for execinfo.h by configure
authorMike Frysinger <vapier@gentoo.org>
Sat, 29 Aug 2015 23:14:24 +0000 (19:14 -0400)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 21 Jul 2016 18:53:15 +0000 (21:53 +0300)
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
include/gc_config_macros.h

index 4ca7b0ab6a1eb6e9b6805ad6bd6b95f2ddcdd1cb..5a84cc58244c01eeb8ae5cc44863c7cb5786a24a 100644 (file)
@@ -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*)
index e9671294d98f4dd2ef1458c41f37ef4f7b8d30ce..0009b7be69721cc550f320bde271361076ab928e 100644 (file)
 #   include <features.h>
 # 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