Bug 189444 - [patch] USE_GCC=yes clashes with DEFAULT_VERSIONS
Summary: [patch] USE_GCC=yes clashes with DEFAULT_VERSIONS
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Gerald Pfeifer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-07 22:10 UTC by wjenkner
Modified: 2014-10-11 16:35 UTC (History)
3 users (show)

See Also:


Attachments
file.diff (510 bytes, patch)
2014-05-07 22:10 UTC, wjenkner
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description wjenkner 2014-05-07 22:10:00 UTC
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.
Comment 1 Tijl Coosemans freebsd_committer freebsd_triage 2014-05-08 13:27:49 UTC
Responsible Changed
From-To: freebsd-ports-bugs->gerald

Over to maintainer.
Comment 2 CraigW 2014-09-20 22:13:12 UTC
I've run into this problem as well, your proposed patch helps me to override gcc version for specific ports.  Which I am trying to do with libcdr and chromium.
Comment 3 Gerald Pfeifer freebsd_committer freebsd_triage 2014-10-11 16:35:04 UTC
This patch as suggested would have picked lang/gcc47 (now lang/gcc48)
instead of lang/gcc when looking at the default case.

The following commit should address your reported issue; sorry for the
delay in addressing it:

r369328 | tijl | 2014-09-26 16:00:41 +0000 (Fri, 26 Sep 2014) | 9 lines

Depend on lang/gccXY if users wish to use a different version of gcc by
default than lang/gcc (currently 4.8).

(I don't fully agree with this implementation but this makes something
like DEFAULT_VERSIONS+=gcc=4.9 in make.conf work correctly.)

Reported by:    Luca Pizzamiglio <luca.pizzamiglio@gmail.com>
Approved by:    gerald