[Slackbuilds-users] Template updates, 20261004
B. Watson
urchlay at slackware.uk
Mon Oct 5 06:16:09 UTC 2026
On Mon, 5 Oct 2026, Duncan Roe via SlackBuilds-users wrote:
> w.r.t. make, I was going to suggest
>
> `make || make -j1 V=1`
>
> Like Pat does in his SBs, except add V=1.
>
> Whether or not you're using MAKEFLAGS=-j<n>, this reduces the log file size (if
> you keep logs) and gives you diagnostics when you want them.
Well, I'd want that to be written:
make V=1 || make -j1 V=1
I don't want to only see the verbose make output if make fails the
first time around.
The diagnostics I want to see include the actual compiler flags, to
verify that SLKCFLAGS are actually getting passed properly, and not
being overridden later on the command line.
For instance, if the compile command looks like:
gcc -g -Dwhatever=1 -I./include -O0 -c foo.c
...then I know SLKCFLAGS aren't being passed (because I don't see -O2
-fPIC, or the --march=i586 stuff if I'm on 32-bit).
Another example:
gcc -O2 -fPIC -Dwhatever=1 -I./include -O3 -c foo.c
...the "-O2 -fPIC" came from SLKCFLAGS. But, following that there's a
-O3. The -O<n> options are taken in order, and the last one wins, so
that means it's being built with -O3.
In a case like that, there are 2 choices:
1. Let upstream win. Get rid of SLKCFLAGS entirely, let them use
the flags they want.
2. Patch or sed the Makefile (or configure, meson, cmake, etc script)
to get rid of the offending -O3.
For most stuff, I tend to choose the 2nd option. But for anything
that really needs performance (emulators, realtime audio processing),
I might leave upstream's flags in place.
A few builds, I've even gone to the trouble of making the flags
user-selectable, controlled with e.g. FORCE_SLACK_CFLAGS=yes in the
environment. Not sure anyone (including me) ever actually cared enough
to set that variable though.
The disadvantage of "make || make -j1" (with or without V=1) is,
I might not notice that the initial make fails... if I know "make
-j9" will fail, I might actually be able to fix it by patching the
Makefile. Which will benefit everyone (or at least everyone who sets
MAKEFLAGS).
More information about the SlackBuilds-users
mailing list