Skip to content

Commit

Permalink
fix script
Browse files Browse the repository at this point in the history
the library paths are correctly set for all the dylib
TODO : call this script from the Makefile
  • Loading branch information
avilleret committed Feb 9, 2014
1 parent c222cf5 commit 461c735
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions embed-mac-OpenCV-dependencies.sh
Expand Up @@ -22,14 +22,14 @@ for pd_darwin in `find . -name '*.pd_darwin'`; do
install -vp /usr/local/lib/$lib $PD_APP_LIB
new_lib=`echo $lib | sed 's|.*/\(.*\.dylib\)|\1|'`
install_name_tool -id @loader_path/$new_lib $PD_APP_LIB/$new_lib
install_name_tool -change lib/$lib @loader_path/$new_lib $pd_darwin
install_name_tool -change lib/$lib @loader_path/$PD_APP_LIB/$new_lib $pd_darwin
done
echo " "
fi
done

for dylib in $PD_APP_LIB/*.dylib; do
LIBS=`otool -L $dylib | sed -n 's|.*/sw/lib/\(.*\.dylib\).*|\1|p'`
LIBS=`otool -L $dylib | sed -n 's|.*lib/\(.*\.dylib\).*|\1|p'`
if [ "x$LIBS" != "x" ]; then
echo "`echo $dylib | sed 's|.*/\(.*\.dylib\)|\1|'` is using:"
for lib in $LIBS; do
Expand All @@ -41,15 +41,15 @@ for dylib in $PD_APP_LIB/*.dylib; do
install -vp /sw/lib/$lib $PD_APP_LIB
fi
install_name_tool -id @loader_path/$new_lib $PD_APP_LIB/$new_lib
install_name_tool -change /sw/lib/$lib @loader_path/$new_lib $dylib
install_name_tool -change lib/$lib @loader_path/$new_lib $dylib
done
echo " "
fi
done

# run it one more time to catch dylibs that depend on dylibs
for dylib in $PD_APP_LIB/*.dylib; do
LIBS=`otool -L $dylib | sed -n 's|.*/sw/lib/\(.*\.dylib\).*|\1|p'`
LIBS=`otool -L $dylib | sed -n 's|.*lib/\(.*\.dylib\).*|\1|p'`
if [ "x$LIBS" != "x" ]; then
echo "`echo $dylib | sed 's|.*/\(.*\.dylib\)|\1|'` is using:"
for lib in $LIBS; do
Expand All @@ -61,15 +61,15 @@ for dylib in $PD_APP_LIB/*.dylib; do
install -vp /sw/lib/$lib $PD_APP_LIB
fi
install_name_tool -id @loader_path/$new_lib $PD_APP_LIB/$new_lib
install_name_tool -change /sw/lib/$lib @loader_path/$new_lib $dylib
install_name_tool -change lib/$lib @loader_path/$new_lib $dylib
done
echo " "
fi
done

# seems like we need it one last time! phew...
for dylib in $PD_APP_LIB/*.dylib; do
LIBS=`otool -L $dylib | sed -n 's|.*/sw/lib/\(.*\.dylib\).*|\1|p'`
LIBS=`otool -L $dylib | sed -n 's|.*lib/\(.*\.dylib\).*|\1|p'`
if [ "x$LIBS" != "x" ]; then
echo "`echo $dylib | sed 's|.*/\(.*\.dylib\)|\1|'` is using:"
for lib in $LIBS; do
Expand All @@ -81,7 +81,7 @@ for dylib in $PD_APP_LIB/*.dylib; do
install -vp /sw/lib/$lib $PD_APP_LIB
fi
install_name_tool -id @loader_path/$new_lib $PD_APP_LIB/$new_lib
install_name_tool -change /sw/lib/$lib @loader_path/$new_lib $dylib
install_name_tool -change lib/$lib @loader_path/$new_lib $dylib
done
echo " "
fi
Expand Down

0 comments on commit 461c735

Please sign in to comment.