Commit Graph

191 Commits

Author SHA1 Message Date
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
Christian Göttsche 5e103ff9d1 configure: overhaul option handling
Switch Linux capabilities default from "no" to "check"

Document default settings

Use more readable formatting
2021-01-25 17:54:37 +01:00
Daniel Lange 6f6e0ec571 Update copyright for 2021 2021-01-22 20:06:51 +01:00
Christian Göttsche 4dadbe3b34 configure: add -Winit-self warning 2021-01-21 19:49:07 +01:00
James Abbatiello b20bb543ce Find the correct library for clock_gettime before trying to use it
Otherwise if clock_gettime is librt then this code will incorrectly believe
that the function does not exist at all.
2021-01-20 15:04:03 +01:00
Christian Göttsche f4404effa4 Add option to drop Linux capabilities
Conflicts with setuid support, but that is commonly not enabled.
2021-01-11 20:19:51 +01:00
Daniel Lange 58ce887d14 Update version number to 3.0.6-dev to identify git repo builds 2021-01-11 18:59:55 +01:00
Daniel Lange ce6d60e7de Release 3.0.5 2021-01-11 18:18:21 +01:00
Nathan Scott 0672be7db1 Update version number for git repo builds 2020-12-22 17:41:14 +11:00
Nathan Scott 0b989ee38c Bump version number for 3.0.4 release 2020-12-22 17:39:42 +11:00
Christian Göttsche 8db8b9edac DragonFlyBSD update
- drop unused kinfo includes and link argument
- detect kvm library necessity at configure step
- fix variable typo
2020-12-20 18:22:41 +01:00
Christian Göttsche c150e4bde9 Enable -Wformat=2
Now that the global format variable Process_pidFormat is gone, enable
the compiler warning -Wformat=2.
2020-12-19 21:13:32 +01:00
Christian Göttsche 26993d2d2b Support clock_gettime() on OSX El Capitan and earlier 2020-12-18 22:43:21 +01:00
Benny Baumann f32f0188cd Correct timebase for non-x86 CPUs on Darwin
Fixes: #368
2020-12-13 11:47:34 +01:00
Chris Burr ab60f59ed8 Check if clock_gettime needs linking of librt 2020-12-13 00:55:50 +01:00
Benny Baumann 880eecabf5 Indentation and line continuation fixes in configure.ac 2020-12-12 19:49:52 +01:00
Christian Göttsche ead978bce6 configure: check for additional linker flags for keypad(3)
Gentoo requires an explicit addition of -ltinfo

Resolves: https://bugs.gentoo.org/show_bug.cgi?id=690840
2020-12-07 15:33:16 +01:00
Nathan Scott 4f88d38256 Correct the version of htop development repo 2020-12-07 19:57:44 +11:00
Nathan Scott f03f48a0fb Change version string to note development repo build 2020-12-07 12:16:06 +11:00
Nathan Scott ad8aa2ce77 Bump version number for 3.0.3 release 2020-12-07 11:49:14 +11:00
Nathan Scott 1f9e2ded9e Update changelog for upcoming 3.0.3 release, annotate rc1 2020-12-04 14:05:27 +11:00
Christian Göttsche 4f08d2d5ad Fix sensors configure argument 2020-12-03 16:42:38 +01:00
Christian Göttsche b76eaf187a Dynamically load libsensors at runtime 2020-12-02 21:03:24 +01:00