Closed vtorri closed 1 year ago
@michaelforney If you agree, I can make a PR for this
This can be made into an elif
in #87, which also adds the guards for macOS.
@capezotte I don't know. Maybe @michaelforney has an opinion about this
I don't want to add a bunch of platform-specific ifdefs to samurai. Now it is disabled by default, which should fix the build issue on Solaris (and other platforms).
If you want to enable it, add -D HAVE_GETLOADAVG
to your CFLAGS
and patch build.c
to include sys/loadavg.h
.
Would michaelforney accept a meson project that tries to automate detection of stuff? No need to maintain it
Other than that, most of these special ifdefs can go to a file the maintainer doesn't need to see or edit (and can ignore issues that reference that file)
like compat.h or something like that
@vtorri how about system.h
https://github.com/wdlkmpx/samurai/commit/debf6309f5b6c696e5700278f324e6131689a464
Something like that. that fork can be used to add stuff that has been rejected (or that would be rejected), and rebase on top of upstream when it gets updated. Some some sort of samurai+
Sounds like a good idea doesn't it?
The problem with ifdefs is that there are several ways to group them to achieve the same results, of course the most readable approach should prevail. That means additional commits or force-push the amended commit. But it can be done
I'm not interested in meson. make works everywhere and is a POSIX standard tool. meson isn't and only supports a hardcoded set of compilers. I'm also not interested in ifdefs, even if they are contained in a single file.
It is simple enough for the packager to add CFLAGS='-D HAVE_GETLOADAVG -include sys/loadavg.h'
to their make invocation.
See its man page
so something like this in build.c