Shell (linux)update-alternatives equivalent on FreeBSD?

Hello. I would like to use a framework initially built on Linux. They use a command update-alternatives to specify that gcc points to gcc9 for example. Is there some equivalent on FreeBSD or I should modify the Makefiles or link gcc9 to gcc?
Maybe just exporting the command would be sufficient...

Thank you!
 
Choose your compiler through make.conf(5) by adding these arguments plus your selected compiler and its components:
Code:
CC=
CXX=
CPP=
The directory and the compiler, which is typically named for its version, will work. A compiler from ports would be somewhere under /usr/local/, either under bin, or a directory of the compiler name. This sets the compiler for ports, and is expected to also set the compiler for base and kernel. That won't override everything that's set for the compiler chosen by some ports.

I don't know the current status of GCC's ability to compile the kernel and base. If GCC is unable to build FreeBSD's base and kernel, hopefully they set it, so make.conf arguments don't override the default. If it's not taken care of, you'll need this to set the kernel and base to be set to the base clang compiler:
Code:
XCC=clang
XCXX=clang++
XCPP=clang-cpp
They likely have it working or the overrides set right, so XCC, XCXX and XCPP arguments may not be needed.

I actually thought this was documented in the Handbook, or in one easy spot to find in wiki, but it appears it's not. /usr/share/mk/bsd.compiler.mk sets a lot of how it works, so it shouldn't be altered, and it may provide clues.

Here are some pieces that can be looked at:
 
Back
Top