Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jun 2012 23:01:01 +0800 (CST)
From:      Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        Gerald Pfeifer <gerald@FreeBSD.org>
Subject:   ports/169449: [PATCH] Mk/bsd.gcc.mk: add a knob to use stable release instead of snapshots
Message-ID:  <3WM9Rx5Fd9z9Rp@sunpoet.net>
Resent-Message-ID: <201206261510.q5QFA7B4063208@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         169449
>Category:       ports
>Synopsis:       [PATCH] Mk/bsd.gcc.mk: add a knob to use stable release instead of snapshots
>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:   Tue Jun 26 15:10:07 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Sunpoet Po-Chuan Hsieh
>Release:        FreeBSD 9.0-STABLE amd64
>Organization:
SUNPOET.net
>Environment:
System: FreeBSD bonjour.sunpoet.net 9.0-STABLE FreeBSD 9.0-STABLE #0: Sat Jun 23 18:28:28 CST 2012 sunpoet@bonjour.sunpoet.net:/usr/obj/usr/src/sys/bonjour amd64

	
>Description:

This patch introduces a new knob "USE_GCC_RELEASE". It provides an opportunity
for users who prefer stable release (lang/gcc) rather than snapshots (lang/gcc4*)
to stay with lang/gcc if its version satisfies USE_GCC requirement. It is
useful in tinderbox.

For example, a port with USE_GCC=4.6+ will depend on lang/gcc46 if lang/gcc was
not installed. With USE_GCC_RELEASE=yes, the port will depend on lang/gcc
instead of lang/gcc46. It eases the pain to rebuild snapshot again and again
(weekly/bi-weekly/monthly updates).

Maintainer (gerald@FreeBSD.org) is cc'd.

	
>How-To-Repeat:
	
>Fix:

--- bsd.gcc.mk.patch begins ---
Index: Mk/bsd.gcc.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.gcc.mk,v
retrieving revision 1.66
diff -u -r1.66 bsd.gcc.mk
--- bsd.gcc.mk	26 Jun 2012 13:54:59 -0000	1.66
+++ bsd.gcc.mk	26 Jun 2012 14:09:51 -0000
@@ -16,6 +16,8 @@
 #   USE_GCC=	4.2+		# port requires GCC 4.2 or later.
 #   USE_GCC=	4.7			# port requires GCC 4.7.
 #
+#   USE_GCC_RELEASE=yes		# use lang/gcc if its version satisfies USE_GCC
+#
 # If your port needs a Fortran compiler, please specify that with the
 # USE_FORTRAN= knob.  Here is the list of options for that knob:
 #
@@ -36,7 +38,7 @@
 
 # All GCC versions supported by the ports framework.  Keep them in
 # ascending order and in sync with the table below. 
-GCCVERSIONS=	030402 040200 040400 040600 040700
+GCCVERSIONS=	030402 040200 040400 040600 040700 RELEASE
 
 # The first field if the OSVERSION in which it appeared in the base.
 # The second field is the OSVERSION in which it disappeared from the base.
@@ -46,6 +48,7 @@
 GCCVERSION_040400=	     0       0 4.4
 GCCVERSION_040600=	     0       0 4.6
 GCCVERSION_040700=	     0       0 4.7
+GCCVERSION_RELEASE=	     0       0 ${GCC_DEFAULT_VERSION}
 
 GCC_DEFAULT_VERSION=	4.6
 GCC_DEFAULT_V=	${GCC_DEFAULT_VERSION:S/.//}
@@ -177,7 +180,11 @@
 .for v in ${GCCVERSIONS}
 . if ${_USE_GCC} == ${_GCCVERSION_${v}_V}
 .  if ${OSVERSION} < ${_GCCVERSION_${v}_L} || ${OSVERSION} > ${_GCCVERSION_${v}_R}
+.if defined(USE_GCC_RELEASE) && ${_USE_GCC:S/.//} <= ${GCC_DEFAULT_V}
+V:=			# empty
+.else
 V:=			${_GCCVERSION_${v}_V:S/.//}
+.endif
 _GCC_BUILD_DEPENDS:=	gcc${V}
 _GCC_PORT_DEPENDS:=	gcc${V}
 CC:=			gcc${V}
--- bsd.gcc.mk.patch ends ---
	


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3WM9Rx5Fd9z9Rp>