From nobody Sun Sep 11 11:36:16 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MQSNc60W7z4cc2h; Sun, 11 Sep 2022 11:36:16 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MQSNc5Z4Fz3f8v; Sun, 11 Sep 2022 11:36:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662896176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t0dDplU++4p2WNDsW0Lr2CWMszfZOn1qGfvB2zIKCKQ=; b=RrKY+aMyWe/itqRc12mOpjyNKtKi/2gdMznJkhkxP1BD4jivTUS3NrG4j4mADETa3hJ/7c A4cSe2MJTLNMC+aHwoXFFsINBAhRTfd5gZj+8cImbIaLI7wgxn3lrvkM0T1iglmCkFBIZw HMadRBASJdf7lmK862NdFDJk+2j32TQGa9gHOHsQGTpNCWGSershXWpomIjOafd5RdFyms i0jJwMLR4wQ+9ILXPG/TWY7z6TqVKeSz5u/jAqgseCekjggWJl+n5Cg2F2Gvmq6aO/DXcZ Nw2k0jnlaFCsL8jVvRkNLOwMHbtK8Sn51pPL8cNXeiQEfkcALp/7uySZtnKkfw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MQSNc4WttzdP2; Sun, 11 Sep 2022 11:36:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 28BBaGvY015164; Sun, 11 Sep 2022 11:36:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28BBaG2h015163; Sun, 11 Sep 2022 11:36:16 GMT (envelope-from git) Date: Sun, 11 Sep 2022 11:36:16 GMT Message-Id: <202209111136.28BBaG2h015163@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Felix Palmen Subject: git: 5ca22080ae08 - main - Mk/Uses/compiler.mk: Support newer C++ standards List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zirias X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5ca22080ae08a6707bbcb9af0529e9d54aa832d5 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662896176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t0dDplU++4p2WNDsW0Lr2CWMszfZOn1qGfvB2zIKCKQ=; b=vyiyP4v0jFb4uT206GSXIcykSX5quA7U+BQEpJ6B2An4PoSBgLZYGiYISdAg6jhAwIlfxv AGRB9V/kK6PEYctJoOl/ooI39RrrqlAY7n21sFyPwsBF04c2xYfrQlU5rVAN/nngmo5Hxi BGqnv+4HaaCW2eoVIe+SXLJJnpy8KvvFaS3qUnaDbTBYhE2qN6ll2j8c7vDaNk2UYTwYpA 7X4fS2rIlWUjmqXiXWgWMsdbYZd3+XK61pB60alTSu93lOafdFQwMZx4FoqD1f+tN2qCMy Qsxj9ESuq/0ZHt8XqPuHWjEZrec3QNq9lDO9RhmtgInxto/SnUl0texkQ01JXw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662896176; a=rsa-sha256; cv=none; b=LoBXarpbBVOB5Pr/rjyRR9pPugR1SUfPrShVywAJAVfFtX5ZWlLd5MTgUhO9e+E5Eg32yr O7BEeA1miWN0gYqkKSK/DlOKCK3C9UOPsyvxi4lY/19fGvwnl5HGFZFyC6RIAWNW+xJEOZ 7jWh3KVoRPFKY4Aox8YhyAK8euRAxU8csBcC3vsOWXMtZmQ1Bhc+Ut8BROBB91BjLZafWP tpQO/PEpXKAkae0+14iAlYEjHsWjBK2iwZ1f3JHjBSVxJYSPS+YmAiofLL6zZ1KNLZ8FxB LfDfQTCYSoP/5QX8OqX3kpYSONPCvbqfT75WwUsi5/cW1voxh4oUqj726BPXGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by zirias: URL: https://cgit.FreeBSD.org/ports/commit/?id=5ca22080ae08a6707bbcb9af0529e9d54aa832d5 commit 5ca22080ae08a6707bbcb9af0529e9d54aa832d5 Author: Felix Palmen AuthorDate: 2022-08-25 08:36:02 +0000 Commit: Felix Palmen CommitDate: 2022-09-11 11:34:29 +0000 Mk/Uses/compiler.mk: Support newer C++ standards * Add c++20-lang and c++2b-lang arguments * Respect LLVM_DEFAULT if it fullfills the requirements PR: 244810, 266029 Exp-run by: antoine Approved by: bapt, tcberner (mentor) Differential Revision: https://reviews.freebsd.org/D35889 --- Mk/Uses/compiler.mk | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/Mk/Uses/compiler.mk b/Mk/Uses/compiler.mk index e8191c822942..d668873e1f2a 100644 --- a/Mk/Uses/compiler.mk +++ b/Mk/Uses/compiler.mk @@ -8,6 +8,8 @@ # c++11-lang: The port needs a compiler understanding C++11 # c++14-lang: The port needs a compiler understanding C++14 # c++17-lang: The port needs a compiler understanding C++17 +# c++20-lang: The port needs a compiler understanding C++20 +# c++2b-lang: The port needs a compiler understanding C++2b # gcc-c++11-lib:The port needs g++ compiler with a C++11 library # c++11-lib: The port needs a compiler understanding C++11 and with a C++11 ready standard library # c11: The port needs a compiler understanding C11 @@ -33,7 +35,8 @@ _INCLUDE_USES_COMPILER_MK= yes compiler_ARGS= env . endif -VALID_ARGS= c++11-lib c++11-lang c++14-lang c++17-lang c11 features env nestedfct c++0x gcc-c++11-lib +VALID_ARGS= c++11-lib c++11-lang c++14-lang c++17-lang c++20-lang \ + c++2b-lang c11 features env nestedfct c++0x gcc-c++11-lib _CC_hash:= ${CC:hash} _CXX_hash:= ${CXX:hash} @@ -50,6 +53,10 @@ _COMPILER_ARGS+= features c++11-lang _COMPILER_ARGS+= features c++14-lang . elif ${compiler_ARGS} == c++17-lang _COMPILER_ARGS+= features c++17-lang +. elif ${compiler_ARGS} == c++20-lang +_COMPILER_ARGS+= features c++20-lang +. elif ${compiler_ARGS} == c++2b-lang +_COMPILER_ARGS+= features c++2b-lang . elif ${compiler_ARGS} == c11 _COMPILER_ARGS+= features c11 . elif ${compiler_ARGS} == features @@ -129,7 +136,8 @@ COMPILER_FEATURES= libstdc++ . endif CSTD= c89 c99 c11 gnu89 gnu99 gnu11 -CXXSTD= c++98 c++0x c++11 c++14 c++17 gnu++98 gnu++11 gnu++14 gnu++17 +CXXSTD= c++98 c++0x c++11 c++14 c++17 c++20 c++2b \ + gnu++98 gnu++11 gnu++14 gnu++17 gnu++20 gnu++2b . for std in ${CSTD} ${CXXSTD} _LANG=c @@ -159,25 +167,41 @@ CHOSEN_COMPILER_TYPE= gcc . endif . endif -. if (${_COMPILER_ARGS:Mc++17-lang} && !${COMPILER_FEATURES:Mc++17}) || \ +. if (${_COMPILER_ARGS:Mc++2b-lang} && !${COMPILER_FEATURES:Mc++2b}) || \ +(${_COMPILER_ARGS:Mc++20-lang} && !${COMPILER_FEATURES:Mc++20}) || \ +(${_COMPILER_ARGS:Mc++17-lang} && !${COMPILER_FEATURES:Mc++17}) || \ (${_COMPILER_ARGS:Mc++14-lang} && !${COMPILER_FEATURES:Mc++14}) || \ (${_COMPILER_ARGS:Mc++11-lang} && !${COMPILER_FEATURES:Mc++11}) || \ (${_COMPILER_ARGS:Mc++0x} && !${COMPILER_FEATURES:Mc++0x}) || \ (${_COMPILER_ARGS:Mc11} && !${COMPILER_FEATURES:Mc11}) +. if ${_COMPILER_ARGS:Mc++2b-lang} +_LLVM_MINVER= 14 +. elif ${_COMPILER_ARGS:Mc++20-lang} +_LLVM_MINVER= 11 +. else +_LLVM_MINVER= 0 +. endif . if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2 USE_GCC= yes CHOSEN_COMPILER_TYPE= gcc -. elif ${COMPILER_TYPE} == gcc -. if ${ALT_COMPILER_TYPE} == clang +. elif ${COMPILER_TYPE} == gcc || \ + (${COMPILER_VERSION:C/[0-9]$//}<${_LLVM_MINVER}) +. if ${ALT_COMPILER_TYPE} == clang && \ + (${ALT_COMPILER_VERSION:C/[0-9]$//}>=${_LLVM_MINVER}) CPP= clang-cpp CC= clang CXX= clang++ CHOSEN_COMPILER_TYPE= clang . else -BUILD_DEPENDS+= ${LOCALBASE}/bin/clang10:devel/llvm10 -CPP= ${LOCALBASE}/bin/clang-cpp10 -CC= ${LOCALBASE}/bin/clang10 -CXX= ${LOCALBASE}/bin/clang++10 +. if ${LLVM_DEFAULT:C/^[789]0$/0/}<${_LLVM_MINVER} +_LLVM_REQ= ${_LLVM_MINVER} +. else +_LLVM_REQ= ${LLVM_DEFAULT} +. endif +BUILD_DEPENDS+= clang${_LLVM_REQ}:devel/llvm${_LLVM_REQ} +CPP= ${LOCALBASE}/bin/clang-cpp${_LLVM_REQ} +CC= ${LOCALBASE}/bin/clang${_LLVM_REQ} +CXX= ${LOCALBASE}/bin/clang++${_LLVM_REQ} CHOSEN_COMPILER_TYPE= clang . endif . endif