need help building port with clang

Eygene Ryabinkin rea at freebsd.org
Tue Sep 4 17:52:04 UTC 2012


Tue, Sep 04, 2012 at 01:45:51AM -0400, AN wrote:
> I use the base compiler for world and most ports, I do not want to
> change at this time.  So, my question is how can I tell
> Firefox-nightly to use clang?  Is there an equivalent to
> USE_GCC=4.8+ for clang that I can put in the makefile?  I want to
> use clang to compile this specific port, and let the base compiler
> build the rest.

Add the following lines to your /etc/make.conf
{{{
.if ${.CURDIR:M/usr/ports/www/firefox-nightly}
CC=clang
CXX=clang++
CPP=clang-cpp
.endif
}}}

Adjust the path to the port to your taste, but keep in mind that
this should be the realpath(1) of your port location.

For multiple ports you can use
{{{
.if ${.CURDIR:M<path1>}
I_WANT_CLANG=desperately
.endif

.if ${.CURDIR:M<path2>}
I_WANT_CLANG=desperately
.endif

.ifdef I_WANT_CLANG
CC=clang
CXX=clang++
CPP=clang-cpp
.endif
}}}
to avoid useless repetition.
-- 
Eygene Ryabinkin                                        ,,,^..^,,,
[ Life's unfair - but root password helps!           | codelabs.ru ]
[ 82FE 06BC D497 C0DE 49EC  4FF0 16AF 9EAE 8152 ECFB | freebsd.org ]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 227 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20120904/3921a92b/attachment.pgp


More information about the freebsd-ports mailing list