From owner-freebsd-questions Sat Aug 18 20:56:24 2001 Delivered-To: freebsd-questions@freebsd.org Received: from web14204.mail.yahoo.com (web14204.mail.yahoo.com [216.136.172.146]) by hub.freebsd.org (Postfix) with SMTP id CA63E37B40A for ; Sat, 18 Aug 2001 20:56:12 -0700 (PDT) (envelope-from mariodoria@yahoo.com) Message-ID: <20010819035612.79408.qmail@web14204.mail.yahoo.com> Received: from [148.243.246.4] by web14204.mail.yahoo.com; Sat, 18 Aug 2001 20:56:12 PDT Date: Sat, 18 Aug 2001 20:56:12 -0700 (PDT) From: Mario Doria Subject: Re: [NOT] SOLVED: Problem with '-O -pipe' showing up in CFLAGS / CXXFLAGS To: Matthew Emmerton , freebsd-ports@FreeBSD.ORG, freebsd-questions@FreeBSD.ORG In-Reply-To: <002b01c12861$95de5800$1200a8c0@gsicomp.on.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --- Matthew Emmerton wrote: > Aargh! > > Further investigation would indicate that the problem is even deeper > -- it's > in bsd.port.mk where CFLAGS and CXXFLAGS get seeded with the default > values > provided by make. Does anyone know how to turn off make's defaults, > aside > from manually setting CFLAGS= in the environment? > Edit /etc/make.conf and add a line with CFLAGS= > -- > Matt Emmerton > > ----- Original Message ----- > From: "Matthew Emmerton" > To: ; > Sent: Saturday, August 18, 2001 11:30 PM > Subject: SOLVED: Problem with '-O -pipe' showing up in CFLAGS / > CXXFLAGS > > > > Over the past while I've seen a few people having troubles building > ports > > and/or kernels. I always thought it was people setting CFLAGS > and/or > > CXXFLAGS in their environment improperly or having /etc/make.conf > configured > > with '-O -pipe', as did many others. > > > > However, it finally happened to me, and I know I don't do either of > these. > > After a couple of hours of investigation, the culprit was found: > BSD > make > > and improperly designed Makefiles. I'm posting my findings here in > hopes > > that others will find it useful. > > > > Take, for example, the Makefile for biology/xdrawchem, which > contains the > > following line: > > > > MAKE_ENV= CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" > QTDIR="${X11BASE}" > > > > Looks innocent enough, right? After all, we want MAKE_ENV to have > those > > things set right. However, this is WRONG, on two counts. > > > > First, bsd.port.mk will pick up CXX and CXXFLAGS (and CC and > CFLAGS) from > > the environment so they don't need to be set explicitly here. > > > > Second, if CXX and CXXFLAGS are *not* set in the environment, make > handily > > supplies its own defaults, which are inappropriate: > > > > gabby# make -X -V CXXFLAGS > > ${CXXINCLUDES} ${CFLAGS} > > gabby# make -X -V CFLAGS > > -O -pipe ${_CPUCFLAGS} > > > > This is why we end up with '-O -pipe' in CFLAGS/CXXFLAGS, and as > many > people > > have indicated, throws many things for a loop. (In my case, g++ > chews up > > 100% of available memory and swap while trying to optimize one of > the > source > > modules in xdrawchem.) > > > > -- > > Matt Emmerton > > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > > with "unsubscribe freebsd-questions" in the body of the message > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message Mario Doria __________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message