File: libmover.sh

package info (click to toggle)
python-escript 5.6-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 144,304 kB
  • sloc: python: 592,074; cpp: 136,909; ansic: 18,675; javascript: 9,411; xml: 3,384; sh: 738; makefile: 207
file content (26 lines) | stat: -rwxr-xr-x 540 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26


#This script will take a library on macos (.so or .dylib)
#and will replace the relative dependencies with absolute
#deps in targetlibpath
#
# eg:
# for name in `find lib -name '*.so'`;do echo $name;./libmover.sh $name `pwd`/lib;  done


if [ $# -ne 2 ]
then
    echo "Usage: $0 library_file_to_update targetlibpath"
    exit 1
fi

libname=$1
tlibpath=$2

lines=`otool -L $libname | tail +3 | cut -f1 -d\  | cut -f2 | grep build/darwin`
for name in $lines
do
   install_name_tool -change $name $tlibpath/`basename $name` $libname
done