Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 May 2004 21:31:12 -0400
From:      Chuck Swiger <cswiger@mac.com>
To:        platanthera <platanthera@web.de>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: COPTFLAGS (not?) only for compiling the kernel?
Message-ID:  <40A572E0.9050802@mac.com>
In-Reply-To: <200405150303.31682.platanthera@web.de>
References:  <200405132329.07892.platanthera@web.de> <20040513220325.GC2334@gothmog.gr> <200405150303.31682.platanthera@web.de>

next in thread | previous in thread | raw e-mail | index | archive | help
platanthera wrote:
> On Friday 14 May 2004 00:03, Giorgos Keramidas wrote:
[ ... ]
>> Yes, you do.  But I'm sure that you will find the make.conf(5)
>> manpage very informative and useful.  
> 
> not really. it says
> ...
> The /etc/make.conf file is included from the appropriate Makefile which      
> specifies the default settings for all the available options.  Options 
> need only be specified in /etc/make.conf when the system administrator
> wishes to override these defaults.
> ...

The manpage is correct.  /etc/make.conf behaves much the same way as 
/etc/rc.conf and other config files with regard to default values.

Take a look in /etc/defaults/make.conf, /etc/defaults/rc.conf, etc.

[ ... ]
> to my understanding this explains what CFLAGS/COPTFLAGS are intended for 
> and _implies_ you'd have to uncomment the flag definitions 
> in /etc/make.conf to set them active,  ....

Your understanding is not correct, although it's not clear what we should 
change to help resolve the confusion.

CFLAGS has a default value which will be used for everything you compile 
(meaning ports, the base system, and other things as well [1]) unless you 
specify something else.

> otherwise the settings specified in the respective Makefile would be used.

No, the various Makefiles throughout the system *don't* set CFLAGS for 
themselves, they inherit it.  The reason this happens is so that you, the 
user, can specify CFLAGS once, in a well-documented location, and actually 
have your settings respected by the various software you might compile.

> I had explicitly specified COPTFLAGS (-O -pipe) but not CFLAGS and saw 
> -O overriding -O2 when compiling a port...

Please tell us which port was listing the -O2?  Ports which disregard CFLAGS 
are considered BROKEN and ought to be fixed...

-- 
-Chuck

[1]: Observe what happens if one does "touch foo.c ; make foo.o"...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?40A572E0.9050802>