Index: multilib-build.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/multilib-build.eclass,v retrieving revision 1.27 diff -u -B -r1.27 multilib-build.eclass --- multilib-build.eclass 16 Jan 2014 20:05:12 -0000 1.27 +++ multilib-build.eclass 28 Mar 2014 11:49:39 -0000 @@ -244,8 +244,13 @@ # and the native variant will be symlinked to the generic name. # # This variable has to be a bash array. Paths shall be relative to -# installation root (${ED}), and name regular files. Recursive wrapping -# is not supported. +# installation root (${ED}), and name regular files or symbolic +# links to regular files. Recursive wrapping is not supported. +# +# If symbolic link is passed, both symlink path and symlink target +# will be changed. As a result, the symlink target is expected +# to be wrapped as well (either by listing in MULTILIB_CHOST_TOOLS +# or externally). # # Please note that tool wrapping is *discouraged*. It is preferred to # install pkg-config files for each ABI, and require reverse @@ -368,6 +373,18 @@ local dir=${f%/*} local fn=${f##*/} + if [[ -L ${root}/${f} ]]; then + # rewrite the symlink target + local target=$(readlink "${root}/${f}") + local target_dir + local target_fn=${target##*/} + + [[ ${target} == */* ]] && target_dir=${target%/*} + + ln -f -s "${target_dir+${target_dir}/}${CHOST}-${target_fn}" \ + "${root}/${f}" || die + fi + mv "${root}/${f}" "${root}/${dir}/${CHOST}-${fn}" || die # symlink the native one back