From owner-freebsd-current@FreeBSD.ORG Fri Aug 20 12:08:38 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E091716A4CF for ; Fri, 20 Aug 2004 12:08:38 +0000 (GMT) Received: from fillmore.dyndns.org (port-212-202-50-15.dynamic.qsc.de [212.202.50.15]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9F26D43D1F for ; Fri, 20 Aug 2004 12:08:36 +0000 (GMT) (envelope-from eikemeier@fillmore-labs.com) Received: from dhcp-10.local ([172.16.0.10]) by fillmore.dyndns.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.41 (FreeBSD)) id 1By8C9-000MFp-I8; Fri, 20 Aug 2004 14:08:36 +0200 Date: Fri, 20 Aug 2004 14:08:33 +0200 Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v482) To: Garance A Drosihn From: Oliver Eikemeier In-Reply-To: Message-Id: Content-Transfer-Encoding: 7bit User-Agent: KMail/1.5.9 cc: current@freebsd.org Subject: Re: setting CFLAGS in /etc/make.conf X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2004 12:08:39 -0000 Garance A Drosihn wrote: > Back in March I was working on an updated version of the net/cap > port, and I noticed this problem with CFLAGS in /etc/make.conf vs > CFLAGS in the makefile of a port. (So I am pretty sure this issue > has nothing to do with the recent changes to `make'.) Sure. I even tested it with make(1) from 4.7. This has been there for ages. > What I ended up doing was changing the net/cap/Makefile to set > CAP_CFLAGS instead of CFLAGS. The distributed net/cap source has > a bunch of Makefile.m4 files which are used to generate the real > makefiles, and those Makefile.m4 files were already adding a bunch > of values to CFLAGS. So, I changed a line (in net/cap/Makefile) > from: > > ${FIND} ${WRKSRC} -name Makefile.m4 \ > -exec ${REINPLACE_CMD} \ > -e 's/CFLAGS=/CFLAGS+=/' \{\} \; > > to: > > ${FIND} ${WRKSRC} -name Makefile.m4 \ > -exec ${REINPLACE_CMD} \ > -e "s/CFLAGS=/CFLAGS+=${CAP_CFLAGS} /" \{\} \; Jup, but this is hard to generalize. > I meant to follow up on this issue on the freebsd-ports mailing > list, but I guess I never got around to mentioning it. As near as > I could tell, it is just a bad idea for a ports-makefile to depend > on setting CFLAGS. Many do, but most just hardcode the CFLAGS value they see in the configuration step in the (generated) ports Makefile. I run into this recently with mail/exim. Of course it was possible to work around this too, but it happened only when certain configuration options where given *and* CFLAGS was set in /etc/make.conf. There must be a better way to deal with this. -Oliver