NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: toolchain/55174: build.sh has trouble with CFLAGS on /etc/mk.conf if it was used "+=" instead of "="



The following reply was made to PR toolchain/55174; it has been noted by GNATS.

From: Martin Husemann <martin%duskware.de@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: toolchain/55174: build.sh has trouble with CFLAGS on
 /etc/mk.conf if it was used "+=" instead of "="
Date: Tue, 14 Apr 2020 17:20:19 +0200

 On Tue, Apr 14, 2020 at 12:30:03PM +0000, Valery Ushakov wrote:
 >  The netbsd guide and pkgsrc guide should tell to protect pkg-related
 >  settings with proper ifdefs.  I was pretty sure this is documented,
 >  but apparetnly it's not and is only in the lore.
 
 Also the example should be changed - blindly forcing specific optimization
 flags is a bad idea in general.
 
 Forcing -pipe is ok, here is a working example:
 
 .if !defined(_ETC_MK_PIPE_DONE)
 _ETC_MK_PIPE_DONE=1
 CFLAGS += -pipe
 .endif
 
 The duplicate protection is needed due to make lazy variable expansion
 and resulting dependency loops (but I forgot the details).
 
 Martin
 


Home | Main Index | Thread Index | Old Index