Commit Graph

213 Commits

Author SHA1 Message Date
Daniel Lange 2c3a64ac9c Year 2022 updates 2022-01-03 18:01:18 +01:00
Christian Göttsche 6388033e10 configure: support libunwind of LLVM
The libunwind headers of LLVM are located in the subdirectory
/usr/include/libunwind. Search that subdirectory when the default
header test fails. Also extend the include path due to the transitive
include of `<__libunwind_config.h>`.

Closes: #894
2021-12-16 17:51:15 +01:00
Nathan Scott 43e9be5a8f Update version number to 3.2.0-dev to identify git repo builds 2021-11-30 12:10:54 +11:00
Nathan Scott d73783d6db Release 3.1.2 2021-11-30 12:03:21 +11:00
Benny Baumann 13fe58f54a Update version number to 3.2.0-dev to identify git repo builds 2021-10-14 23:53:41 +02:00
Benny Baumann e785693ef9 Release 3.1.1 2021-10-14 23:42:05 +02:00
Christian Göttsche 970885edc3 Linux: improve tryRead macro safety
Add an explicit else clause so a following else branch for a prior if
condition does not get mixed up.

Also force a trailing semicolon and thereby silence current
-Wextra-semi-stmt warnings.

Improve readability of the hwloc_bitmap_foreach_begin loop macro.
2021-10-01 18:36:35 +02:00
Christian Göttsche 53732ab0bb Resolve -Wimplicit-int-conversion warnings
Panel.c:414:49: error: implicit conversion loses integer precision: 'int' to 'short' [-Werror,-Wimplicit-int-conversion]
      this->scrollH = MAXIMUM(this->selectedLen - this->w, 0);
                    ~         ~~~~~~~~~~~~~~~~~~^~~~~~~~~
./Macros.h:11:54: note: expanded from macro 'MAXIMUM'
#define MAXIMUM(a, b)                  ((a) > (b) ? (a) : (b))
                                                     ^

IncSet.c:159:38: error: implicit conversion loses integer precision: 'int' to 'char' [-Werror,-Wimplicit-int-conversion]
         mode->buffer[mode->index] = ch;
                                   ~ ^~

Panel.c:456:24: error: implicit conversion loses integer precision: 'int' to 'char' [-Werror,-Wimplicit-int-conversion]
         buffer[len] = ch;
                     ~ ^~
Panel.c:473:22: error: implicit conversion loses integer precision: 'int' to 'char' [-Werror,-Wimplicit-int-conversion]
         buffer[0] = ch;
                   ~ ^~
2021-10-01 18:36:35 +02:00
Daniel Lange e6ded48d1a Update version to 3.1.1-dev 2021-09-22 11:49:25 +02:00
Christian Göttsche 29e1fcfa05 Use libunwind for printing backtrace 2021-09-21 09:06:30 +02:00
Nathan Scott 29983ff83a Release 3.1.0 2021-09-21 16:30:46 +10:00
Nathan Scott c5fe142256 Bump to rc3, likely final release commits for 3.1.0 2021-09-20 16:34:39 +10:00
Nathan Scott ca06e68037 Fix a typo in a configure.ac comment 2021-09-08 12:11:58 +10:00
Benny Baumann a516e0852e Update configure to reflect rc2 in the version 2021-09-05 19:07:29 +02:00
Christian Göttsche 284f8c5e0b configure: output vserver as implied if ancient-vserver is enabled
The build time configuration ancient-vserver implies the configuration
vserver; say so in the configure status report if only ancient-vserver
has been specified.

Also indent with 3 spaces.
2021-09-04 09:48:53 +02:00
Nathan Scott 858ad8029d Update configure to reflect rc1 in the version 2021-08-27 12:14:23 +10:00
Christian Göttsche a5e2eff5e9 configure: resolve autotools 2.70 deprecation warnings
configure.ac:72: warning: The macro `AC_PROG_CC_C99' is obsolete.
    configure.ac:72: You should run autoupdate.
    ./lib/autoconf/c.m4:1659: AC_PROG_CC_C99 is expanded from...
    configure.ac:72: the top level
    configure.ac:134: warning: The macro `AC_HEADER_STDC' is obsolete.
    configure.ac:134: You should run autoupdate.
    ./lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from...
    configure.ac:134: the top level
2021-08-25 13:16:40 +02:00
Daniel Lange fc2377f052 Build pcp-htop.5 only when --enable-pcp 2021-08-14 10:44:31 +02:00
Nathan Scott 9a07ba2700
Merge pull request #705 from natoscott/pcp-htop-manual
docs: updates and new manual page for pcp-htop
2021-08-13 16:05:38 +10:00
Christian Göttsche aa0424ade8 configure: check for NaN compiler support
Compilers might due to optimizations, like -ffast-math (included in
-Ofast) expect floating point variables to be never NaN and replace each
call to isnan() with false.  Htop uses the value NaN for signaling no
data available for various information.

Warn at configure time if the compiler will ignore NaN values.

Note: this can not be implemented as a compile time static assert, as
some compilers handle compile NaNs differently than runtime NaNs.
2021-08-08 17:02:12 +02:00
nia fdcdc54ec4 netbsd: Add battery support
This uses proplib and sysmon_envsys to determine the total charge
percentage of any number of connected batteries as well as the
AC adapter state. Should work with ACPI and non-ACPI systems.
2021-08-05 10:47:14 +02:00
Nathan Scott 04da92dfd1 docs: updates and new manual page for pcp-htop
Add some words about pcp-htop to the main man page, and add a
new man page describing the pcp-htop configuration files that
allow new meters and columns to be defined at runtime.
2021-08-03 14:11:21 +10:00
Christian Göttsche 1fb0c720fe Enable affinity support for non-Linux
sched_getaffinity() and sched_setaffinity() are also available on BSDs.
Remove the Linux restraint.
2021-07-18 07:50:48 +02:00
nia 2ab8fb83ba netbsd: Support curses libraries without ncurses mouse support
This adds a configure check for the ncurses getmouse() function
and disables mouse-related code paths when mouse support is
not present in the curses library.

This is necessary for stable versions of NetBSD's libcurses, the
development version has stub mouse functions for compatibility
with ncurses.

Signed-off-by: Nia Alarie <nia@NetBSD.org>
2021-07-15 19:09:08 +02:00
nia 09c7e3e136 netbsd: Support building with libcurses
Right now Unicode support must be disabled, because htop peeks
into the ncurses cchar_t struct with Unicode enabled. NetBSD's cchar_t
has different contents.

Partially fixes #660

Signed-off-by: Nia Alarie <nia@NetBSD.org>
2021-07-13 20:42:30 +02:00
Benny Baumann 44d1200ca4 Check for alloc_size attribute in configure.ac 2021-07-06 17:20:32 +02:00
Benny Baumann 18e3fd5ce7 Check for set_escdelay in ncurses 2021-07-04 16:50:41 +02:00
fraggerfox 4b49de44a8 Add NetBSD platform support without procfs dependency
- TODO, clean up the code base and update comments in code.
2021-06-26 12:18:37 +02:00
Daniel Lange 8aca6fbfbd Change 3.0.6-dev -> 3.1.0-dev 2021-06-18 07:52:44 +02:00
Benny Baumann 92324d3461 Minor whitespace issue in configure.ac 2021-06-13 19:51:00 +02:00
Nathan Scott 94d37989b4 Use macros to PCPProcessList value extraction, tweak configure.ac
Resolves a couple of remaining review notes from @BenBE.
2021-06-09 17:09:29 +10:00
Nathan Scott 9ce9557e69 Various code tidyups based on review commentary from BenBE 2021-06-09 17:09:29 +10:00
Nathan Scott 6bb59f8881 Fix cut+paste typo in --enable-pcp error message 2021-06-09 17:09:29 +10:00
Nathan Scott c14a45ba35 Add a platform for Performance Co-Pilot (PCP) metrics
This introduces an initial platform for extracting metrics
using the PCP performance metrics API - PMAPI(3).  It can
be used via the --enable-pcp=yes configure option.

So far I've added support for live localhost metrics only,
and only using pre-defined metrics already found in htop.
If available, all sampling is performed by pmcd(1) - else,
we fallback to htop doing the metric sampling itself (all
below the PMAPI).  When pmcd is used, it may be configured
to run children with elevated privileges, so htop does not
need to be setuid (authentication with pmcd is available).

Additionally, the PMAPI allows us to support archives (for
historical analysis and for automated regression tests in
htop).  We'll need platform-specific command line argument
additions, which isn't yet feasible in htop (not difficult
to add though).

The goal of this first version is minimal impact in terms
of modifying the htop codebase, to introduce key ideas in
PCP (metric namespace, metadata, APIs and so on) and give
us something to discuss, experiment with and build on.
2021-06-09 17:09:29 +10:00
Christian Göttsche ee9e7edbc1 Solaris: handle ERR macro redefinitions
On OmniOS /usr/include/sys/regset.h redefines ERR to 13 - \r, breaking
the Enter key.
Since ncruses macros use the ERR macro, we can not use another name.

Closes: #634
2021-05-20 19:16:29 +02:00
Christian Göttsche 69cfaf2381 configure: ignore warning about delay accounting on non-Linux platform
If pkg-config is not installed the following message gets printed, even
on non Linux platform:

"Linux delay accounting support can not be enabled, cause pkg-config is
required for checking its availability"
2021-05-16 20:01:25 +02:00
Graham Inggs ee97916fd5
Merge pull request #436 from cgzones/freebsd
FreeBSD: add support for CPU frequency and temperature
Tested on two physical systems running FreeBSD 12.1
2021-03-18 14:03:51 +02:00
Christian Göttsche 8ba4ef327e configure: use portable AND
man:test(1)
    NOTE: Binary -a and -o are inherently ambiguous.  Use 'test EXPR1 &&
    test EXPR2' or 'test EXPR1 || test EXPR2' instead.

Also fix indent
2021-03-12 16:37:17 +01:00
Nathan Scott 5b50ae3aa3 Separate display from sampling in SysArch and Hostname Meters
Several of our newer meters have merged coding concerns in terms
of extracting values and displaying those values.  This commit
rectifies that for the SysArch and Hostname meters, allowing use
of this code with alternative front/back ends.  The SysArch code
is also refined to detect whether the platform has an os-release
file at all and/or the sys/utsname.h header via configure.ac.
2021-03-04 13:40:11 +11:00
Benny Baumann a73064dda9 Remove setuid support
This support was rarely ever used and has been disabled by default for some time.

As far as the developer team is aware there's no distribution that activated this
feature in their packages by default.
2021-02-17 15:59:50 +01:00
Daniel Lange 135efd5705 Enable making with -ggdb3 on configure --enable-debug 2021-02-16 11:24:45 +01:00
Christian Göttsche 7b1fa1bf49 Cache stderr to be able to print assert messages 2021-02-05 19:21:28 +01:00
Christian Göttsche fd2a0cf421 FreeBSD: add support for CPU frequency and temperature 2021-02-05 16:32:25 +01:00
Christian Göttsche 64a1ab848f configure: ignore usage of C11 _Generic on FreeBSD
BatteryMeter.c:30:8: error: '_Generic' is a C11 extension [-Werror,-Wc11-extensions]
   if (isnan(percent)) {
       ^
/usr/include/math.h:114:2: note: expanded from macro 'isnan'
        __fp_type_select(x, __inline_isnanf, __inline_isnan, __inline_isnanl)
        ^
/usr/include/math.h:82:39: note: expanded from macro '__fp_type_select'
#define __fp_type_select(x, f, d, ld) _Generic((x),                     \
                                      ^
1 error generated.
2021-02-05 15:20:00 +01:00
Christian Göttsche cae47bb28d configure: add -lelf for static build on FreeBSD 2021-02-05 15:15:01 +01:00
Christian Göttsche fd8c0611af Use different function on different detection method to avoid caching
Using the same function for the same library causes AC_CHECK_LIB to use
cached results.
Since we change the detection method via different or no
ncurses(5|6)-config invocation, avoid such caching by using different
functions.
2021-01-28 23:40:37 +01:00
Christian Göttsche 575edffb4b Add configure option to create static htop binary 2021-01-25 18:01:39 +01:00
Christian Göttsche 759a34039c configure: fail immediately on missing requirement 2021-01-25 17:57:21 +01:00
Christian Göttsche 38b6a0148f configure: misc modernizations
- require autoconf version 2.69
  was released in 2012 and one still can configure and build on older
  systems (just not generate the configure script)
- use modern C99 compiler check
- drop obsolete checks: AC_C_CONST, AC_FUNC_CLOSEDIR_VOID, AC_FUNC_STAT
- drop AC_HEADER_STDBOOL in favor of C99 compatibility
2021-01-25 17:57:21 +01:00
Christian Göttsche f3623b7880 configure: reformat for improved reabability 2021-01-25 17:57:21 +01:00