Changeset 9afe60081bbad75e6bd907226759a182d6150ee1
- Timestamp:
- 01/02/08 02:32:05
(9 months ago)
- Author:
- Pierre d'Herbemont <pdherbemont@videolan.org>
- git-committer:
- Pierre d'Herbemont <pdherbemont@videolan.org> 1201829525 +0000
- git-parent:
[3e75c8bc8fb5246b6bcc496c240e47dc9a9e156b]
- git-author:
- Pierre d'Herbemont <pdherbemont@videolan.org> 1201829525 +0000
- Message:
MacOSX/Framework/Pre-Compile.sh: Support the VLC-release.app target.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r65f58dd |
r9afe600 |
|
| 9 | 9 | rm -fr ${FULL_PRODUCT_NAME} |
|---|
| 10 | 10 | # Debug -- |
|---|
| | 11 | fi |
|---|
| | 12 | |
|---|
| | 13 | # Hack to use that script with the current VLC-release.app |
|---|
| | 14 | if test "${ACTION}" = "VLC-release.app"; then |
|---|
| | 15 | TARGET_BUILD_DIR="${build_dir}" |
|---|
| | 16 | FULL_PRODUCT_NAME="VLC-release.app" |
|---|
| | 17 | CONTENTS_FOLDER_PATH="${FULL_PRODUCT_NAME}/Contents/MacOS" |
|---|
| | 18 | VLC_BUILD_DIR="${build_dir}" |
|---|
| | 19 | VLC_SRC_DIR="${src_dir}" |
|---|
| | 20 | ACTION="build" |
|---|
| 11 | 21 | fi |
|---|
| 12 | 22 | |
|---|
| … | … | |
| 23 | 33 | |
|---|
| 24 | 34 | ########################## |
|---|
| 25 | | # @function install_library(src_lib, dest_dir) |
|---|
| | 35 | # @function install_library(src_lib, dest_dir, type, lib_install_prefix, destination_name) |
|---|
| 26 | 36 | # @description Installs the specified library into the destination folder, automatically changes the references to dependencies |
|---|
| 27 | 37 | # @param src_lib source library to copy to the destination directory |
|---|
| … | … | |
| 30 | 40 | if [ ${3} = "library" ]; then |
|---|
| 31 | 41 | install_name="@loader_path/lib" |
|---|
| 32 | | else |
|---|
| | 42 | elif [ ${3} = "module" ]; then |
|---|
| 33 | 43 | install_name="@loader_path/modules" |
|---|
| 34 | 44 | fi |
|---|
| 35 | 45 | |
|---|
| 36 | | if [ "${4}" != "" ]; then |
|---|
| 37 | | lib_dest="${2}/${4}" |
|---|
| | 46 | if [ "${5}" != "" ]; then |
|---|
| | 47 | lib_dest="${2}/${5}" |
|---|
| 38 | 48 | else |
|---|
| 39 | 49 | lib_dest="${2}/`basename ${1}`" |
|---|
| 40 | 50 | fi |
|---|
| | 51 | |
|---|
| | 52 | if [ "${4}" != "" ]; then |
|---|
| | 53 | lib_install_prefix="${4}" |
|---|
| | 54 | else |
|---|
| | 55 | lib_install_prefix="@loader_path/../lib" |
|---|
| | 56 | fi |
|---|
| 41 | 57 | |
|---|
| 42 | 58 | if test -e ${1} && ((! test -e ${lib_dest}) || test ${1} -nt ${lib_dest} ); then |
|---|
| | 59 | |
|---|
| 43 | 60 | mkdir -p ${2} |
|---|
| 44 | | |
|---|
| | 61 | |
|---|
| 45 | 62 | # Lets copy the library from the source folder to our new destination folder |
|---|
| 46 | | cp ${1} ${lib_dest} |
|---|
| | 63 | install -m 644 ${1} ${lib_dest} |
|---|
| 47 | 64 | |
|---|
| 48 | 65 | # Update the dynamic library so it will know where to look for the other libraries |
|---|
| 49 | 66 | echo "Installing ${3} `basename ${lib_dest}`" |
|---|
| 50 | 67 | |
|---|
| 51 | | # Change the reference of libvlc.1 stored in the usr directory to libvlc.dylib in the framework's library directory |
|---|
| 52 | | install_name_tool -change /usr/local/lib/libvlc.1.dylib @loader_path/../lib/libvlc.dylib ${lib_dest} |
|---|
| 53 | | install_name_tool -change @executable_path/lib/vlc_libintl.dylib @loader_path/../lib/vlc_libintl.dylib ${lib_dest} |
|---|
| 54 | | install_name_tool -id "${install_name}/`basename ${lib_dest}`" ${lib_dest} |
|---|
| 55 | | |
|---|
| | 68 | if [ "${3}" != "bin" ]; then |
|---|
| | 69 | # Change the reference of libvlc.1 stored in the usr directory to libvlc.dylib in the framework's library directory |
|---|
| | 70 | install_name_tool -id "${install_name}/`basename ${lib_dest}`" ${lib_dest} > /dev/null |
|---|
| | 71 | fi |
|---|
| | 72 | |
|---|
| 56 | 73 | # Iterate through each installed library and modify the references to other dynamic libraries to match the framework's library directory |
|---|
| 57 | 74 | for linked_lib in `otool -L ${lib_dest} | grep '(' | sed 's/\((.*)\)//'`; do |
|---|
| 58 | | ref_lib=`echo "${linked_lib}" | sed 's:executable_path/:loader_path/../:'` |
|---|
| 59 | | |
|---|
| 60 | | if test "${ref_lib}" != "${linked_lib}"; then |
|---|
| 61 | | install_name_tool -change ${linked_lib} ${ref_lib} ${lib_dest} |
|---|
| 62 | | fi |
|---|
| 63 | | if test `echo "${ref_lib}" | grep "^@loader_path"`; then |
|---|
| 64 | | linked_libs="${linked_libs} ${ref_lib}" |
|---|
| 65 | | fi; |
|---|
| | 75 | name=`basename ${linked_lib}` |
|---|
| | 76 | case "${linked_lib}" in |
|---|
| | 77 | */vlc_install_dir/lib/* | */extras/contrib/lib/*) |
|---|
| | 78 | if test -e ${linked_lib}; then |
|---|
| | 79 | install_name_tool -change ${linked_lib} "${lib_install_prefix}/${name}" ${lib_dest} |
|---|
| | 80 | linked_libs="${linked_libs} ${ref_lib}" |
|---|
| | 81 | |
|---|
| | 82 | install_library ${linked_lib} ${target_lib} "library" |
|---|
| | 83 | fi |
|---|
| | 84 | ;; |
|---|
| | 85 | *) |
|---|
| | 86 | ;; |
|---|
| | 87 | esac |
|---|
| 66 | 88 | done |
|---|
| 67 | | fi |
|---|
| | 89 | fi |
|---|
| 68 | 90 | } |
|---|
| 69 | 91 | # @function install_library |
|---|
| … | … | |
| 104 | 126 | for linked_lib in ${linked_libs} ; do |
|---|
| 105 | 127 | case "${linked_lib}" in |
|---|
| 106 | | @loader_path/../lib/*) |
|---|
| 107 | | ref_lib=`echo ${linked_lib} | sed 's:@loader_path/../lib/::'` |
|---|
| 108 | | if test -e ${VLC_BUILD_DIR}/extras/contrib/vlc-lib/${ref_lib}; then |
|---|
| 109 | | src_lib=${VLC_BUILD_DIR}/extras/contrib/vlc-lib/${ref_lib} |
|---|
| 110 | | elif test -e ${VLC_BUILD_DIR}/src/.libs/${ref_lib}; then |
|---|
| 111 | | src_lib=${VLC_BUILD_DIR}/src/.libs/${ref_lib} |
|---|
| | 128 | */extras/contrib/lib/*.dylib) |
|---|
| | 129 | if test -e ${linked_lib}; then |
|---|
| | 130 | install_library ${linked_lib} ${target_lib} "library" |
|---|
| 112 | 131 | fi |
|---|
| 113 | | install_library ${src_lib} ${target_lib} "library" |
|---|
| | 132 | ;; |
|---|
| | 133 | */vlc_install_dir/lib/*.dylib) |
|---|
| | 134 | if test -e ${linked_lib}; then |
|---|
| | 135 | install_library ${linked_lib} ${target_lib} "library" |
|---|
| | 136 | fi |
|---|
| 114 | 137 | ;; |
|---|
| 115 | 138 | esac |
|---|
| … | … | |
| 118 | 141 | install_library "${VLC_BUILD_DIR}/src/.libs/libvlc-control.dylib" ${target_lib} "library" |
|---|
| 119 | 142 | install_library "${VLC_BUILD_DIR}/src/.libs/libvlc.dylib" ${target_lib} "library" |
|---|
| | 143 | |
|---|
| | 144 | ########################## |
|---|
| | 145 | # Hack for VLC-release.app |
|---|
| | 146 | if [ "$FULL_PRODUCT_NAME" = "VLC-release.app" ] ; then |
|---|
| | 147 | install_library "${VLC_BUILD_DIR}/.libs/vlc" "${target}" "bin" "@loader_path/lib" |
|---|
| | 148 | fi |
|---|
| 120 | 149 | |
|---|
| 121 | 150 | ########################## |
|---|