# All dependencies with same compiler



## talsamon (Aug 28, 2016)

Is there a way, to tell a port via /etc/make.conf to compile the port and its dependencies with the same compiler (or compiler-version).


----------



## cpm@ (Aug 28, 2016)

Check out /usr/share/examples/etc/make.conf


----------



## talsamon (Aug 29, 2016)

Thanks, but I find nothing about in this file and in `man make.conf`.


----------



## zirias@ (Aug 29, 2016)

Just set the variables (like `CC` for C, `CXX` for C++, etc) there. Ports that don't absolutely require a specific compiler will honor them.


----------



## talsamon (Aug 29, 2016)

Thanks, I was not sure, if it is so.


----------



## cpm@ (Aug 29, 2016)

Probably you should have a look at ports-mgmt/portconf if you haven't done.


----------



## talsamon (Aug 29, 2016)

Some time ago, I tested it, but sometimes it makes nonsense..


----------



## cpm@ (Aug 29, 2016)

Please, don't set global knobs in make.conf. Set them in ports.conf only in case that you decide to use the portconf framework.


----------



## marino (Aug 29, 2016)

setting CC and USE_GCC=yes in make.conf is a great way to fubar everything.  can you say circular dependencies?


----------



## Murph (Aug 30, 2016)

Bear in mind that you will run into situations where it's very difficult to meet the goal you seek here.  E.g. if you are building port A with the system compiler, port B with a compiler from ports, and they have a shared library dependency in common.

Personally, I recommend sticking to the default system compiler unless you have a really good reason for changing it or it is overridden by the ports tree for a particular port.  The most widely tested scenario is the one where you do not locally add any special overrides to default behaviour.  You lose supportability by going your own way, as most people using the port will not have your abnormal build configuration.  It invites random future failures when updating the ports tree, as it will not have been tested for your setup.

Clang is pretty good these days, so there really should not be a good reason for using something else if you are on a recent release of the OS.  Of course, there will always be narrow cases where there is a good reason for picking a specific compiler, just in general it shouldn't be necessary and may cause far more pain than any benefits gained from it.


----------



## talsamon (Aug 30, 2016)

That's clear. I also don't want change default settings, if I don't need it. In the moment it is a theoretically question. I don't need it yet, but maybe I need it in the future. I do not explain in the moment whats the reason. If the moment comes and I need it, I will do.


----------

