From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 22 09:08:50 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 DD12916A403 for ; Fri, 22 Dec 2006 09:08:50 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.freebsd.org (Postfix) with ESMTP id BA84613C41A for ; Fri, 22 Dec 2006 09:08:49 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (jgxwfw@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id kBM8oDCK037288; Fri, 22 Dec 2006 09:50:19 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id kBM8oDD0037287; Fri, 22 Dec 2006 09:50:13 +0100 (CET) (envelope-from olli) Date: Fri, 22 Dec 2006 09:50:13 +0100 (CET) Message-Id: <200612220850.kBM8oDD0037287@lurza.secnetix.de> From: Oliver Fromme To: freebsd-hackers@FreeBSD.ORG, youshi10@u.washington.edu In-Reply-To: <458A0620.5020905@u.washington.edu> X-Newsgroups: list.freebsd-hackers User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (FreeBSD/4.11-STABLE (i386)) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Fri, 22 Dec 2006 09:50:19 +0100 (CET) Cc: Subject: Re: Properly controlling CFLAGS/CXXFLAGS X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-hackers@FreeBSD.ORG, youshi10@u.washington.edu List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Dec 2006 09:08:50 -0000 Garrett Cooper wrote: > 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. The simplest way is to use conditionals in /etc/make.conf depending on the ports directory: .if ${.CURDIR:M*/somecategory/someport} CFLAGS= -O3 -pipe CFLAGS+= -DSOMETHING .endif > CFLAGS= -O2 -pipe Using -O2 without -fno-strict-aliasing will break certain programs. The default is -O2 -fno-strict-aliasing -pipe and it is _not_ recommended to override it globally, or otherwise you're guaranteed to shoot yourself in the foot, sooner or later. > COPTFLAGS= ${CFLAGS} -msse -msse2 -mfpmath=sse,387 That will break kernel compiles. Again, you should not override COPTFLAGS, unless you know exactly what you're doing. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. Passwords are like underwear. You don't share them, you don't hang them on your monitor or under your keyboard, you don't email them, or put them on a web site, and you must change them very often.