mk: Improve handling of MLINKS - Use '.for' multi-variable loop to simplify the handling of MLINKS, and thus make the code cleaner and more readable. - Merge the MLINKS installation of man pages and catman pages, and thus remove duplicate code. - This change also gives one benefit: if MLINKS has odd-number items, make will just fail the parsing and refuse to execute. This can prevent messing up the man page hardlinks. As suggested by swildner, performed a 'maninstall' test and the result was identical. Obtained-from: FreeBSD (revisions 284685 and 295229)
Bump CSTD to gnu11 for world and kernel. In practice, I don't think this will change a lot for base code, and I am doing it mainly for contrib/ code which might in certain cases use different paths (for example zstd will). Also affected might be dports which use base's share/mk infrastructure, of which there are a few. I have compared the object directories with all temporary files (.s, .i) between a LINT64 kernel compiled with -std=gnu11 vs. one built with c99 and there were no differences whatsoever. Thanks to tuxillo for testing with a full bulk build. Note that the kernel was previously using c99 and has now been switched to gnu11, not c11. This is because we were always using GNU extensions in kernel code, so c99 should really have been gnu99 always. Also note that we could in theory have switched to gnu17 directly since c17 only addressed some defects in c11 and did not add new features, but I chose to use 11 because our secondary compiler does not support 17. Reminded-by: Peeter Must
build - Add zstd to the build (libzstd as private library) * Bring in contrib/zstd from FreeBSD. * Add libzstd as a private library (i.e. priv/libprivate_zstd) to avoid confusion. (Note that FreeBSD also has zstd in base as a private library). * Add zstd, unzstd, zstdcat, zstdmt utilities. * Integrate into libarchive, initrd, dsynth, and misc other base system elements. Ported-from: FreeBSD
Import stdbuf(1) together with libstdbuf(3) from FreeBSD The stdbuf(1) is a utility to change the initial buffering of stdin, stdout and stderr streams for a given command. It achieves this functionality by preloading the libstdbuf(3) library and configuring the needed environment variables. Under the hood, libstdbuf(3) library calls setvbuf(3) to do the actual work. Changes from FreeBSD: * Removed 32bit i386 code from stdbuf(1) * Fix typos and update HISTORY section in libstdbuf.3 man page * Update the example to actually work on DragonFly
sys.mk: Add the 's' modifier to our ARFLAGS. This allows us to remove most explicit executions of ranlib(1) and lorder(1)/tsort(1) during buildworld, although not all. Remaining are some 'ar -M' cases for static and profiling libstdc++ that still need ranlib(1). lorder(1)/tsort(1) are still used in the linking of shared libraries.
Remove local ar(1) operation code definitions and use ARFLAGS. Remove 'l' from ARFLAGS (serves no purpose) and add 'c' to silence archive creation warnings. Note that we do not need to care about 'D' because our binutils were configured with '--enable-deterministic-archives'. To be done later: Adding 's' and stop running lorder/ranlib explicitly.
gcc: Allow our C++ headers to survive -Wsystem-headers. It was breaking on defining a macro that resolves to a defined() directive, which is apparently an issue in C++ land. As a workaround, define a C++ specific macro that is either 0 or 1 for long long support and can be used without issues. Stop filtering out -Wsystem-headers in CXXFLAGS. The remaining -W... options that are filtered out are all C specific.
Stop mixing the userland specific <bsd.sys.mk> into the module build. I don't know why it was there initially because we inherited it this way. The only changes on the compile line are eliminating a -std=gcc99 (our userland -std setting) which was overridden by the kernel's own -std=c99 anyway, and a second copy of our kernel warning flags. By extension, it also makes the build log shorter by some percent.
share/doc: Remove documents that we haven't been installing for ages. While all of those are old and some of them are quite outdated, some others are actually still useful and have information that is not contained in any manual page (such as information on the internals of config(8), for example). But since we haven't been installing them since 15 years now (see ce233c472eb2cc66b348daa45965ffeb85ad7fe1) and they are archived elsewhere and easily findable on the web, remove them from our tree. Also, they would need groff in base to build, which is no longer the case in DragonFly since 1419a4e1759b9901ee3a1d147d0f7bee0394d6f3. See for example https://docs.freebsd.org/44doc/ for FreeBSD's archive.