From owner-svn-ports-all@freebsd.org Sat Feb 22 10:15:05 2020 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBF342571E6; Sat, 22 Feb 2020 10:15:05 +0000 (UTC) (envelope-from gerald@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Pkj51FbJz3Kst; Sat, 22 Feb 2020 10:15:05 +0000 (UTC) (envelope-from gerald@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04D4A21EF8; Sat, 22 Feb 2020 10:15:05 +0000 (UTC) (envelope-from gerald@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01MAF4o6047967; Sat, 22 Feb 2020 10:15:04 GMT (envelope-from gerald@FreeBSD.org) Received: (from gerald@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01MAF4uQ047966; Sat, 22 Feb 2020 10:15:04 GMT (envelope-from gerald@FreeBSD.org) Message-Id: <202002221015.01MAF4uQ047966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gerald set sender to gerald@FreeBSD.org using -f From: Gerald Pfeifer Date: Sat, 22 Feb 2020 10:15:04 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r526751 - head/Mk X-SVN-Group: ports-head X-SVN-Commit-Author: gerald X-SVN-Commit-Paths: head/Mk X-SVN-Commit-Revision: 526751 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Feb 2020 10:15:05 -0000 Author: gerald Date: Sat Feb 22 10:15:04 2020 New Revision: 526751 URL: https://svnweb.freebsd.org/changeset/ports/526751 Log: Significantly simplify the logic to determine which port (or base version) of GCC to use based on the specification of USE_GCC. This is based on the observation that we now only have a single version of GCC in base, namely GCC 4.2, which is not in ports any longer. And we limit our choice to either the specific version requested or the default version of GCC in the ports tree; i.e., we no longer consider an installed port of any version in between (which is a fringe case extremely few, if any, users would have experienced, and then only outside a clean build environment in any case). Streamline some debugging output accordingly. Overall this removes some 25 lines of largely complex logic. Modified: head/Mk/bsd.gcc.mk Modified: head/Mk/bsd.gcc.mk ============================================================================== --- head/Mk/bsd.gcc.mk Sat Feb 22 10:09:27 2020 (r526750) +++ head/Mk/bsd.gcc.mk Sat Feb 22 10:15:04 2020 (r526751) @@ -82,18 +82,17 @@ _GCC_ORLATER:= true . endif # ${USE_GCC} == any -# Initialize _GCC_FOUND${v}. In parallel, check if USE_GCC points to a -# valid version to begin with. +# See whether we have the specific version requested installed already +# and save that into _GCC_FOUND. In parallel, check if USE_GCC refers +# to a valid version to begin with. .for v in ${GCCVERSIONS} -. if exists(${LOCALBASE}/bin/gcc${_GCCVERSION_${v}_V:S/.//}) -_GCC_FOUND${v}= port -. elif ${OSVERSION} < ${_GCCVERSION_${v}_R} -. if exists(/usr/bin/gcc) -_GCC_FOUND${v}= base -. endif -. endif . if ${_USE_GCC}==${_GCCVERSION_${v}_V} _GCCVERSION_OKAY= true +. if exists(${LOCALBASE}/bin/gcc${_GCCVERSION_${v}_V:S/.//}) +_GCC_FOUND:= ${_USE_GCC} +. elif ${OSVERSION} < ${_GCCVERSION_${v}_R} && exists(/usr/bin/gcc) +_GCC_FOUND:= ${_USE_GCC} +. endif . endif .endfor @@ -102,31 +101,9 @@ IGNORE= Unknown version of GCC specified (USE_GCC=${US .endif # If the GCC package defined in USE_GCC does not exist, but a later -# version is allowed (for example 4.7+), see if there is a later. -# First check if the base installed version is good enough, otherwise -# get the first available version. -# +# version is allowed (for example 8+), go and use the default. .if defined(_GCC_ORLATER) -. for v in ${GCCVERSIONS} -. if ${_USE_GCC} == ${_GCCVERSION_${v}_V} -_GCC_MIN1:= true -. endif -. if defined(_GCC_MIN1) && defined(_GCC_FOUND${v}) && ${_GCC_FOUND${v}}=="base" && !defined(_GCC_FOUND) -_GCC_FOUND:= ${_GCCVERSION_${v}_V} -. endif -. endfor -. for v in ${GCCVERSIONS} -. if ${_USE_GCC} == ${_GCCVERSION_${v}_V} -_GCC_MIN2:= true -. endif -. if defined(_GCC_MIN2) && defined(_GCC_FOUND${v}) && !defined(_GCC_FOUND) -_GCC_FOUND:= ${_GCCVERSION_${v}_V} -. endif -. endfor - -. if defined(_GCC_FOUND) -_USE_GCC:= ${_GCC_FOUND} -. elif ${_USE_GCC} < ${GCC_DEFAULT} +. if !defined(_GCC_FOUND) && ${_USE_GCC} < ${GCC_DEFAULT} _USE_GCC:= ${GCC_DEFAULT} . endif .endif # defined(_GCC_ORLATER) @@ -198,11 +175,7 @@ test-gcc: .endif .for v in ${GCCVERSIONS} @echo -n "GCC version: ${_GCCVERSION_${v}_V} " -.if defined(_GCC_FOUND${v}) - @echo -n "(${_GCC_FOUND${v}}) " -.endif @echo "- OSVERSION up to ${_GCCVERSION_${v}_R}" -# @echo ${v} - ${_GCC_FOUND${v}} - up to ${_GCCVERSION_${v}_R} - ${_GCCVERSION_${v}_V} .endfor @echo Using GCC version ${_USE_GCC} .endif