Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Jan 2016 23:02:27 +0000
From:      Matthew Seaman <matthew@FreeBSD.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: USE_GCC
Message-ID:  <5692E303.7010501@FreeBSD.org>
In-Reply-To: <A6DDB557-4DBB-448F-B08F-A10CD5C57089@yahoo.com>
References:  <A6DDB557-4DBB-448F-B08F-A10CD5C57089@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--HOu5TjeUcxdecQspCnwd0VDlEq8lPOhek
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

On 10/01/2016 22:26, John Haraden via freebsd-questions wrote:
> I am running GCC on version 10.2.
> For the fortran compiler, the linker requires Wl, -rpath=3Dtarget libra=
ry.
> However, there is a message saying this happens transparently for ports=
 leveraging USE_GCC or USES=3Dcompiler.  What does this mean?  How do I l=
everage GCC?  Where do I get USE_GCC?  Where do I put USES=3Dcompiler?

As a ports user, you don't deal with stuff like 'USE_GCC' -- that's for
use when actually writing the port, something that really only port
maintainers need to do.

If you would prefer to use gcc rather than clang as your default
compiler when building ports, then you can add this to /etc/make.conf:

FAVORITE_COMPILER=3Dgcc

On the other hand, if you are actually porting some software then the
ideal in the ports is not to force usage of a specific compiler unless
absolutely necessary.  Instead, you tell the ports infrastructure what
language features the software you're compiling has (eg.
USES=3Dcompiler:c++11-lang -- the port is written in C++ according to the=

2011 standard) and the ports will pull in whatever compiler is available
on your particular CPU architecture / OS version and that fits your
FAVORITE_COMPILER preference as far as possible.

USES=3Dcompiler:foo is not exactly an introductory level topic when
starting to learn about the ports.  Don't be afraid to ask for advice on
the freebsd-ports@ mailing list if this is your use case.

On the gripping hand, if you just want to compile some code outside of
the ports, then *mostly* it's a case of setting make(1) variables like
CC or F77 to invoke your preferred binary.  Frequently you can do that
at the point you run autoconf which will write that choice into the
Makefiles it generates, but compilation systems vary.  Yes, the
particular compiler toolchain you choose will affect the arguments you
need to give to control the linker or other components.  It's best to
give a lot more detail about exactly what it is you're trying to
compile, what you tried, how you expected it to work and what actually
happened.  That way people can give you concrete advice rather than
having to guess what you actually mean.

	Cheers,

	Matthew



--HOu5TjeUcxdecQspCnwd0VDlEq8lPOhek
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2

iQJ8BAEBCgBmBQJWkuMLXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NTNBNjhCOTEzQTRFNkNGM0UxRTEzMjZC
QjIzQUY1MThFMUE0MDEzAAoJELsjr1GOGkATWwwP/j20SkSFYUYiuU031HbfjJE0
ySNZJ5pZgfR+B9f7N20CZ+gZtBrfua2bi2M92FcCRdv+pE40c8EpBhnu/hMA7Dsb
trsSEGDfpiTA+DfdusDi5jkkf0CD+UL+p3AWb5UBfrAg/lndOm4za/EnD/vJ17U5
5XjmDOWujFgjr3DFcAlmfTZpHuv5qzvfuUdCSc1r5j5IKuFrandxx5Vp8jGpjuZC
oHfcSqxmRxeDOmnYpVLiyRe7PnzXQrEFt5oCzPthF4nlsGlF263WihP383UIkGqm
b8MHPOFtGcMebfFFSYnxrJu3outq8GAAkc4kwsEUOe3ryXqoF2G/Dzgkb69reK39
hh0iqrATJvieInlj9UiSwDyAEiu+F3uLv2cDbgTW0+nllw/OwgvNM0XkUJeLsavv
72rmfgp3sW1U/MZsmrXm/QOq5RxD+bzBw6AWGhM5jvRr1B2tGsuKrXTrdl7Dx88X
gN0e2w0ixrc4xEunjvzrxVFQ25hc3/KtyEUv36ctpH1vxcu6MJAIu+56mUDJxEMX
nnAuVVlTy+Uv79OZv5ZPpXPhI/rueT5mdRQfvmcJKqQTWGv5ZXcsz7y3bpFo2gCh
7ASbtkZMTGfRvaP9isywUyOAUw8ylKkChepRtCv6M0NwTNJrEG5f05b6bJ6YdlOC
LR6jVcRqDuJwJaA0vUYs
=kQKv
-----END PGP SIGNATURE-----

--HOu5TjeUcxdecQspCnwd0VDlEq8lPOhek--



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