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 8A4E213835A for ; Wed, 16 Dec 2020 20:57:08 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DBA77E092B; Wed, 16 Dec 2020 20:57:07 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 6BE74E092B for ; Wed, 16 Dec 2020 20:57:07 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7244E340E03 for ; Wed, 16 Dec 2020 20:57:06 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 03B80CB for ; Wed, 16 Dec 2020 20:57:04 +0000 (UTC) From: "Aaron Bauman" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Aaron Bauman" Message-ID: <1608152219.7d00bfe0911a757e6023c6da21830315103c0bec.bman@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/flag-o-matic.eclass X-VCS-Directories: eclass/ X-VCS-Committer: bman X-VCS-Committer-Name: Aaron Bauman X-VCS-Revision: 7d00bfe0911a757e6023c6da21830315103c0bec X-VCS-Branch: master Date: Wed, 16 Dec 2020 20:57:04 +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-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 334fab3f-dbf9-47f7-bcad-9c2db7613e94 X-Archives-Hash: 2d518bd7a49a416c4be604cbc52b68e4 commit: 7d00bfe0911a757e6023c6da21830315103c0bec Author: Aaron Bauman gentoo org> AuthorDate: Wed Dec 16 20:56:24 2020 +0000 Commit: Aaron Bauman gentoo org> CommitDate: Wed Dec 16 20:56:59 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d00bfe0 eclass/flag-o-matic: fixup documentation Signed-off-by: Aaron Bauman gentoo.org> eclass/flag-o-matic.eclass | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass index 20ee39d98ba..f7786725c5b 100644 --- a/eclass/flag-o-matic.eclass +++ b/eclass/flag-o-matic.eclass @@ -9,18 +9,29 @@ # This eclass contains a suite of functions to help developers sanely # and safely manage toolchain flags in their builds. +# @ECLASS-VARIABLE: _FLAG_O_MATIC_ECLASS +# @INTERNAL +# @DESCRIPTION: +# Please document me + if [[ -z ${_FLAG_O_MATIC_ECLASS} ]]; then _FLAG_O_MATIC_ECLASS=1 inherit eutils toolchain-funcs multilib +# @FUNCTION: all-flag-vars +# @DESCRIPTION: # Return all the flag variables that our high level funcs operate on. + all-flag-vars() { echo {ADA,C,CPP,CXX,CCAS,F,FC,LD}FLAGS } +# @FUNCTION: setup-allowed-flags +# @DESCRIPTION: # {C,CPP,CXX,CCAS,F,FC,LD}FLAGS that we allow in strip-flags # Note: shell globs and character lists are allowed + setup-allowed-flags() { ALLOWED_FLAGS=( -pipe -O '-O[12sg]' -mcpu -march -mtune @@ -87,8 +98,12 @@ setup-allowed-flags() { ) } +# @FUNCTION: _filter-hardened +# @INTERNAL +# @DESCRIPTION: # inverted filters for hardened compiler. This is trying to unpick # the hardened compiler defaults. + _filter-hardened() { local f for f in "$@" ; do @@ -121,9 +136,13 @@ _filter-hardened() { done } +# @FUNCTION: _filter-var +# @INTERNAL +# @DESCRIPTION: # Remove occurrences of strings from variable given in $1 # Strings removed are matched as globs, so for example # '-O*' would remove -O1, -O2 etc. + _filter-var() { local f x var=$1 new=() shift @@ -142,6 +161,7 @@ _filter-var() { # @USAGE: # @DESCRIPTION: # Remove particular from {C,CPP,CXX,CCAS,F,FC,LD}FLAGS. Accepts shell globs. + filter-flags() { _filter-hardened "$@" local v @@ -154,6 +174,7 @@ filter-flags() { # @FUNCTION: filter-lfs-flags # @DESCRIPTION: # Remove flags that enable Large File Support. + filter-lfs-flags() { [[ $# -ne 0 ]] && die "filter-lfs-flags takes no arguments" # http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html @@ -167,6 +188,7 @@ filter-lfs-flags() { # @USAGE: # @DESCRIPTION: # Remove particular from LDFLAGS. Accepts shell globs. + filter-ldflags() { _filter-var LDFLAGS "$@" return 0 @@ -313,6 +335,11 @@ replace-cpu-flags() { return 0 } +# @FUNCTION: _is_flagq +# @INTERNAL +# @DESCRIPTION: +# Please document me + _is_flagq() { local x var="$1[*]" for x in ${!var} ; do @@ -438,6 +465,10 @@ strip-flags() { return 0 } +# @FUNCTION: test-flag-PROG +# @DESCRIPTION: +# Please document me + test-flag-PROG() { local comp=$1 local lang=$2 @@ -557,8 +588,13 @@ test-flag-FC() { test-flag-PROG "FC" f95 "$@"; } # @USAGE: # @DESCRIPTION: # Returns shell true if is supported by the C compiler and linker, else returns shell false. + test-flag-CCLD() { test-flag-PROG "CC" c+ld "$@"; } +# @FUNCTION: test-flags-PROG +# @DESCRIPTION: +# Please document me + test-flags-PROG() { local comp=$1 local flags=()