From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Sep 16 01:50:01 2010 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C439A1065697 for ; Thu, 16 Sep 2010 01:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 7FBBA8FC15 for ; Thu, 16 Sep 2010 01:50:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o8G1o1nM005164 for ; Thu, 16 Sep 2010 01:50:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o8G1o1Vu005163; Thu, 16 Sep 2010 01:50:01 GMT (envelope-from gnats) Resent-Date: Thu, 16 Sep 2010 01:50:01 GMT Resent-Message-Id: <201009160150.o8G1o1Vu005163@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dmitry Marakasov Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86CBB1065670 for ; Thu, 16 Sep 2010 01:41:42 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from smtp.timeweb.ru (smtp.timeweb.ru [92.53.116.15]) by mx1.freebsd.org (Postfix) with ESMTP id 43F0B8FC14 for ; Thu, 16 Sep 2010 01:41:41 +0000 (UTC) Received: from [213.148.20.85] (helo=hive.panopticon) by smtp.timeweb.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.71) (envelope-from ) id 1Ow3To-0001gn-Hc for FreeBSD-gnats-submit@freebsd.org; Thu, 16 Sep 2010 05:41:40 +0400 Received: from hades.panopticon (hades.panopticon [192.168.0.32]) by hive.panopticon (Postfix) with ESMTP id E221BB84D for ; Thu, 16 Sep 2010 05:41:39 +0400 (MSD) Received: by hades.panopticon (Postfix, from userid 1000) id D221CB833; Thu, 16 Sep 2010 05:41:39 +0400 (MSD) Message-Id: <20100916014139.D221CB833@hades.panopticon> Date: Thu, 16 Sep 2010 05:41:39 +0400 (MSD) From: Dmitry Marakasov To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/150609: [bsd.gcc.mk]: support overriding gcc/g++ X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Dmitry Marakasov List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 01:50:01 -0000 >Number: 150609 >Category: ports >Synopsis: [bsd.gcc.mk]: support overriding gcc/g++ >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Sep 16 01:50:01 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Dmitry Marakasov >Release: FreeBSD 8.1-RELEASE i386 >Organization: >Environment: System: FreeBSD hades.panopticon 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Fri Jul 30 02:50:28 MSD 2010 root@hades.panopticon:/async/obj/usr/src/sys/HADES i386 >Description: It's possible to override CC and CXX, and that's particularly useful for using ccache to build ports: one has to define CC=/usr/local/libexec/ccache/cc and CXX=/usr/local/libexec/ccache/c++ in the environement. However, that's not possible with ports that define USE_GCC >= 4.2, as gccNN and g++NN compilers are hardcoded. This change makes it possible to override these as well, e.g. GCCNN_PREFIX=/usr/local/libexec/ccache/gcc GXXNN_PREFIX=/usr/local/libexec/ccache/g++ for ccache, in which case /usr/local/libexec/ccache/g{cc,++}44 will be used for USE_GCC=4.4, etc. The same thing works for at least distcc, possibly has other appliances. >How-To-Repeat: >Fix: --- bsd.gcc.mk.patch begins here --- Index: bsd.gcc.mk =================================================================== RCS file: /home/amdmi3/projects/freebsd/FreeBSD.cvs/ports/Mk/bsd.gcc.mk,v retrieving revision 1.46 diff -u -r1.46 bsd.gcc.mk --- bsd.gcc.mk 4 Sep 2010 17:08:27 -0000 1.46 +++ bsd.gcc.mk 16 Sep 2010 01:24:54 -0000 @@ -48,6 +48,11 @@ GCCVERSION_040500= 999999 999999 4.5 GCCVERSION_040600= 999999 999999 4.6 +# User may override these to use wrappers for numbered gcc/g++, e.g +# /usr/local/libexec/ccache/gcc and /usr/local/libexec/ccache/g++ +GCCNN_PREFIX?= gcc +GXXNN_PREFIX?= g++ + # # No configurable parts below this. # @@ -93,13 +98,13 @@ RUN_DEPENDS+= g77-34:${PORTSDIR}/lang/gcc34 FC:= g77-34 F77:= g77-34 -CC:= gcc34 -CXX:= g++34 +CC:= ${GCCNN_PREFIX}34 +CXX:= ${GXXNN_PREFIX}34 . else F77:= f77 FC:= f77 -CC:= gcc -CXX:= g++ +CC:= ${GCCNN_PREFIX} +CXX:= ${GXXNN_PREFIX} . endif . else @@ -189,8 +194,8 @@ V:= ${_GCCVERSION_${v}_V:S/.//} _GCC_BUILD_DEPENDS:= gcc${V} _GCC_PORT_DEPENDS:= gcc${V} -CC:= gcc${V} -CXX:= g++${V} +CC:= ${GCCNN_PREFIX}${V} +CXX:= ${GXXNN_PREFIX}${V} . if ${_USE_GCC} != 3.4 CFLAGS+= -Wl,-rpath=${LOCALBASE}/lib/${_GCC_BUILD_DEPENDS} LDFLAGS+= -Wl,-rpath=${LOCALBASE}/lib/${_GCC_BUILD_DEPENDS} --- bsd.gcc.mk.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: