Commit dac13787 authored by Felix Paul Kühne's avatar Felix Paul Kühne

contribs: update the script to master's version

parent e7fdb2d3
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# *************************************************************************** # ***************************************************************************
# change_prefix.sh : allow to transfer a contrib dir # change_prefix.sh : allow to transfer a contrib dir
# *************************************************************************** # ***************************************************************************
# Copyright (C) 2003 the VideoLAN team # Copyright (C) 2003, 2009 the VideoLAN team
# $Id$ # $Id$
# #
# Authors: Christophe Massiot <massiot@via.ecp.fr> # Authors: Christophe Massiot <massiot@via.ecp.fr>
...@@ -47,28 +47,35 @@ pwd ...@@ -47,28 +47,35 @@ pwd
files=`find . -type f` 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'"
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`
echo $libs first=y
for i in "" $libs; do for i in "" $libs; do
echo $i
if ! test -z $i; then if ! test -z $i; then
install_name_tool -change $i \ if test $islib = y -a $first = y; then
`echo $i | sed -e "s,$prefix,$new_prefix,"` \ install_name_tool -id `echo $i | sed -e "s,$prefix,$new_prefix,"` $file
$file first=n
else
install_name_tool -change $i `echo $i | sed -e "s,$prefix,$new_prefix,"` $file
fi
fi fi
done done
elif test ".`file $file | grep \"text\|shell\"`" != "." ; then elif test ".`file $file | grep \"text\|shell\"`" != "." ; then
echo "Fixing up shell/text file "$file""
cp $file $file.tmp
sed -e "s,$prefix,$new_prefix,g" < $file > $file.tmp sed -e "s,$prefix,$new_prefix,g" < $file > $file.tmp
mv -f $file.tmp $file mv -f $file.tmp $file
fi fi
done done
cd $new_prefix2/lib/ files=`find . -name *.la`
pwd
files=` ls -1 *.la`
for file in $files; do for file in $files; do
echo $file echo "Fixing up .la $file"
cp $file $file.tmp
sed -e "s,$prefix,$new_prefix,g" < $file > $file.tmp sed -e "s,$prefix,$new_prefix,g" < $file > $file.tmp
mv -f $file.tmp $file mv -f $file.tmp $file
done done
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment