From owner-freebsd-hackers@FreeBSD.ORG Thu Dec 21 17:17:39 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 360B616A47C for ; Thu, 21 Dec 2006 17:17:39 +0000 (UTC) (envelope-from micahjon@ywave.com) Received: from relay0.av-mx.com (relay0.av-mx.com [137.118.16.125]) by mx1.freebsd.org (Postfix) with ESMTP id ED4F513C46C for ; Thu, 21 Dec 2006 17:17:38 +0000 (UTC) (envelope-from micahjon@ywave.com) X-Virus-Scan-Time: 2 Received: from [137.118.16.61] (HELO mx0.av-mx.com) by relay0.av-mx.com (CommuniGate Pro SMTP 4.2.10) with SMTP id 525295893 for freebsd-hackers@freebsd.org; Thu, 21 Dec 2006 11:17:24 -0500 Received: (qmail 2159 invoked from network); 21 Dec 2006 16:17:24 -0000 Received: from dsl18128.ywave.com (HELO ?192.168.1.66?) (micahjon@ywave.com@216.227.105.128) by 0 with SMTP; 21 Dec 2006 16:17:24 -0000 X-CLIENT-IP: 216.227.105.128 X-CLIENT-HOST: dsl18128.ywave.com Message-ID: <458AB394.1000205@ywave.com> Date: Thu, 21 Dec 2006 08:17:24 -0800 From: Micah User-Agent: Thunderbird 1.5.0.8 (X11/20061205) MIME-Version: 1.0 To: Garrett Cooper References: <458A0620.5020905@u.washington.edu> In-Reply-To: <458A0620.5020905@u.washington.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org 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:17:39 -0000 Garrett Cooper wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > 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 > > TIA! > - -Garrett sysutils/portconf might allow you to do what you want. I just use the following construct in make.conf though, and it seems to work. .if ${.CURDIR:M*/category/port} or .if ${.CURDIR:M*/category/port*} put port specific defines here .endif BTW, questions like this probably are best served on questions@ instead of hackers@. HTH, Micah