I wonder if
devel/gmake can be replaced with
gmake-lite that is called from ports'
Makefile's by editing
/usr/ports/Mk/Uses/gmake.mk.
Don't do that -- NO, NO!
You should NEVER edit the FreeBSD
ports(7) environment that way. You'll taint the system, and end up with error messages that make no sense at all, and may be unresolvable. Requiring you to essentially wipe your whole ports, or src, and have to start again, fresh.
Probably not at all what your hoping for.
However, you
can add all kinds of madness to your
make.conf(5) file --
remember my mentioning that to you in your quoted text?
Point being; all those goodies in
/usr/ports/Mk are there for port Maintainers, and for users to utilize when building ports on their system. Port Maintainers use them in the
Makefile they create for the port(s) they maintain. Users, can utilize many of those same KNOBS within their
make.conf(5) file, or at the command-line, via a
-D
switch. Honestly, I would end up writing an entire book here, attempting to explain it all. My recommendation to you is; have a good look at the
make.conf(5) page, you might even do well to read the
make(1) man(1) page. Then you could also read through some of the
ports(7) Makefiles to get an idea on how those KNOBS are used.
I'm afraid there's no "silver bullet" here. It's going to take some time, and experimentation on your part. That's how everyone "get's the hang of it".
Also I'd like to know if clang is always being called instead of gcc, regardless of which make is used, or how to override the options if another compiler is called.
Clang is the future,
resistance is futile.
Maybe not what you wanted to hear, and I
do understand. I fought it pretty heavily, and successfully got GCC in Base, as the default compiler (c, cc, c++, ...). The choice of compiler is greatly influenced by the
$PATH env. [typically] meaning; that what's in
/, and
/usr will be found
first, and subsequently,
used. So the biggest part of determining what gets chosen, will depend on what environment you have created, when building, and installing "world". You can influence this decision, by modifying
make.conf(5), and
src.conf(5).
This is how I accomplished making (GNU)GCC the base compiler:
Code:
#make.conf
WITHOUT_CLANG=true
FAVORITE_COMPILER=gcc
Code:
#src.conf
WITH_GCC=true
WITH_GCC_BOOTSTRAP=true
WITH_GNUCXX=true
WITHOUT_CLANG_BOOTSTRAP=true
WITHOUT_CLANG=true
WITHOUT_CLANG_IS_CC=true
I was then able to install additional versions of GCC, and Clang, from ports.
In the end, IMHO it was more work, than it was worth. Both using this setup, as well as honing everything to work as desired. But I am
very glad I did it. It ultimately gave me
much greater insight into the (FreeBSD) system, as a whole. Not that I wasn't already keenly aware. But FreeBSD is really in a state of flux, right now, and after
years of working with things the way they were and never having many changes in the toolchain. With the advent of Clang being the default in Base. Sort of turned everything up-side-down. So it was an effort well taken.
Sorry for replying in chunks. But I have a lot on my plate, right now. Hope this helps!
Best wishes,
sidetone.
--Chris