Ticket #11945: fix_install_names.sh

File fix_install_names.sh, 458 bytes (added by n.oxyde@…, 18 years ago)
Line 
1#!/bin/sh
2
3libdir=${prefix}/lib
4
5for dylib in ${destroot}${libdir}/*.dylib ; do
6    [[ -L $dylib ]] && continue
7
8    dylib_name=${dylib##*/}
9
10    install_name_tool -id ${libdir}/${dylib_name} $dylib
11
12    for lib in $(otool -L ${dylib} | grep -v : | grep ${worksrcpath} | awk '{print $1}') ; do
13        lib_name=${lib##*/}
14        [[ $dylib_name == $lib_name ]] && continue
15
16        install_name_tool -change ${lib} ${libdir}/${lib_name} $dylib
17    done
18done