# Using gcc instead of Clang



## gpatrick (Jan 10, 2016)

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

```
.if !empty(.CURDIR:M/usr/ports/*) && exists(/usr/local/bin/gcc47)
CC=gcc47
CXX=g++47
CPP=cpp47
.endif
```
and also

```
USE_GCC=any
```
Neither of those worked.


----------



## kpa (Jan 11, 2016)

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:


```
FAVORITE_COMPILER= gcc
USE_GCC= 4.7
USES += compiler
```

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


----------

