Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 05 May 2014 20:06:22 +0200
From:      Wolfgang Jenkner <wjenkner@inode.at>
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        Gerald Pfeifer <gerald@FreeBSD.org>
Subject:   ports/189444: [patch] USE_GCC=yes clashes with DEFAULT_VERSIONS
Message-ID:  <85d2fp5mee.fsf@iznogoud.viz>
Resent-Message-ID: <201405072110.s47LA0Ol090386@freefall.freebsd.org>

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

>Number:         189444
>Category:       ports
>Synopsis:       [patch] USE_GCC=yes clashes with DEFAULT_VERSIONS
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 07 21:10:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Wolfgang Jenkner
>Release:        FreeBSD 10.0-STABLE amd64
>Organization:
>Environment:
System: FreeBSD iznogoud.viz 10.0-STABLE FreeBSD 10.0-STABLE #0 r265095M: Tue Apr 29 20:38:44 CEST 2014 adm@iznogoud.viz:/usr/obj/usr/src/sys/IZNOGOUD-drm-update-38.a+ amd64


I have no gcc in base, but two versions from ports (without JAVA), viz.,

$ pkg info -x gcc
gcc48-4.8.3.s20140320
gcc49-4.9.1.s20140430

I want gcc49 to be selected for ports which set USE_GCC=yes in their
Makefile, so I use DEFAULT_VERSIONS for this.  As a minimal example,

$ cat /etc/make.conf
DEFAULT_VERSIONS=	gcc=4.9

>Description:
Take a port foo with a Makefile like

$ cat /tmp/foo/Makefile
# Created by: Nobody
# $FreeBSD$

PORTNAME=	foo
PORTVERSION=	0
CATEGORIES=	misc
DISTFILES=

MAINTAINER=	nobody@xxx.yy
COMMENT=	Hmm

USE_GCC=	yes

.include <bsd.port.mk>

>How-To-Repeat:
$ make -C /tmp/foo test-gcc
USE_GCC=4.9+
Port can use later versions.
GCC version: 4.2 - OSVERSION from 700042 to 9999999
GCC version: 4.6 - OSVERSION from 0 to 0
GCC version: 4.7 - OSVERSION from 0 to 0
GCC version: 4.8 (port) - OSVERSION from 0 to 0
GCC version: 4.9 (port) - OSVERSION from 0 to 0
Using GCC version 4.9
CC=gcc49 - CXX=g++49 - CPP=cpp49 - CFLAGS="-O2 -pipe -Wl,-rpath=/usr/local/lib/gcc49 -fno-strict-aliasing"
LDFLAGS=" -Wl,-rpath=/usr/local/lib/gcc49 -L/usr/local/lib/gcc49"
BUILD_DEPENDS=gcc49:/usr/ports/lang/gcc /usr/local/bin/as:/usr/ports/devel/binutils
RUN_DEPENDS=gcc49:/usr/ports/lang/gcc
$ make -C /tmp/foo missing
lang/gcc-ecj45

So, BUILD_DEPENDS and RUN_DEPENDS have bogus dependencies on lang/gcc.

>Fix:
Index: Mk/bsd.gcc.mk
===================================================================
--- Mk/bsd.gcc.mk	(revision 353027)
+++ Mk/bsd.gcc.mk	(working copy)
@@ -148,7 +148,7 @@
 .  if ${OSVERSION} < ${_GCCVERSION_${v}_L} || ${OSVERSION} > ${_GCCVERSION_${v}_R} || !exists(/usr/bin/gcc)
 V:=			${_GCCVERSION_${v}_V:S/.//}
 _GCC_PORT_DEPENDS:=	gcc${V}
-.   if ${_USE_GCC} == ${GCC_DEFAULT}
+.   if ${_USE_GCC} == ${GCC_DEFAULT} && empty(DEFAULT_VERSIONS:Mgcc=*)
 _GCC_PORT:=		gcc
 .   else
 _GCC_PORT:=		gcc${V}
>Release-Note:
>Audit-Trail:
>Unformatted:



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