Add get_libdir() function to obtain the basename of libdir using the same algorithm that econf uses. --- bin/eapi.sh | 4 ++++ bin/phase-helpers.sh | 11 +++++++++++ 2 files changed, 15 insertions(+)
diff --git a/bin/eapi.sh b/bin/eapi.sh index 5f96c3b..6ace20d 100644 --- a/bin/eapi.sh +++ b/bin/eapi.sh @@ -64,6 +64,10 @@ ___eapi_has_usex() { [[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi)$ ]] } +___eapi_has_get_libdir() { + [[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]] +} + ___eapi_has_master_repositories() { [[ ${1-${EAPI}} =~ ^(5-progress)$ ]] } diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh index c2161f6..8edbc07 100644 --- a/bin/phase-helpers.sh +++ b/bin/phase-helpers.sh @@ -842,6 +842,17 @@ best_version() { esac } +if ___eapi_has_get_libdir; then + get_libdir() { + local libdir_var="LIBDIR_${ABI}" + local libdir="lib" + + [[ -n ${ABI} && -n ${!libdir_var} ]] && libdir=${!libdir_var} + + echo "${libdir}" + } +fi + if ___eapi_has_master_repositories; then master_repositories() { local output repository=$1 retval -- 2.0.4