Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Add Package:  htop
@ 2011-03-22 15:18 Andy Kennedy
  2011-03-22 15:38 ` Mike Frysinger
  0 siblings, 1 reply; 14+ messages in thread
From: Andy Kennedy @ 2011-03-22 15:18 UTC (permalink / raw)
  To: buildroot

Adds package htop.  This is a resubmit, with corrections.

Signed-off-by:  Andy Kennedy <Andy.Kennedy@AdTran.com>
---
diff -Naur a/package/Config.in b/package/Config.in
--- a/package/Config.in 2011-03-14 10:39:51.000000000 -0500
+++ b/package/Config.in 2011-03-21 17:29:22.000000000 -0500
@@ -476,6 +476,9 @@
 menu "System tools"
 if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 source "package/bootutils/Config.in"
+endif
+source "package/htop/Config.in"
+if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 source "package/module-init-tools/Config.in"
 source "package/procps/Config.in"
 source "package/psmisc/Config.in"
diff -Naur a/package/htop/Config.in b/package/htop/Config.in
--- a/package/htop/Config.in    1969-12-31 18:00:00.000000000 -0600
+++ b/package/htop/Config.in    2011-03-21 17:29:22.000000000 -0500
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_HTOP
+       bool "htop"
+       select BR2_PACKAGE_NCURSES
+       help
+         htop is an interactive text-mode process viewer for Linux.
+         It aims to be a better top.
+
+         http://sourceforge.net/projects/htop/
diff -Naur a/package/htop/htop-alloc-not-void.patch b/package/htop/htop-alloc-not-void.patch
--- a/package/htop/htop-alloc-not-void.patch    1969-12-31 18:00:00.000000000 -0600
+++ b/package/htop/htop-alloc-not-void.patch    2011-03-21 18:09:45.000000000 -0500
@@ -0,0 +1,21 @@
+diff -Naur a/configure b/configure
+--- a/configure        2010-11-23 10:33:53.000000000 -0600
++++ b/configure        2011-03-21 18:05:46.000000000 -0500
+@@ -12363,7 +12363,7 @@
+ #if defined STDC_HEADERS || defined HAVE_STDLIB_H
+ # include <stdlib.h>
+ #else
+-char *malloc ();
++void *malloc ();
+ #endif
+
+ int
+@@ -12598,7 +12598,7 @@
+ #if defined STDC_HEADERS || defined HAVE_STDLIB_H
+ # include <stdlib.h>
+ #else
+-char *realloc ();
++void *realloc ();
+ #endif
+
+ int
diff -Naur a/package/htop/htop-cross-no-proc-check.patch b/package/htop/htop-cross-no-proc-check.patch
--- a/package/htop/htop-cross-no-proc-check.patch       1969-12-31 18:00:00.000000000 -0600
+++ b/package/htop/htop-cross-no-proc-check.patch       2011-03-22 09:57:22.000000000 -0500
@@ -0,0 +1,22 @@
+# This patch removes the checks for /proc when cross compiling.
+# We hope you know what you are doing and you have /proc, doesn't everyone?
+# Signed-of-by:  Andy Kennedy <Andy.Kennedy@adtran.com>
+diff -Naur a/configure b/configure
+--- a/configure 2010-11-23 10:33:53.000000000 -0600
++++ b/configure 2011-03-22 09:52:46.000000000 -0500
+@@ -13605,6 +13605,7 @@
+
+
+
++if test "$cross_compiling" = no ; then
+ as_ac_File=`echo "ac_cv_file_$PROCDIR/stat" | $as_tr_sh`
+ { echo "$as_me:$LINENO: checking for $PROCDIR/stat" >&5
+ echo $ECHO_N "checking for $PROCDIR/stat... $ECHO_C" >&6; }
+@@ -13658,6 +13659,7 @@
+ echo "$as_me: error: Cannot find /proc/meminfo. Make sure you have a Linux-compatible /proc filesystem mounted. See the file README for help." >&2;}
+    { (exit 1); exit 1; }; }
+ fi
++fi #cross_compiling = no (Andy Kennedy)
+
+
+ # Check whether --enable-plpa was given.
diff -Naur a/package/htop/htop-make-execinfo-detectable.patch b/package/htop/htop-make-execinfo-detectable.patch
--- a/package/htop/htop-make-execinfo-detectable.patch  1969-12-31 18:00:00.000000000 -0600
+++ b/package/htop/htop-make-execinfo-detectable.patch  2011-03-21 17:29:22.000000000 -0500
@@ -0,0 +1,59 @@
+# This patch removes the checks for /proc when cross compiling.
+# We hope you know what you are doing and you have /proc, doesn't everyone?
+# Patch given to me by Hisham <hisham.hm@gmail.com>
+# Signed-of-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:05:42.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([execinfog.h],[:],[:])
+
+ # Checks for typedefs, structures, and compiler characteristics.
+ AC_HEADER_STDBOOL
diff -Naur a/package/htop/htop.mk b/package/htop/htop.mk
--- a/package/htop/htop.mk      1969-12-31 18:00:00.000000000 -0600
+++ b/package/htop/htop.mk      2011-03-22 09:31:54.000000000 -0500
@@ -0,0 +1,17 @@
+#############################################################
+#
+# htop
+#
+#############################################################
+HTOP_VERSION = 0.9
+HTOP_SOURCE = htop-$(HTOP_VERSION).tar.gz
+HTOP_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/htop/$(HTOP_VERSION)
+HTOP_DEPENDENCIES = ncurses
+
+HTOP_POST_CONFIGURE_HOOKS = HTOP_RETOUCH_CONFIGURE_AC
+
+define HTOP_RETOUCH_CONFIGURE_AC
+       touch -r $(@D)/missing $(@D)/configure.ac
+endef
+
+$(eval $(call AUTOTARGETS,package,htop))

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] Add Package: htop
  2011-03-22 15:18 Andy Kennedy
@ 2011-03-22 15:38 ` Mike Frysinger
  2011-03-22 16:01   ` ANDY KENNEDY
  0 siblings, 1 reply; 14+ messages in thread
From: Mike Frysinger @ 2011-03-22 15:38 UTC (permalink / raw)
  To: buildroot

On Tue, Mar 22, 2011 at 11:18 AM, Andy Kennedy wrote:
> --- a/package/htop/htop-alloc-not-void.patch ? ?1969-12-31 18:00:00.000000000 -0600
> +++ b/package/htop/htop-alloc-not-void.patch ? ?2011-03-21 18:09:45.000000000 -0500
> @@ -0,0 +1,21 @@
> +diff -Naur a/configure b/configure
> +--- a/configure ? ? ? ?2010-11-23 10:33:53.000000000 -0600
> ++++ b/configure ? ? ? ?2011-03-21 18:05:46.000000000 -0500
> +@@ -12363,7 +12363,7 @@
> + #if defined STDC_HEADERS || defined HAVE_STDLIB_H
> + # include <stdlib.h>
> + #else
> +-char *malloc ();
> ++void *malloc ();
> + #endif
> +
> + int
> +@@ -12598,7 +12598,7 @@
> + #if defined STDC_HEADERS || defined HAVE_STDLIB_H
> + # include <stdlib.h>
> + #else
> +-char *realloc ();
> ++void *realloc ();
> + #endif

why do you need to patch this ?  HAVE_STDLIB_H should be defined, or
something else is broken.

> +--- a/configure
> ++++ b/configure

so you patch configure ...

> +--- a/configure.ac
> ++++ b/configure.ac

then you patch configure.ac ...

> +HTOP_POST_CONFIGURE_HOOKS = HTOP_RETOUCH_CONFIGURE_AC
> +
> +define HTOP_RETOUCH_CONFIGURE_AC
> + ? ? ? touch -r $(@D)/missing $(@D)/configure.ac
> +endef

and then you manually touch configure.ac, but dont invoke autotools
anywhere.  what is going on here ?

you should only be patching generated files, or only the source
autotool files.  and if you do the latter, you should be re-running
autotools via HTOP_AUTORECONF=yes, not manually mucking with
timestamps and letting the build system figure things out.
-mike

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] Add Package: htop
  2011-03-22 15:38 ` Mike Frysinger
@ 2011-03-22 16:01   ` ANDY KENNEDY
  2011-03-22 16:09     ` Mike Frysinger
  0 siblings, 1 reply; 14+ messages in thread
From: ANDY KENNEDY @ 2011-03-22 16:01 UTC (permalink / raw)
  To: buildroot

> -----Original Message-----
> From: vapierfilter at gmail.com [mailto:vapierfilter at gmail.com] On Behalf Of Mike Frysinger
> Sent: Tuesday, March 22, 2011 10:39 AM
> To: ANDY KENNEDY
> Cc: buildroot at busybox.net
> Subject: Re: [Buildroot] Add Package: htop
> 
> On Tue, Mar 22, 2011 at 11:18 AM, Andy Kennedy wrote:
> > --- a/package/htop/htop-alloc-not-void.patch ? ?1969-12-31 18:00:00.000000000 -0600
> > +++ b/package/htop/htop-alloc-not-void.patch ? ?2011-03-21 18:09:45.000000000 -0500
> > @@ -0,0 +1,21 @@
> > +diff -Naur a/configure b/configure
> > +--- a/configure ? ? ? ?2010-11-23 10:33:53.000000000 -0600
> > ++++ b/configure ? ? ? ?2011-03-21 18:05:46.000000000 -0500
> > +@@ -12363,7 +12363,7 @@
> > + #if defined STDC_HEADERS || defined HAVE_STDLIB_H
> > + # include <stdlib.h>
> > + #else
> > +-char *malloc ();
> > ++void *malloc ();
> > + #endif
> > +
> > + int
> > +@@ -12598,7 +12598,7 @@
> > + #if defined STDC_HEADERS || defined HAVE_STDLIB_H
> > + # include <stdlib.h>
> > + #else
> > +-char *realloc ();
> > ++void *realloc ();
> > + #endif
> 
> why do you need to patch this ?  HAVE_STDLIB_H should be defined, or
> something else is broken.

Ah crap!  I didn't mean that to be in there.  That was leftovers from
when I was attempting to fix the issue of automake not being the correct
version (they have it hard-coded to 1.10, mine is 1.11).  Though. . . 

> 
> > +--- a/configure
> > ++++ b/configure
> 
> so you patch configure ...
> 
> > +--- a/configure.ac
> > ++++ b/configure.ac
> 
> then you patch configure.ac ...
> 
> > +HTOP_POST_CONFIGURE_HOOKS = HTOP_RETOUCH_CONFIGURE_AC
> > +
> > +define HTOP_RETOUCH_CONFIGURE_AC
> > + ? ? ? touch -r $(@D)/missing $(@D)/configure.ac
> > +endef
> 
> and then you manually touch configure.ac, but dont invoke autotools
> anywhere.  what is going on here ?

if you touch the configure.ac file using the timestamp off of missing,
you don't _need_ to rerun the automake if the configure.ac is near the
same time as missing and configure.  This would be a hack.  Perhaps I
should mention that in the patch file?

> 
> you should only be patching generated files, or only the source
> autotool files.  and if you do the latter, you should be re-running
> autotools via HTOP_AUTORECONF=yes, not manually mucking with
> timestamps and letting the build system figure things out.

I'm confused about this (forgive my ignorance about the overall build
system).  So, if I let configure run, then let make run it fails.
However, I can go back and rm .stamp_configured and re-run make then
all is well.  So, if I do HTOP_AUTORECONF, will this do this for me?

> -mike

Andy

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] Add Package: htop
  2011-03-22 16:01   ` ANDY KENNEDY
@ 2011-03-22 16:09     ` Mike Frysinger
  0 siblings, 0 replies; 14+ messages in thread
From: Mike Frysinger @ 2011-03-22 16:09 UTC (permalink / raw)
  To: buildroot

On Tue, Mar 22, 2011 at 12:01 PM, ANDY KENNEDY wrote:
> From: vapierfilter at gmail.com [mailto:vapierfilter at gmail.com] On Behalf Of Mike Frysinger
>> On Tue, Mar 22, 2011 at 11:18 AM, Andy Kennedy wrote:
>> > +--- a/configure
>> > ++++ b/configure
>>
>> so you patch configure ...
>>
>> > +--- a/configure.ac
>> > ++++ b/configure.ac
>>
>> then you patch configure.ac ...
>>
>> > +HTOP_POST_CONFIGURE_HOOKS = HTOP_RETOUCH_CONFIGURE_AC
>> > +
>> > +define HTOP_RETOUCH_CONFIGURE_AC
>> > + ? ? ? touch -r $(@D)/missing $(@D)/configure.ac
>> > +endef
>>
>> and then you manually touch configure.ac, but dont invoke autotools
>> anywhere. ?what is going on here ?
>
> if you touch the configure.ac file using the timestamp off of missing,
> you don't _need_ to rerun the automake if the configure.ac is near the
> same time as missing and configure. ?This would be a hack. ?Perhaps I
> should mention that in the patch file?

sorry, i missed the -r.  this begs the question of why are you
patching configure.ac at all then if you try and prevent autotools
from running.  any changes made to configure.ac wont be reflected in
configure and other files if autoconf/etc... arent run.

>> you should only be patching generated files, or only the source
>> autotool files. ?and if you do the latter, you should be re-running
>> autotools via HTOP_AUTORECONF=yes, not manually mucking with
>> timestamps and letting the build system figure things out.
>
> I'm confused about this (forgive my ignorance about the overall build
> system). ?So, if I let configure run, then let make run it fails.
> However, I can go back and rm .stamp_configured and re-run make then
> all is well. ?So, if I do HTOP_AUTORECONF, will this do this for me?

the vague description sounds like autotool problems and you should be
using autoreconf.
-mike

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] Add Package:  htop
@ 2011-03-25 22:47 Andy Kennedy
  2011-03-26 14:23 ` Gerhard Heift
  0 siblings, 1 reply; 14+ messages in thread
From: Andy Kennedy @ 2011-03-25 22:47 UTC (permalink / raw)
  To: buildroot

Adds package htop.  Changes made based upon e-mails with Mike Frysinger.

Signed-off-by:  Andy Kennedy <Andy.Kennedy@AdTran.com>
---
diff -Naur a/package/Config.in b/package/Config.in
--- a/package/Config.in 2011-03-14 10:39:51.000000000 -0500
+++ b/package/Config.in 2011-03-21 17:29:22.000000000 -0500
@@ -476,6 +476,9 @@
 menu "System tools"
 if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 source "package/bootutils/Config.in"
+endif
+source "package/htop/Config.in"
+if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 source "package/module-init-tools/Config.in"
 source "package/procps/Config.in"
 source "package/psmisc/Config.in"
diff -Naur a/package/htop/Config.in b/package/htop/Config.in
--- a/package/htop/Config.in    1969-12-31 18:00:00.000000000 -0600
+++ b/package/htop/Config.in    2011-03-21 17:29:22.000000000 -0500
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_HTOP
+       bool "htop"
+       select BR2_PACKAGE_NCURSES
+       help
+         htop is an interactive text-mode process viewer for Linux.
+         It aims to be a better top.
+
+         http://sourceforge.net/projects/htop/
diff -Naur a/package/htop/htop.patch b/package/htop/htop.patch
--- a/package/htop/htop.patch   1969-12-31 18:00:00.000000000 -0600
+++ b/package/htop/htop.patch   2011-03-21 17:29:22.000000000 -0500
@@ -0,0 +1,70 @@
+# 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)
+# Signed-of-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
+@@ -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
diff -Naur a/package/htop/htop.mk b/package/htop/htop.mk
--- a/package/htop/htop.mk      1969-12-31 18:00:00.000000000 -0600
+++ b/package/htop/htop.mk      2011-03-22 09:31:54.000000000 -0500
@@ -0,0 +1,12 @@
+#############################################################
+#
+# htop
+#
+#############################################################
+HTOP_VERSION = 0.9
+HTOP_SOURCE = htop-$(HTOP_VERSION).tar.gz
+HTOP_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/htop/$(HTOP_VERSION)
+HTOP_DEPENDENCIES = ncurses
+HTOP_AUTORECONF=yes
+
+$(eval $(call AUTOTARGETS,package,htop))

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] Add Package:  htop
  2011-03-25 22:47 [Buildroot] Add Package: htop Andy Kennedy
@ 2011-03-26 14:23 ` Gerhard Heift
  0 siblings, 0 replies; 14+ messages in thread
From: Gerhard Heift @ 2011-03-26 14:23 UTC (permalink / raw)
  To: buildroot

On Fri, Mar 25, 2011 at 05:47:36PM -0500, Andy Kennedy wrote:
> Adds package htop.  Changes made based upon e-mails with Mike Frysinger.
> 
> Signed-off-by:  Andy Kennedy <Andy.Kennedy@AdTran.com>
> ---
> diff -Naur a/package/Config.in b/package/Config.in

[snip]

> diff -Naur a/package/htop/htop.mk b/package/htop/htop.mk
> --- a/package/htop/htop.mk      1969-12-31 18:00:00.000000000 -0600
> +++ b/package/htop/htop.mk      2011-03-22 09:31:54.000000000 -0500
> @@ -0,0 +1,12 @@
> +#############################################################
> +#
> +# htop
> +#
> +#############################################################
> +HTOP_VERSION = 0.9
> +HTOP_SOURCE = htop-$(HTOP_VERSION).tar.gz
> +HTOP_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/htop/$(HTOP_VERSION)
> +HTOP_DEPENDENCIES = ncurses
> +HTOP_AUTORECONF=yes

The value of *_AUTORECONF has to be an uppercase YES.

> +
> +$(eval $(call AUTOTARGETS,package,htop))

Regards,
  Gerhard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20110326/86f2aa47/attachment.asc>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] Add Package:  htop
@ 2011-03-28 16:02 Andy Kennedy
  2011-03-28 16:18 ` Mike Frysinger
  0 siblings, 1 reply; 14+ messages in thread
From: Andy Kennedy @ 2011-03-28 16:02 UTC (permalink / raw)
  To: buildroot

Adds package htop.  Changes made based upon e-mails with Mike Frysinger
and Gerhard Heift.  The autoreconf change is important for anyone using
uClibc as there is no widely available backtrace (yet).

Signed-off-by:  Andy Kennedy <Andy.Kennedy@AdTran.com>
---
diff -Naur a/package/Config.in b/package/Config.in
--- a/package/Config.in 2011-03-14 10:39:51.000000000 -0500
+++ b/package/Config.in 2011-03-21 17:29:22.000000000 -0500
@@ -476,6 +476,9 @@
 menu "System tools"
 if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 source "package/bootutils/Config.in"
+endif
+source "package/htop/Config.in"
+if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 source "package/module-init-tools/Config.in"
 source "package/procps/Config.in"
 source "package/psmisc/Config.in"
diff -Naur a/package/htop/Config.in b/package/htop/Config.in
--- a/package/htop/Config.in    1969-12-31 18:00:00.000000000 -0600
+++ b/package/htop/Config.in    2011-03-21 17:29:22.000000000 -0500
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_HTOP
+       bool "htop"
+       select BR2_PACKAGE_NCURSES
+       help
+         htop is an interactive text-mode process viewer for Linux.
+         It aims to be a better top.
+
+         http://sourceforge.net/projects/htop/
diff -Naur a/package/htop/htop.patch b/package/htop/htop.patch
--- a/package/htop/htop.patch   1969-12-31 18:00:00.000000000 -0600
+++ b/package/htop/htop.patch   2011-03-21 17:29:22.000000000 -0500
@@ -0,0 +1,70 @@
+# 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)
+# Signed-of-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
+@@ -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
diff -Naur a/package/htop/htop.mk b/package/htop/htop.mk
--- a/package/htop/htop.mk      1969-12-31 18:00:00.000000000 -0600
+++ b/package/htop/htop.mk      2011-03-22 09:31:54.000000000 -0500
@@ -0,0 +1,12 @@
+#############################################################
+#
+# htop
+#
+#############################################################
+HTOP_VERSION = 0.9
+HTOP_SOURCE = htop-$(HTOP_VERSION).tar.gz
+HTOP_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/htop/$(HTOP_VERSION)
+HTOP_DEPENDENCIES = ncurses
+HTOP_AUTORECONF=YES
+
+$(eval $(call AUTOTARGETS,package,htop))

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] Add Package: htop
  2011-03-28 16:02 Andy Kennedy
@ 2011-03-28 16:18 ` Mike Frysinger
  2011-03-28 17:21   ` ANDY KENNEDY
  0 siblings, 1 reply; 14+ messages in thread
From: Mike Frysinger @ 2011-03-28 16:18 UTC (permalink / raw)
  To: buildroot

On Mon, Mar 28, 2011 at 12:02 PM, Andy Kennedy wrote:
> Adds package htop. ?Changes made based upon e-mails with Mike Frysinger
> and Gerhard Heift. ?The autoreconf change is important for anyone using
> uClibc as there is no widely available backtrace (yet).

this ver looks mostly sane ...

> ++AC_CHECK_HEADERS([execinfo.h],[:],[:])

no need for munging the other branches
  AC_CHECK_HEADERS([execinfo.h])

> ++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_CHECK_FILE has fallback cases for cross-compiling i thought, so you
shouldnt need to check cross_compiling yourself
-mike

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] Add Package: htop
  2011-03-28 16:18 ` Mike Frysinger
@ 2011-03-28 17:21   ` ANDY KENNEDY
  2011-03-28 17:37     ` Mike Frysinger
  0 siblings, 1 reply; 14+ messages in thread
From: ANDY KENNEDY @ 2011-03-28 17:21 UTC (permalink / raw)
  To: buildroot

> On Mon, Mar 28, 2011 at 12:02 PM, Andy Kennedy wrote:
> > Adds package htop. ?Changes made based upon e-mails with Mike
> Frysinger
> > and Gerhard Heift. ?The autoreconf change is important for anyone
> using
> > uClibc as there is no widely available backtrace (yet).
> 
> this ver looks mostly sane ...
> 
> > ++AC_CHECK_HEADERS([execinfo.h],[:],[:])
> 
> no need for munging the other branches
>   AC_CHECK_HEADERS([execinfo.h])
> 
> > ++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_CHECK_FILE has fallback cases for cross-compiling i thought, so
> you
> shouldnt need to check cross_compiling yourself

The error was really strange.  I submitted this patch to htop and
they tested, modified and included it as a fix.  The problem was that
when one is cross compiling, the test for /proc fails since the build
is a cross build -- there were enough smarts to not test when cross
building, however, the return value was a failure for the /proc
tests.  This _should_ not occur so we skip the whole test.

This patch was derived by getting the current branch via svn and
running a diff against configure.ac.

> -mike

Andy

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] Add Package: htop
  2011-03-28 17:21   ` ANDY KENNEDY
@ 2011-03-28 17:37     ` Mike Frysinger
  2011-03-28 17:43       ` ANDY KENNEDY
  0 siblings, 1 reply; 14+ messages in thread
From: Mike Frysinger @ 2011-03-28 17:37 UTC (permalink / raw)
  To: buildroot

On Mon, Mar 28, 2011 at 1:21 PM, ANDY KENNEDY wrote:
> This patch was derived by getting the current branch via svn and
> running a diff against configure.ac.

ok, np then.  i might mention in the patch header "this is already in
upstream svn".
-mike

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] Add Package: htop
  2011-03-28 17:37     ` Mike Frysinger
@ 2011-03-28 17:43       ` ANDY KENNEDY
  2011-03-28 18:39         ` Mike Frysinger
  0 siblings, 1 reply; 14+ messages in thread
From: ANDY KENNEDY @ 2011-03-28 17:43 UTC (permalink / raw)
  To: buildroot

> On Mon, Mar 28, 2011 at 1:21 PM, ANDY KENNEDY wrote:
> > This patch was derived by getting the current branch via svn and
> > running a diff against configure.ac.
> 
> ok, np then.  i might mention in the patch header "this is already
> in
> upstream svn".

Kinda sorta did:

+# 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)

Hisham is the main developer.  You want me to modify this patch 
again and resubmit?  I don't mind -- and it wouldn't take long.

> -mike

Andy

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] Add Package: htop
  2011-03-28 17:43       ` ANDY KENNEDY
@ 2011-03-28 18:39         ` Mike Frysinger
  0 siblings, 0 replies; 14+ messages in thread
From: Mike Frysinger @ 2011-03-28 18:39 UTC (permalink / raw)
  To: buildroot

On Mon, Mar 28, 2011 at 1:43 PM, ANDY KENNEDY wrote:
>> On Mon, Mar 28, 2011 at 1:21 PM, ANDY KENNEDY wrote:
>> > This patch was derived by getting the current branch via svn and
>> > running a diff against configure.ac.
>>
>> ok, np then. ?i might mention in the patch header "this is already
>> in upstream svn".
>
> Kinda sorta did:

yes, but the sorta isnt explicit ;)

> +# 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)
>
> Hisham is the main developer. ?You want me to modify this patch
> again and resubmit? ?I don't mind -- and it wouldn't take long.

yes, please add an explicit "This patch is taken from upstream svn."
-mike

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] Add Package:  htop
@ 2011-03-28 18:47 Andy Kennedy
  2011-04-16 20:57 ` Peter Korsgaard
  0 siblings, 1 reply; 14+ messages in thread
From: Andy Kennedy @ 2011-03-28 18:47 UTC (permalink / raw)
  To: buildroot

Adds package htop.  Changes made based upon e-mails with Mike Frysinger
and Gerhard Heift.  The autoreconf change is important for anyone using
uClibc as there is no widely available backtrace (yet).

Signed-off-by:  Andy Kennedy <Andy.Kennedy@AdTran.com>
---
diff -Naur a/package/Config.in b/package/Config.in
--- a/package/Config.in 2011-03-14 10:39:51.000000000 -0500
+++ b/package/Config.in 2011-03-21 17:29:22.000000000 -0500
@@ -476,6 +476,9 @@
 menu "System tools"
 if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 source "package/bootutils/Config.in"
+endif
+source "package/htop/Config.in"
+if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 source "package/module-init-tools/Config.in"
 source "package/procps/Config.in"
 source "package/psmisc/Config.in"
diff -Naur a/package/htop/Config.in b/package/htop/Config.in
--- a/package/htop/Config.in    1969-12-31 18:00:00.000000000 -0600
+++ b/package/htop/Config.in    2011-03-21 17:29:22.000000000 -0500
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_HTOP
+       bool "htop"
+       select BR2_PACKAGE_NCURSES
+       help
+         htop is an interactive text-mode process viewer for Linux.
+         It aims to be a better top.
+
+         http://sourceforge.net/projects/htop/
diff -Naur a/package/htop/htop.patch b/package/htop/htop.patch
--- a/package/htop/htop.patch   1969-12-31 18:00:00.000000000 -0600
+++ b/package/htop/htop.patch   2011-03-21 17:29:22.000000000 -0500
@@ -0,0 +1,71 @@
+# 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.
+# Signed-of-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
+@@ -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
diff -Naur a/package/htop/htop.mk b/package/htop/htop.mk
--- a/package/htop/htop.mk      1969-12-31 18:00:00.000000000 -0600
+++ b/package/htop/htop.mk      2011-03-22 09:31:54.000000000 -0500
@@ -0,0 +1,12 @@
+#############################################################
+#
+# htop
+#
+#############################################################
+HTOP_VERSION = 0.9
+HTOP_SOURCE = htop-$(HTOP_VERSION).tar.gz
+HTOP_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/htop/$(HTOP_VERSION)
+HTOP_DEPENDENCIES = ncurses
+HTOP_AUTORECONF=YES
+
+$(eval $(call AUTOTARGETS,package,htop))

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] Add Package:  htop
  2011-03-28 18:47 Andy Kennedy
@ 2011-04-16 20:57 ` Peter Korsgaard
  0 siblings, 0 replies; 14+ messages in thread
From: Peter Korsgaard @ 2011-04-16 20:57 UTC (permalink / raw)
  To: buildroot

>>>>> "Andy" == Andy Kennedy <Andy.Kennedy@adtran.com> writes:

 Andy> Adds package htop.  Changes made based upon e-mails with Mike Frysinger
 Andy> and Gerhard Heift.  The autoreconf change is important for anyone using
 Andy> uClibc as there is no widely available backtrace (yet).

Committed with minor fixes, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2011-04-16 20:57 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-25 22:47 [Buildroot] Add Package: htop Andy Kennedy
2011-03-26 14:23 ` Gerhard Heift
  -- strict thread matches above, loose matches on Subject: below --
2011-03-28 18:47 Andy Kennedy
2011-04-16 20:57 ` Peter Korsgaard
2011-03-28 16:02 Andy Kennedy
2011-03-28 16:18 ` Mike Frysinger
2011-03-28 17:21   ` ANDY KENNEDY
2011-03-28 17:37     ` Mike Frysinger
2011-03-28 17:43       ` ANDY KENNEDY
2011-03-28 18:39         ` Mike Frysinger
2011-03-22 15:18 Andy Kennedy
2011-03-22 15:38 ` Mike Frysinger
2011-03-22 16:01   ` ANDY KENNEDY
2011-03-22 16:09     ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox