setting CC/CXX/CPP unconditionally in src.conf

O. Hartmann ohartman at zedat.fu-berlin.de
Sun Feb 26 23:26:58 UTC 2012


On 02/26/12 23:38, Warner Losh wrote:
> 
> On Feb 26, 2012, at 2:37 PM, Alexander Best wrote:
> 
>> hi there,
>>
>> any chance support for setting CC/CXX/CPP unconditionally in src.conf could be
>> added before the release of freebsd 10.0? the way it is done atm is really not
>> intuitive. the rule should really be:
>>
>> - make.conf = applies globally
>> - src.conf  = applies only to /usr/src
>> ( maybe a ports.conf or port.conf could be introduced at some point, too)
>> ... the current situation, where only certain variables can be set in src.conf
>> is not ideal.
> 
> What doesn't work?  Or rather, how does it work now?
> 
> Warner
> 

At the moment, as far as I realized myself and read herin the mailing
list, setting

CC
CXX
CPP

in /etc/src.conf for only kernel builds doesn't work. I tried. I tried
hard! One must set these variables in /etc/make.conf.

The manpage for src.conf(5) is not clear. I would expect that even
compiler settings need to go into src.conf - that is the way I handled
it the first time and failed.

/etc/make.conf contains a mix of systemwide variables also involving the
/usr/src tree AND the ports tree. Since FreeBSD make a big deal being
different in keeping the core system and its ports, I'd expect a also
clear cut: everything that involves the coresystem (/usr/src) is about
to go into /etc/src.conf, everything that has to do with conditions for
ports should go elsewere (/usr/local/etc/ports.conf would be nice).

At this moment I personally keep conditions for the CLANG environment in
/etc/make.conf - partially conditional and unconditional. For each port
I stumble into which is incapable being compiled with CLANG or need
special features like OpenMP which is CLANg incapable of, do have their
conditional lines like

.if ${.CURDIR:M/usr/ports/graphics/ImageMagick*}
#USE_GCC=               4.6+
CC=                     cc
CXX=                    c++
CPP=                    cpp
.endif

This mixing in /etc/make.conf is messy and confusing.

Even if /etc/src.conf is only for booleans as "WITH_XXXX=YES" or
"WITHOUT_XXXX=YES", there should be a strict separation between the
source system and anything related to ports, even in case of costs of
having a kind of redundancy.

/etc/make.conf should define the base, even for /usr/src, etc/src.conf
should set conditions for /usr/src and another config, like the proposed
/etc/ports.conf or better /usr/local/etc/ports.conf should inherit
make.conf and override those variables if demanded by the user.

This is some kind of "wish" I'd like to see and that would make the OS
compiler configuration more logical.

Oliver

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-toolchain/attachments/20120226/db943cb8/signature.pgp


More information about the freebsd-toolchain mailing list