Using gcc instead of Clang

There is an application that I can build on 9.3 because it still uses gcc, however the application will fail to build with Clang. After installing gcc, what needs to be set in /etc/make.conf and/or /etc/src.conf to have builds use gcc?

I've already tried in /etc/make.conf
Code:
.if !empty(.CURDIR:M/usr/ports/*) && exists(/usr/local/bin/gcc47)
CC=gcc47
CXX=g++47
CPP=cpp47
.endif
and also
Code:
USE_GCC=any
Neither of those worked.
 
Your first snippet is going to fail under poudriere because at the time of the compilation the jail won't have file /usr/local/bin/gcc47 installed unless the port explicitly request for GCC in its Makefile. What you should do according to /usr/ports/Mk/Uses/compiler.mk and /usr/ports/Mk/bsd.gcc.mk is to have these lines in the port's Makefile:

Code:
FAVORITE_COMPILER= gcc
USE_GCC= 4.7
USES += compiler

Don't set those in /etc/make.conf globally.
 
Back
Top