[HEADSUP][CFT] New compiler USES flag, please test, review comment

Baptiste Daroussin bapt at FreeBSD.org
Fri Sep 13 13:17:59 UTC 2013


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20130913/a780ea21/attachment.sig>


More information about the freebsd-ports mailing list