]> git.sesse.net Git - vlc/blobdiff - extras/contrib/change_prefix.sh
Use var_InheritString for --decklink-video-connection.
[vlc] / extras / contrib / change_prefix.sh
index 9a307890c1d78346aa25e3e40927f1e031ef494f..df9c0a2bef817c1420233c2f2423b4f9d709cb6d 100755 (executable)
@@ -46,29 +46,38 @@ cd $top_dir
 pwd
 files=`find . -type f`
 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 'dynamically linked shared library'`" != "." ; then
+      islib=y
+    fi
     libs=`otool -L $file 2>/dev/null | grep $prefix | cut -d\  -f 1`
-    echo $libs
+    first=y
     for i in "" $libs; do
-    echo $i
       if ! test -z $i; then
-        install_name_tool -change $i \
-                          `echo $i | sed -e "s,$prefix,$new_prefix,"` \
-                          $file
+        if test $islib = y -a $first = y; then
+            install_name_tool -id `echo $i | sed -e "s,$prefix,$new_prefix,"` $file
+            first=n
+        else
+            install_name_tool -change $i `echo $i | sed -e "s,$prefix,$new_prefix,"` $file
+        fi
       fi
     done
-  elif test ".`file $file | grep \"text\|shell\"`" != "." ; then
-
+  elif test ".`file $file | grep \"text\|shell\"`" != "." -o ".`echo $file | grep pc$`" != "."; then
+   echo "Fixing up shell/text/pc file "$file""
+    cp $file $file.tmp
     sed -e "s,$prefix,$new_prefix,g" < $file > $file.tmp
     mv -f $file.tmp $file
+  else
+    echo "Not doing anything with $file"
   fi
 done
 
-cd $new_prefix2/lib/
-pwd
-files=` ls -1 *.la`
+files=`find . -name *.la`
 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
    mv -f $file.tmp $file
 done