COPTFLAGS (not?) only for compiling the kernel?

Chuck Swiger cswiger at mac.com
Fri May 14 18:29:23 PDT 2004


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"...



More information about the freebsd-questions mailing list