summaryrefslogtreecommitdiffstats
path: root/package/htop/htop.patch
blob: 776561468f5bb21c630b8ac4d3b0f0562587f370 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# This patch removes the hard dependency on backtrace by checking for
# it at compile time and adds a cross-compile /proc check.
# Patch given to me by Hisham <hisham.hm@gmail.com> (htop-general)
#
# This patch is taken from upstream svn (r213, r215)
#
# Signed-off-by: Andy Kennedy <Andy.Kennedy@adtran.com>
diff -Naur a/CRT.c b/CRT.c
--- a/CRT.c    2010-11-23 09:56:32.000000000 -0600
+++ b/CRT.c    2011-03-21 17:08:21.000000000 -0500
@@ -11,7 +11,9 @@
 #include <signal.h>
 #include <stdlib.h>
 #include <stdbool.h>
+#ifdef HAVE_EXECINFO_H
 #include <execinfo.h>
+#endif

 #include "String.h"

@@ -125,12 +127,14 @@
    CRT_done();
    #if __linux
    fprintf(stderr, "\n\nhtop " VERSION " aborting. Please report bug at http://htop.sf.net\n");
-   #else
-   fprintf(stderr, "\n\nhtop " VERSION " aborting. Unsupported platform.\n");
-   #endif
+   #ifdef HAVE_EXECINFO_H
    size_t size = backtrace(backtraceArray, sizeof(backtraceArray));
    fprintf(stderr, "Backtrace: \n");
    backtrace_symbols_fd(backtraceArray, size, 2);
+   #endif
+   #else
+   fprintf(stderr, "\n\nhtop " VERSION " aborting. Unsupported platform.\n");
+   #endif
    abort();
 }

diff -Naur a/CRT.h b/CRT.h
--- a/CRT.h    2010-11-23 09:56:32.000000000 -0600
+++ b/CRT.h    2011-03-21 17:06:16.000000000 -0500
@@ -14,7 +14,9 @@
 #include <signal.h>
 #include <stdlib.h>
 #include <stdbool.h>
+#ifdef HAVE_EXECINFO_H
 #include <execinfo.h>
+#endif

 #include "String.h"

diff -Naur a/configure.ac b/configure.ac
--- a/configure.ac    2010-11-23 09:56:32.000000000 -0600
+++ b/configure.ac    2011-03-21 17:06:16.000000000 -0500
@@ -25,6 +25,7 @@
 AC_CHECK_HEADERS([stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h curses.h],[:],[
   missing_headers="$missing_headers $ac_header"
 ])
+AC_CHECK_HEADERS([execinfo.h],[:],[:])

 # Checks for typedefs, structures, and compiler characteristics.
 AC_HEADER_STDBOOL
@@ -99,10 +100,10 @@
   AC_MSG_ERROR([missing headers: $missing_headers])
 fi

-
-
+if test "$cross_compiling" = "no"; then
 AC_CHECK_FILE($PROCDIR/stat,,AC_MSG_ERROR(Cannot find /proc/stat. Make sure you have a Linux-compatible /proc filesystem mounted. See the file README for help.))
 AC_CHECK_FILE($PROCDIR/meminfo,,AC_MSG_ERROR(Cannot find /proc/meminfo. Make sure you have a Linux-compatible /proc filesystem mounted. See the file README for help.))
+fi

 AC_ARG_ENABLE(plpa, [AC_HELP_STRING([--enable-plpa], [enable PLPA support for CPU affinity])], ,enable_plpa="yes")
 PLPA_INCLUDED