From owner-freebsd-ports@FreeBSD.ORG Wed Jun 18 12:51:56 2008 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F83D1065672 for ; Wed, 18 Jun 2008 12:51:56 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: from mail5out.barnet.com.au (mail5.barnet.com.au [202.83.178.78]) by mx1.freebsd.org (Postfix) with ESMTP id 3C54B8FC1A for ; Wed, 18 Jun 2008 12:51:56 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: by mail5out.barnet.com.au (Postfix, from userid 1001) id 186EF2218A9F; Wed, 18 Jun 2008 22:51:55 +1000 (EST) X-Viruscan-Id: <485904EA0000C03BEC782D@BarNet> Received: from mail5auth.barnet.com.au (mail5.barnet.com.au [202.83.178.78]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail5auth.barnet.com.au", Issuer "*.barnet.com.au" (verified OK)) by mail5.barnet.com.au (Postfix) with ESMTP id CF64C21B3BF2 for ; Wed, 18 Jun 2008 22:51:54 +1000 (EST) Received: from k7.mavetju (unknown [10.10.26.6]) by mail5auth.barnet.com.au (Postfix) with ESMTP id C4D9F2218A62 for ; Wed, 18 Jun 2008 22:51:53 +1000 (EST) Received: by k7.mavetju (Postfix, from userid 1001) id 3D6D24E2; Wed, 18 Jun 2008 22:51:54 +1000 (EST) Date: Wed, 18 Jun 2008 22:51:54 +1000 From: Edwin Groothuis To: ports@freebsd.org Message-ID: <20080618125154.GC90685@k7.mavetju> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: Subject: Standardize NO_CCACHE flag and ccache definitions X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jun 2008 12:51:56 -0000 Hello, Recently I've started to use devel/ccache again (sometimes it takes a while before you understand how it works) and it works pretty well, except for some ports which can't be build with it. For example devel/cmake. To prevent everybody from having to re-invent the wheel, we could introduce a NO_CCACHE flag in the affected ports Makefile: NO_CCACHE=yes Unfortunately /etc/make.conf is read before the ports Makefile is read, so this in /etc/make.conf isn't going to work anymore: .if !defined(NO_CCACHE) CC=/usr/local/libexec/ccache/cc CXX=/usr/local/libexec/ccache/c++ CPP=/usr/local/libexec/ccache/cpp CCACHE_DIR=/usr/local/ccache .endif So, what is wisdom? Maybe this: Having a flag in /etc/make.conf to indicate you want to use devel/ccache: WANT_CCACHE=yes And in the ports Makefile you could have: NO_CCACHE=yes And in bsd.port.mk before the inclusion of bsd.gcc.mk: .if defined(WANT_CCACHE) && !defined(NO_CCACHE) CC?= ${LOCALBASE}/libexec/ccache/cc CXX?= ${LOCALBASE}/libexec/ccache/c++ CPP?= ${LOCALBASE}/libexec/ccache/cpp CCACHE_DIR?= ${LOCALBASE}/ccache .endif How about this approach? Edwin -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://www.mavetju.org/weblog/