To support multilib-portage abi-wrapper properly, we need to install
executables non-prefixed on all ABIs. However, we can safely create
prefixed symlinks to the executable to improve compatibility with
non-multilib-portage systems.
All of the symlinks point to the same executable but since it is wrapped
by abi-wrapper, it will work correctly in portage context.
---
eclass/multilib-build.eclass | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/eclass/multilib-build.eclass b/eclass/multilib-build.eclass
index 4b6a953..755d774 100644
--- a/eclass/multilib-build.eclass
+++ b/eclass/multilib-build.eclass
@@ -295,11 +295,26 @@ multilib_prepare_wrappers() {
[[ ${#} -le 1 ]] || die "${FUNCNAME}: too many arguments"
- [[ ${COMPLETE_MULTILIB} == yes ]] && return
-
local root=${1:-${ED}}
local f
+ if [[ ${COMPLETE_MULTILIB} == yes ]]; then
+ # symlink '${CHOST}-foo -> foo' to support abi-wrapper while
+ # keeping ${CHOST}-foo calls correct.
+
+ for f in "${MULTILIB_CHOST_TOOLS[@]}"; do
+ # drop leading slash if it's there
+ f=${f#/}
+
+ local dir=${f%/*}
+ local fn=${f##*/}
+
+ ln -s "${fn}" "${root}/${dir}/${CHOST}-${fn}" || die
+ done
+
+ return
+ fi
+
for f in "${MULTILIB_WRAPPED_HEADERS[@]}"; do
# drop leading slash if it's there
f=${f#/}
--
1.9.2