• [gentoo-dev] [PATCH 04/11] llvm-utils.eclass: Support -b/-d to llvm_pre

    From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Sat Dec 21 17:10:02 2024
    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/llvm-utils.eclass | 27 ++++++++++++++++++++++++---
    1 file changed, 24 insertions(+), 3 deletions(-)

    diff --git a/eclass/llvm-utils.eclass b/eclass/llvm-utils.eclass
    index 1ae3295484c8..b105e169fbc4 100644
    --- a/eclass/llvm-utils.eclass
    +++ b/eclass/llvm-utils.eclass
    @@ -113,17 +113,38 @@ llvm_fix_tool_path() {
    }

    # @FUNCTION: llvm_prepend_path
    -# @USAGE: <slot>
    +# @USAGE: [-b|-d] <slot>
    # @DESCRIPTION:
    # Prepend the path to the specified LLVM slot to PATH variable,
    # and reexport it.
    +#
    +# With no option or "-d", the path is prefixed by ESYSROOT. LLVM
    +# dependencies should be in DEPEND then.
    +#
    +# With "-b" option, the path is prefixed by BROOT. LLVM dependencies
    +# should be in BDEPEND then.
    llvm_prepend_path() {
    debug-print-function ${FUNCNAME} "$@"

    - [[ ${#} -ne 1 ]] && die "Usage: ${FUNCNAME} <slot>"
    + local prefix
    + case ${1--d} in
    + -d)
    + prefix=${ESYSROOT}
    + shift
    + ;;
    + -b)
    + prefix=${BROOT}
    + shift
    + ;;
    + -*)
    + die "${FUN