Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Sep 2013 15:17:53 +0200
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        ports@FreeBSD.org
Subject:   [HEADSUP][CFT] New compiler USES flag, please test, review comment
Message-ID:  <20130913131753.GJ33103@ithaqua.etoilebsd.net>

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

--q5r20fdKX+PFtYHw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,

Given how old our gcc in base is and the work done on clang and libc++.

It is becoming complicating to make some ports properly working on all supported
version of FreeBSD.

To help in that I would like to propose a new USES:
compiler

http://people.freebsd.org/~bapt/compiler.mk.txt

What it does is:

USES=compiler

Will set 2 variables:
COMPILER_TYPE to gcc or clang depending on the base compiler
COMPILER_VERSION wish will be the 2 first digits of the compiler version 46 for
gcc 4.6.* 33 for clang 3.3.*

USES=compiler:features
It creates a new COMPILER_FEATURES which will gather the supported features of
the compiler.

Features being:
libstdc++ if the c++ compiler uses libstdc++ by default
libc++ if the c++ compiler uses libc++ by default
And the standard supported by the compiler:
c89, c99, c11, gnu89, gnu99, gnu11, c++98, c++11, gnu++98, gnu++11

USES=compiler:c11

Means you need a c11 capable compiler, and if your default comiler is not able
to do it, it will picked clang33 by default of gcc 4.6+ if you specify in your
make.conf you do prefer gcc over clang

USES= compiler:c++11

Means you need a c++1 capable compiler but not necessary a c++ 11 aware standard
library, in that case if the base compiler is not able to support c++11 clang33
will be used from ports otherwise gcc 4.6+ if you specify it in make.conf.

USES= compiler=stdc++11

You need a c++11 aware stdlibrary, if the base compiler doesn't have it then gcc
4.6+ will be used.

To specify you do prefer gcc over clang by default add FAVORITE_COMPILER=gcc in
your make.conf

For all cases that does not fall into one of the above case continue using
USE_GCC as you where doing before

regards,
Bapt

--q5r20fdKX+PFtYHw
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iEYEARECAAYFAlIzEIEACgkQ8kTtMUmk6EzWAgCfWdnZhlM128ZnNBYC6Zakc/kU
B68AoLagYkORkH+ADcXqdHk1JA2IMHMf
=j/2p
-----END PGP SIGNATURE-----

--q5r20fdKX+PFtYHw--



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