pkg install lang/gcc
. To install older versions, for example gcc 8, execute pkg install lang/gcc8
.This will not create the gcc symlinks so when you type gcc -v it will error. The lang/gcc package installs the symlinks for you but if you install lang/gcc8, you have to create the symlinks yourselves.Hello,
pkg install lang/gcc
. To install older versions, for example gcc 8, executepkg install lang/gcc8
.
USE_GCC=8.4
.FAVORITE_COMPILER= gcc
USE_GCC= 8.4
USES += compiler
cc -v
shows version of /usr/bin/cc.# find /usr/bin -inum `ls -i /usr/bin/cc | cut -d ' ' -f 1`
/usr/bin/clang++
/usr/bin/cc
/usr/bin/cpp
/usr/bin/clang
/usr/bin/c++
/usr/bin/clang-cpp
DEFAULT_VERSIONS+= gcc=8
in /etc/make.conf is probably what you'd want if you wanted to build gcc8 and install symlinks to what gcc8 installs; the current default is actually gcc9. /usr/ports/Mk/bsd.default-versions.mk lists several other defaults. GCC_DEFAULT
directly in /etc/make.conf, DEFAULT_VERSIONS
is apparently the correct method, and you can see that it looks cleaner:## Old way
PYTHON_DEFAULT= 3.8
PYTHON3_DEFAULT= 3.8
WITH_BDB_VER=5
WITH_OPENSSL_PORT=yes
# Optionally, you specified the port name if you wanted to use an alternative to OpenSSL
OPENSSL_PORT= security/libressl
## New way
DEFAULT_VERSIONS+= bdb=5
DEFAULT_VERSIONS+= python=3.8 python3=3.8
DEFAULT_VERSIONS+= ssl=libressl