Commit 377173c5 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

macosx/framework: Use local variables where needed. That prevent wrong linkage...

macosx/framework: Use local variables where needed. That prevent wrong linkage with an other libvlc, and fix the multiple crash resulting in linking to 2 differents libvlc.
parent 670cfc5b
...@@ -35,23 +35,23 @@ if test "${ACTION}" = "build"; then ...@@ -35,23 +35,23 @@ if test "${ACTION}" = "build"; then
# @description Installs the specified library into the destination folder, automatically changes the references to dependencies # @description Installs the specified library into the destination folder, automatically changes the references to dependencies
# @param src_lib source library to copy to the destination directory # @param src_lib source library to copy to the destination directory
# @param dest_dir destination directory where the src_lib should be copied to # @param dest_dir destination directory where the src_lib should be copied to
install_library() { install_library() {
if [ ${3} = "library" ]; then if [ ${3} = "library" ]; then
install_name="@loader_path/lib" local install_name="@loader_path/lib"
elif [ ${3} = "module" ]; then elif [ ${3} = "module" ]; then
install_name="@loader_path/modules" local install_name="@loader_path/modules"
fi fi
if [ "${5}" != "" ]; then if [ "${5}" != "" ]; then
lib_dest="${2}/${5}" local lib_dest="${2}/${5}"
else else
lib_dest="${2}/`basename ${1}`" local lib_dest="${2}/`basename ${1}`"
fi fi
if [ "${4}" != "" ]; then if [ "${4}" != "" ]; then
lib_install_prefix="${4}" local lib_install_prefix="${4}"
else else
lib_install_prefix="@loader_path/../lib" local lib_install_prefix="@loader_path/../lib"
fi fi
if test -e ${1} && ((! test -e ${lib_dest}) || test ${1} -nt ${lib_dest} ); then if test -e ${1} && ((! test -e ${lib_dest}) || test ${1} -nt ${lib_dest} ); then
...@@ -71,18 +71,15 @@ if test "${ACTION}" = "build"; then ...@@ -71,18 +71,15 @@ if test "${ACTION}" = "build"; then
# Iterate through each installed library and modify the references to other dynamic libraries to match the framework's library directory # Iterate through each installed library and modify the references to other dynamic libraries to match the framework's library directory
for linked_lib in `otool -L ${lib_dest} | grep '(' | sed 's/\((.*)\)//'`; do for linked_lib in `otool -L ${lib_dest} | grep '(' | sed 's/\((.*)\)//'`; do
name=`basename ${linked_lib}` local name=`basename ${linked_lib}`
case "${linked_lib}" in case "${linked_lib}" in
*/vlc_build_dir/lib/* | *vlc* | */extras/contrib/lib/*) */vlc_build_dir/* | *vlc* | */extras/contrib/lib/*)
if test -e ${linked_lib}; then if test -e ${linked_lib}; then
install_name_tool -change ${linked_lib} "${lib_install_prefix}/${name}" ${lib_dest} install_name_tool -change "$linked_lib" "${lib_install_prefix}/${name}" "${lib_dest}"
linked_libs="${linked_libs} ${ref_lib}" linked_libs="${linked_libs} ${ref_lib}"
install_library ${linked_lib} ${target_lib} "library" install_library ${linked_lib} ${target_lib} "library"
fi fi
;; ;;
*)
;;
esac esac
done done
fi fi
......
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