1
mirror of https://code.videolan.org/videolan/vlc synced 2024-10-07 03:56:28 +02:00

contrib: Fix change_prefix when used on binaries != libraries

This commit is contained in:
Derk-Jan Hartman 2008-10-13 00:43:32 +02:00
parent 8f7056b536
commit 33a19efb34

View File

@ -48,17 +48,20 @@ files=`find . -type f`
for file in $files; do for file in $files; do
if test ".`file $file | grep Mach-O`" != "." ; then if test ".`file $file | grep Mach-O`" != "." ; then
echo "Changing prefixes of '$file'" echo "Changing prefixes of '$file'"
islib=n
if test ".`file $file | grep 'Mach-O dynamically'`" != "." ; then
islib=y
fi
libs=`otool -L $file 2>/dev/null | grep $prefix | cut -d\ -f 1` libs=`otool -L $file 2>/dev/null | grep $prefix | cut -d\ -f 1`
WD=`pwd`
first=y first=y
for i in "" $libs; do for i in "" $libs; do
if ! test -z $i; then if ! test -z $i; then
if test $first = y; then if test $islib = y -a $first = y; then
install_name_tool -id `echo $i | sed -e "s,$prefix,$new_prefix,"` $file install_name_tool -id `echo $i | sed -e "s,$prefix,$new_prefix,"` $file
first=n first=n
else else
install_name_tool -change $i `echo $i | sed -e "s,$prefix,$new_prefix,"` $file install_name_tool -change $i `echo $i | sed -e "s,$prefix,$new_prefix,"` $file
fi fi
fi fi
done done
elif test ".`file $file | grep \"text\|shell\"`" != "." ; then elif test ".`file $file | grep \"text\|shell\"`" != "." ; then