From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 5463A1382DE for ; Fri, 1 Jul 2016 18:42:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AAF09E0B59; Fri, 1 Jul 2016 18:42:49 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 41EC9E0B59 for ; Fri, 1 Jul 2016 18:42:49 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4BE90340F17 for ; Fri, 1 Jul 2016 18:42:48 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 6786E243D for ; Fri, 1 Jul 2016 18:42:46 +0000 (UTC) From: "Austin English" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Austin English" Message-ID: <1467398529.6597a608fe6462be6f7736bc0b28c4288b488779.wizardedit@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/toolchain-funcs.eclass X-VCS-Directories: eclass/ X-VCS-Committer: wizardedit X-VCS-Committer-Name: Austin English X-VCS-Revision: 6597a608fe6462be6f7736bc0b28c4288b488779 X-VCS-Branch: master Date: Fri, 1 Jul 2016 18:42:46 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: ba088014-501e-4751-bbec-965c38b4c297 X-Archives-Hash: ada2d68cfb7c3a70b12bc8030bff9bfe commit: 6597a608fe6462be6f7736bc0b28c4288b488779 Author: Austin English gentoo org> AuthorDate: Mon Jun 27 21:58:07 2016 +0000 Commit: Austin English gentoo org> CommitDate: Fri Jul 1 18:42:09 2016 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6597a608 eclass/toolchain-funcs: add clang version functions eclass/toolchain-funcs.eclass | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index fb8b2f9..9bb5232 100644 --- a/eclass/toolchain-funcs.eclass +++ b/eclass/toolchain-funcs.eclass @@ -642,6 +642,39 @@ gcc-micro-version() { _gcc_fullversion '$3' "$@" } +# Internal func. Based on _gcc_fullversion() above. +_clang_fullversion() { + local ver="$1"; shift + set -- $($(tc-getCPP "$@") -E -P - <<<"__clang_major__ __clang_minor__ __clang_patchlevel__") + eval echo "$ver" +} + +# @FUNCTION: clang-fullversion +# @RETURN: compiler version (major.minor.micro: [3.4.6]) +clang-fullversion() { + _clang_fullversion '$1.$2.$3' "$@" +} +# @FUNCTION: clang-version +# @RETURN: compiler version (major.minor: [3.4].6) +clang-version() { + _clang_fullversion '$1.$2' "$@" +} +# @FUNCTION: clang-major-version +# @RETURN: major compiler version (major: [3].4.6) +clang-major-version() { + _clang_fullversion '$1' "$@" +} +# @FUNCTION: clang-minor-version +# @RETURN: minor compiler version (minor: 3.[4].6) +clang-minor-version() { + _clang_fullversion '$2' "$@" +} +# @FUNCTION: clang-micro-version +# @RETURN: micro compiler version (micro: 3.4.[6]) +clang-micro-version() { + _clang_fullversion '$3' "$@" +} + # Returns the installation directory - internal toolchain # function for use by _gcc-specs-exists (for flag-o-matic). _gcc-install-dir() {