How to build ports, using a version of clang installed from ports

Polytropon freebsd at edvax.de
Wed Jul 9 05:27:55 UTC 2014


On Wed, 9 Jul 2014 10:44:33 +1200, Stephen Woolerton wrote:
> I wish to compile a version of clang from ports, and then use that
> to build all my ports. 

First you have to install the desired clang version from ports.
The binaries will usually have a version suffix to distinguish
them from the binaries supplied with the v10 OS. Then you should
be able to add the following to /etc/make.conf:

	.if !empty(.CURDIR:M/usr/ports/*) && exists(/usr/local/bin/clang33)
	CC=clang33
	CXX=clang++33
	CPP=clang-cpp33
	.endif

(This is just an assumption regarding names, please check! I don't
have access to a v10 system at the moment.)

More info here:

https://wiki.freebsd.org/PortsAndClang

You can "translate" this concept to clang:

http://www.freebsd.org/doc/en/articles/custom-gcc/article.html


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list