- enable warnings in autogen script
- drop unused m4/ directory usage
- drop AC_TYPE_SIGNAL:
C99 guarantees the signal return type to be void
- drop AC_CHECK_FILE of procdir:
most of the time compilation is done on a different system than htop is run
and there is a runtime check in place
- improve linux_affinity corss compile logic:
use fourth argument instead of pre-test
Reasoning:
- implementation was unsound -- broke down when I added a fairly
basic macro definition expanding to a struct initializer in a *.c
file.
- made it way too easy (e.g. via otherwise totally innocuous git
commands) to end up with timestamps such that it always ran
MakeHeader.py but never used its output, leading to overbuild noise
when running what should be a null 'make'.
- but mostly: it's just an awkward way of dealing with C code.
Use configure.ac to handle platform differences where some
build hosts have only a python3, or only python, binary.
Related to https://github.com/htop-dev/htop/pull/6
A logic mistake in pull request #746 causes <sys/sysmacro.h> to be
*not* included when AC_HEADER_MAJOR (before autoconf-2.70) finds
'major' in <sys/types.h>. Though this would still build htop, it would
still bring deprecation warning in systems using glibc 2.25-2.27. Fix
the logic and suppress the warning.
Also, include config.h in Process.c for the sake of strengthening the
code.
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
This would prevent a careless future package maintainer from creating a
release tarball with a defective configure script. :)
Also, add a warning in the autogen.sh phase if pkg.m4 is unused.
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
With this commit:
* if pkgconfig is installed, it will expand the code inside the shell if, adding the pkgconfig-based tests for the dependencies of Linux delay accounting.
* if pkgconfig is not installed, it will add an error message inside the test of Linux delay accounting, telling the user to install pkgconfig and rebuild the configure script if they want to use Linux delay accounting.
The end result is:
* people running Linux
* will not need pkgconfig when not using delay accounting
* will need pkgconfig when using delay accounting
* if they don't have it
* they are told by configure they need to install it and re-run autogen.sh when running from Git
* they are told by configure they need to install it and re-run configure when running from the tarball
* people not running Linux
* will never need pkgconfig
...and in none of the above scenarios the generated configure script produces unexpanded macros for users checking out the sources from Git.
This commit adds support for Solaris, squashed from PR #741:
Summary of additions:
* Initial setup of Solaris platform directory
* Add Solaris platform into autoconf template
* Uptime and load averages
* Add dependency on libkstat
* Basic process listing
* Zone name display
* CPU detection
* Per-process memory and CPU usage parsed correctly
* Uses sysconf to discover number of CPUs, instead of more complex libkstat code
* Simple memory display working
* Reduce repetitive calls to the PAGE_SIZE macro when reading memory info
* Add Project, Contract, Task, and Pool into process properties
* Use system major()/minor() implementations and remove extraneous definition of mkdev()
* Get the STARTTIME column working properly, using the Linux implementation as a guide
The configure script relied on bash-specific extensions to shell syntax
and behavior, causing build failures on systems with other /bin/sh
implementations. This commit replaces those with equivalent constructs
that should work in all POSIX shells.
glibc 2.28 no longer defines 'major' and 'minor' in <sys/types.h> and
requires us to include <sys/sysmacros.h>. (glibc 2.25 starts
deprecating the macros in <sys/types.h>.) Now do include the latter if
found on the system.
At the moment, let's also utilize AC_HEADER_MAJOR in configure script.
However as Autoconf 2.69 has not yet updated the AC_HEADER_MAJOR macro
to reflect the glibc change [1], so add a workaround code.
Fixes#663. Supersedes pull request #729.
Reference:
[1] https://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commit;h=e17a30e987d7ee695fb4294a82d987ec3dc9b974
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>