From owner-freebsd-current@FreeBSD.ORG Fri Aug 20 14:20:31 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 023B616A4E1 for ; Fri, 20 Aug 2004 14:20:31 +0000 (GMT) Received: from smtp3.server.rpi.edu (smtp3.server.rpi.edu [128.113.2.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8BD9943D1D for ; Fri, 20 Aug 2004 14:20:30 +0000 (GMT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp3.server.rpi.edu (8.13.0/8.13.0) with ESMTP id i7KEJ3wp028313; Fri, 20 Aug 2004 10:19:03 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: References: Date: Fri, 20 Aug 2004 10:19:01 -0400 To: Oliver Eikemeier From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) 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 14:20:31 -0000 At 2:08 PM +0200 8/20/04, Oliver Eikemeier wrote: >Garance A Drosihn wrote: > >>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 think it would be easy to generalize, although for most ports you probably have to create a patch for the Makefile(s) instead of using a convenient ${REINPLACE_CMD} command. In general: the port makefile should set _CFLAGS (like "CAP_CFLAGS") and then change the makefiles distributed with the package so they have the line "CFLAGS+=_CFLAGS" >>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. This has the perhaps-unwanted side-effect that you have to 'make clean' a port any time you change CFLAGS in /etc/make.conf, and you want the port to pick up that change. That will probably be fine for most users in most occasions, but occasionally it may cause some confusion. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu