b54944829b590c958daa5302ed4c62966d23c340
[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 diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
23 index 7c31f3a..2672730 100644
24 --- a/Source/kwsys/SystemInformation.cxx
25 +++ b/Source/kwsys/SystemInformation.cxx
26 @@ -90,6 +90,15 @@ typedef int siginfo_t;
27 # include <ifaddrs.h>
28 # define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN
29 # endif
30 +# if defined(KWSYS_SYSTEMINFORMATION_HAS_BACKTRACE)
31 +# include <execinfo.h>
32 +# if defined(KWSYS_SYSTEMINFORMATION_HAS_CPP_DEMANGLE)
33 +# include <cxxabi.h>
34 +# endif
35 +# if defined(KWSYS_SYSTEMINFORMATION_HAS_SYMBOL_LOOKUP)
36 +# include <dlfcn.h>
37 +# endif
38 +# endif
39 #endif
40
41 #if defined(__OpenBSD__) || defined(__NetBSD__)
42