From owner-svn-src-all@FreeBSD.ORG Fri May 23 17:33:58 2014 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1AC9B53C; Fri, 23 May 2014 17:33:58 +0000 (UTC) Received: from gw.catspoiler.org (gw.catspoiler.org [75.1.14.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFDF124AD; Fri, 23 May 2014 17:33:57 +0000 (UTC) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id s4NHXgFC060060; Fri, 23 May 2014 10:33:46 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201405231733.s4NHXgFC060060@gw.catspoiler.org> Date: Fri, 23 May 2014 10:33:42 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r266587 - head/share/mk To: imp@FreeBSD.org In-Reply-To: <201405231434.s4NEYMHU075537@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 17:33:58 -0000 On 23 May, Warner Losh wrote: > Author: imp > Date: Fri May 23 14:34:22 2014 > New Revision: 266587 > URL: http://svnweb.freebsd.org/changeset/base/266587 > > Log: > Allow CC to not actually exist. During the ports INDEX run, all the > Makefiles are evaluated without building things. In a normal build, > the prerequisites would be built, and CC would be an actual thing. In > an INDEX build, though, they don't exists. Redirect stderr to get rid > of annoying messages, and assume that the compiler version is 0 if the > actual compiler can't tell us. Do this in preference to guessing based > on numbers because gcc410 might be 4.10, or 4.1.0 and without > carefully crafted special knowledge we differentiate between them > easily (also ming-gcc has no clues at all). Elsewhere, don't trust > the compiler version if it is 0. > > Modified: > head/share/mk/bsd.compiler.mk > > Modified: head/share/mk/bsd.compiler.mk > ============================================================================== > --- head/share/mk/bsd.compiler.mk Fri May 23 14:32:57 2014 (r266586) > +++ head/share/mk/bsd.compiler.mk Fri May 23 14:34:22 2014 (r266587) > @@ -21,11 +21,11 @@ > .if !target(____) > ____: > > -_v!= ${CC} --version > +_v!= ${CC} --version 2>/dev/null || echo 0.0.0 > .if !defined(COMPILER_TYPE) > -. if ${CC:T:Mgcc*} > +. if ${CC:T:M*gcc*} > COMPILER_TYPE:= gcc > -. elif ${CC:T:Mclang} > +. elif ${CC:T:M*clang*} > COMPILER_TYPE:= clang > . elif ${_v:Mgcc} > COMPILER_TYPE:= gcc > Thanks!