diff options
Diffstat (limited to 'sys-devel/llvm/llvm-9999.ebuild')
-rw-r--r-- | sys-devel/llvm/llvm-9999.ebuild | 49 |
1 files changed, 32 insertions, 17 deletions
diff --git a/sys-devel/llvm/llvm-9999.ebuild b/sys-devel/llvm/llvm-9999.ebuild index 86161d3e7d48..9061b960e871 100644 --- a/sys-devel/llvm/llvm-9999.ebuild +++ b/sys-devel/llvm/llvm-9999.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm/llvm-9999.ebuild,v 1.98 2015/01/25 23:45:06 voyageur Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm/llvm-9999.ebuild,v 1.99 2015/01/31 16:42:19 grobian Exp $ EAPI=5 @@ -415,11 +415,12 @@ multilib_src_install() { # Fix install_names on Darwin. The build system is too complicated # to just fix this, so we correct it post-install - local lib= f= odylib= libpv=${PV} + local lib= f= odylib= ndylib= libpv=${PV} if [[ ${CHOST} == *-darwin* ]] ; then eval $(grep PACKAGE_VERSION= configure) [[ -n ${PACKAGE_VERSION} ]] && libpv=${PACKAGE_VERSION} - for lib in lib{EnhancedDisassembly,LLVM-${libpv},LTO,profile_rt,clang}.dylib LLVMHello.dylib ; do + libpvminor=${libpv%.[0-9]*} + for lib in lib{EnhancedDisassembly,LLVM-${libpv},LTO,profile_rt,clang}.dylib LLVMHello.dylib clang/${libpv}/lib/darwin/libclang_rt.asan_{osx,iossim}_dynamic.dylib; do # libEnhancedDisassembly is Darwin10 only, so non-fatal # + omit clang libs if not enabled [[ -f ${ED}/usr/lib/${lib} ]] || continue @@ -430,21 +431,35 @@ multilib_src_install() { "${ED}"/usr/lib/${lib} eend $? done - for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/lib{LTO,clang}.dylib ; do + for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/lib*.dylib "${ED}"/usr/lib/clang/${libpv}/lib/darwin/*.dylib ; do # omit clang libs if not enabled - [[ -f ${ED}/usr/lib/${lib} ]] || continue - - odylib=$(scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | grep libLLVM-${libpv}.dylib) - ebegin "fixing install_name reference to ${odylib} of ${f##*/}" - install_name_tool \ - -change "${odylib}" \ - "${EPREFIX}"/usr/lib/libLLVM-${libpv}.dylib \ - -change "@rpath/libclang.dylib" \ - "${EPREFIX}"/usr/lib/libclang.dylib \ - -change "${S}"/Release/lib/libclang.dylib \ - "${EPREFIX}"/usr/lib/libclang.dylib \ - "${f}" - eend $? + [[ -f "${f}" ]] || continue + + scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | \ + while read odylib ; do + ndylib= + case ${odylib} in + */libclang.dylib) + ndylib="${EPREFIX}"/usr/lib/libclang.dylib + ;; + */libLLVM-${libpv}.dylib) + ndylib="${EPREFIX}"/usr/lib/libLLVM-${libpv}.dylib + ;; + */libLLVM-${libpvminor}.dylib) + ndylib="${EPREFIX}"/usr/lib/libLLVM-${libpvminor}.dylib + ;; + */libLTO.dylib) + ndylib="${EPREFIX}"/usr/lib/libLTO.dylib + ;; + esac + if [[ -n ${ndylib} ]] ; then + ebegin "fixing install_name reference to ${odylib} of ${f##*/}" + install_name_tool \ + -change "${odylib}" "${ndylib}" \ + "${f}" + eend $? + fi + done done fi } |