49c9b7809dce79064c0d0a46297a33ec93997118
[openwrt/openwrt.git] / tools / cmake / patches / 110-freebsd-compat.patch
1 From 6eab64c3adc7a38c322cd4d9a1a1881f2d49cb9c Mon Sep 17 00:00:00 2001
2 From: Raphael Kubo da Costa <rakuco@FreeBSD.org>
3 Date: Tue, 15 Oct 2013 00:10:56 +0300
4 Subject: [PATCH] SystemInformation: Include backtrace-related headers on
5 FreeBSD
6
7 This was probably broken for a long while, but the problem was not apparent
8 because the check for execinfo.h would fail by default because
9 -I/usr/local/include was not being passed to the compiler when making the
10 checks for the header's existence.
11
12 Now that very recent FreeBSD versions (ie. 10-CURRENT) have NetBSD's
13 libexecinfo in base (and it is thus installed into /usr), the
14 backtrace-related checks would pass, but the required headers were not being
15 included in SystemInformation.cxx.
16
17 Change-Id: I3b91ed7ac0e6878035aee202b3336c536cc6d2ff
18 ---
19 Source/kwsys/SystemInformation.cxx | 9 +++++++++
20 1 file changed, 9 insertions(+)
21
22 --- a/Source/kwsys/SystemInformation.cxx
23 +++ b/Source/kwsys/SystemInformation.cxx
24 @@ -90,6 +90,15 @@ typedef int siginfo_t;
25 # include <ifaddrs.h>
26 # define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN
27 # endif
28 +# if defined(KWSYS_SYSTEMINFORMATION_HAS_BACKTRACE)
29 +# include <execinfo.h>
30 +# if defined(KWSYS_SYSTEMINFORMATION_HAS_CPP_DEMANGLE)
31 +# include <cxxabi.h>
32 +# endif
33 +# if defined(KWSYS_SYSTEMINFORMATION_HAS_SYMBOL_LOOKUP)
34 +# include <dlfcn.h>
35 +# endif
36 +# endif
37 #endif
38
39 #if defined(__OpenBSD__) || defined(__NetBSD__)