From owner-freebsd-hackers@FreeBSD.ORG Thu Dec 21 17:16:08 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 13EC616A50D for ; Thu, 21 Dec 2006 17:16:08 +0000 (UTC) (envelope-from fcash@ocis.net) Received: from smtp.sd73.bc.ca (smtp.sd73.bc.ca [142.24.13.140]) by mx1.freebsd.org (Postfix) with ESMTP id D8EF513C428 for ; Thu, 21 Dec 2006 17:16:07 +0000 (UTC) (envelope-from fcash@ocis.net) Received: from localhost (localhost [127.0.0.1]) by localhost.sd73.bc.ca (Postfix) with ESMTP id 021B91A000B3B for ; Thu, 21 Dec 2006 08:56:03 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at smtp.sd73.bc.ca Received: from smtp.sd73.bc.ca ([127.0.0.1]) by localhost (smtp.sd73.bc.ca [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 73+2qYvzP5mc for ; Thu, 21 Dec 2006 08:56:02 -0800 (PST) Received: from s10.sbo (s10.sbo [192.168.0.10]) by smtp.sd73.bc.ca (Postfix) with ESMTP id EDAE71A000B31 for ; Thu, 21 Dec 2006 08:56:01 -0800 (PST) From: Freddie Cash To: freebsd-hackers@freebsd.org Date: Thu, 21 Dec 2006 08:56:00 -0800 User-Agent: KMail/1.9.5 References: <458A0620.5020905@u.washington.edu> In-Reply-To: <458A0620.5020905@u.washington.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200612210856.00910.fcash@ocis.net> Subject: Re: Properly controlling CFLAGS/CXXFLAGS X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2006 17:16:08 -0000 On Wednesday 20 December 2006 07:57 pm, Garrett Cooper wrote: > Hello, > Coming from Gentoo we were taught how to 'rice' our machines. > Based on my experience though with FreeBSD, this is an improper > methodology for one to use. > I was wondering (looking at the make.conf manpage), what's the > best way to control one's CFLAGS/CXXFLAGS. I'd prefer if only a few > ports would have optimized compiler flags, while the rest of the system > used a safe set of compiler flags. > So, I was wondering what the best course of action for setting > variables in /etc/make.conf would be? Is this proper given what I'm > trying to accomplish: > > /etc/make.conf snippet: > CFLAGS= -O2 -pipe > CXXFLAGS= ${CFLAGS} > COPTFLAGS= ${CFLAGS} -msse -msse2 -mfpmath=sse,387 > > NO_CPU_CFLAGS="YES" > NO_CPU_COPTFLAGS="YES" > > CPUTYPE?=pentium4 My suggestion is to leave all mention of *CFLAGS out of /etc/make.conf to use the system defaults (-O2 -pipe -fno-strict-aliasing), set CPUTYPE accordingly, and install sysutils/portconf. That gives you a separate /usr/local/etc/ports.conf file where you can set global and per-port settings that are only used when compiling things under /usr/ports (actually $PORTSDIR). -- Freddie Cash fcash@ocis.net