tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: defaulting to clang on FreeBSD 10.x



On Sun, Mar 22, 2015 at 11:32:43AM -0400, Greg Troxel wrote:
> 
> rodent%NetBSD.org@localhost writes:
> 
> > This is pretty easy to reproduce. However you've bootstrapped pkgsrc on
> > FreeBSD 10.x, whether with a mk-fragment or not, you can comment the
> > PKGSRC_COMPILER, CC, CXX, CPP, and CLANGBASE variables in mk.conf and pkgsrc
> > will want to build gcc-3 on that system to build any other packages.
> 
> So there is something wrong.
> 
> > Attached is a patch which fixes this behaviour for FreeBSD >= 10. OK to commit
> > during the freeze?
> 
> I agree with Joerg; I don't understand why the change is in FreeBSD.mk.
> After reading your diff, I went to look at Darwin.mk, because OSX had
> the change of clang being added and gcc removed before FreeBSD, and I
> *think* that bootstrap on mac autodetects clang and it all works ok.
> 
> In bootstrap.mk, see "get_compiler", which is trying to run gcc/cc and
> determine whether it is clang or gcc.   It seems that should decide on
> clang, which should cause the generated mk.conf to have clang.
> 
> I ran a fresh bootstrap (OS X 10.9, which has clang and does not have
> gcc) and the generated mk.conf had:
> 
> PKGSRC_COMPILER=        clang
> CC=                     clang
> CXX=                    clang++
> CPP=                    ${CC} -E
> CLANGBASE=              /usr

Forget we're talking about bootstrap. Forget mk.conf exists. The deal is that
if clang isn't set, pkgsrc will attempt to build gcc3-c to build any package
on FreeBSD 10.x. That's what this patch fixes.

Now, an easy way to prove this is bootstrapping on FreeBSD. Yes, those
variables will be set in mk.conf. Comment them. See pkgsrc want to build
gcc3-c to build more packages.


Home | Main Index | Thread Index | Old Index