How to handle WITH_CLANG_IS_CC in ports
lifanov at mail.lifanov.com
Thu Nov 29 16:46:47 UTC 2012
On 11/29/2012 10:12 AM, Alberto Villa wrote:> On Tue, Nov 27, 2012 at
5:27 PM, Tobias Rehbein <tobias.rehbein at web.de> wrote:
>> Is there any chance you turn this into a generic Mk macro?
> I don't think so, it would mean running `cc --version` on every
> bsd.port.mk inclusion.
> Alberto Villa, FreeBSD committer <avilla at FreeBSD.org>
What I meant is to add something like a "setcc" target that port
Makefiles (that need this) can call.
@if [ ! -z "`cc -v 2>&1|grep clang`" ] ; then \
CC?= clang; \
CC?= gcc; \
Or this logic:
@if [ -z "$CC" ] ; then \
CC=`cc -v 2>&1|\
Then, in the Makefile, use it like this:
More information about the freebsd-ports