mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-17 01:46:58 +02:00
eclass/flag-o-matic: Support EAPI 0 and 4
This commit is contained in:
parent
7514aa2a2a
commit
8ea3271af0
@ -1,18 +1,20 @@
|
|||||||
# Copyright 1999-2021 Gentoo Authors
|
# Copyright 1999-2021 Gentoo Authors
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
|
# Flatcar: Support EAPI 0 and 4.
|
||||||
|
|
||||||
# @ECLASS: flag-o-matic.eclass
|
# @ECLASS: flag-o-matic.eclass
|
||||||
# @MAINTAINER:
|
# @MAINTAINER:
|
||||||
# toolchain@gentoo.org
|
# toolchain@gentoo.org
|
||||||
# @SUPPORTED_EAPIS: 5 6 7 8
|
# @SUPPORTED_EAPIS: 0 4 5 6 7 8
|
||||||
# @BLURB: common functions to manipulate and query toolchain flags
|
# @BLURB: common functions to manipulate and query toolchain flags
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# This eclass contains a suite of functions to help developers sanely
|
# This eclass contains a suite of functions to help developers sanely
|
||||||
# and safely manage toolchain flags in their builds.
|
# and safely manage toolchain flags in their builds.
|
||||||
|
|
||||||
case ${EAPI:-0} in
|
case ${EAPI:-0} in
|
||||||
0|1|2|3|4) die "flag-o-matic.eclass: EAPI ${EAPI} is too old." ;;
|
1|2|3) die "flag-o-matic.eclass: EAPI ${EAPI} is too old." ;;
|
||||||
5|6|7|8) ;;
|
0|4|5|6|7|8) ;;
|
||||||
*) die "EAPI ${EAPI} is not supported by flag-o-matic.eclass." ;;
|
*) die "EAPI ${EAPI} is not supported by flag-o-matic.eclass." ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@ -21,7 +23,7 @@ _FLAG_O_MATIC_ECLASS=1
|
|||||||
|
|
||||||
inherit toolchain-funcs
|
inherit toolchain-funcs
|
||||||
|
|
||||||
[[ ${EAPI} == [567] ]] && inherit eutils
|
[[ ${EAPI:-0} == [04567] ]] && inherit eutils
|
||||||
|
|
||||||
# @FUNCTION: all-flag-vars
|
# @FUNCTION: all-flag-vars
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
@ -36,8 +38,8 @@ all-flag-vars() {
|
|||||||
# {C,CPP,CXX,CCAS,F,FC,LD}FLAGS that we allow in strip-flags
|
# {C,CPP,CXX,CCAS,F,FC,LD}FLAGS that we allow in strip-flags
|
||||||
# Note: shell globs and character lists are allowed
|
# Note: shell globs and character lists are allowed
|
||||||
setup-allowed-flags() {
|
setup-allowed-flags() {
|
||||||
[[ ${EAPI} == [567] ]] ||
|
[[ ${EAPI:-0} == [04567] ]] ||
|
||||||
die "Internal function ${FUNCNAME} is not available in EAPI ${EAPI}."
|
die "Internal function ${FUNCNAME} is not available in EAPI ${EAPI:-0}."
|
||||||
_setup-allowed-flags "$@"
|
_setup-allowed-flags "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -484,8 +486,8 @@ strip-flags() {
|
|||||||
# Returns shell true if <flag> is supported by given <compiler>,
|
# Returns shell true if <flag> is supported by given <compiler>,
|
||||||
# else returns shell false.
|
# else returns shell false.
|
||||||
test-flag-PROG() {
|
test-flag-PROG() {
|
||||||
[[ ${EAPI} == [567] ]] ||
|
[[ ${EAPI:-0} == [04567] ]] ||
|
||||||
die "Internal function ${FUNCNAME} is not available in EAPI ${EAPI}."
|
die "Internal function ${FUNCNAME} is not available in EAPI ${EAPI:-0}."
|
||||||
_test-flag-PROG "$@"
|
_test-flag-PROG "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -623,8 +625,8 @@ test-flag-CCLD() { _test-flag-PROG CC c+ld "$@"; }
|
|||||||
# Returns shell true if <flags> are supported by given <compiler>,
|
# Returns shell true if <flags> are supported by given <compiler>,
|
||||||
# else returns shell false.
|
# else returns shell false.
|
||||||
test-flags-PROG() {
|
test-flags-PROG() {
|
||||||
[[ ${EAPI} == [567] ]] ||
|
[[ ${EAPI:-0} == [04567] ]] ||
|
||||||
die "Internal function ${FUNCNAME} is not available in EAPI ${EAPI}."
|
die "Internal function ${FUNCNAME} is not available in EAPI ${EAPI:-0}."
|
||||||
_test-flags-PROG "$@"
|
_test-flags-PROG "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user