Changeset 9afe60081bbad75e6bd907226759a182d6150ee1

Show
Ignore:
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
  • extras/MacOSX/Framework/Pre-Compile.sh

    r65f58dd r9afe600  
    99    rm -fr ${FULL_PRODUCT_NAME} 
    1010    # Debug -- 
     11fi 
     12 
     13# Hack to use that script with the current VLC-release.app 
     14if 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" 
    1121fi 
    1222 
     
    2333     
    2434    ########################## 
    25     # @function install_library(src_lib, dest_dir
     35    # @function install_library(src_lib, dest_dir, type, lib_install_prefix, destination_name
    2636    # @description Installs the specified library into the destination folder, automatically changes the references to dependencies 
    2737    # @param src_lib     source library to copy to the destination directory 
     
    3040        if [ ${3} = "library" ]; then 
    3141            install_name="@loader_path/lib" 
    32         else 
     42        elif [ ${3} = "module" ]; then 
    3343            install_name="@loader_path/modules" 
    3444        fi 
    3545         
    36         if [ "${4}" != "" ]; then 
    37             lib_dest="${2}/${4}" 
     46        if [ "${5}" != "" ]; then 
     47            lib_dest="${2}/${5}" 
    3848        else 
    3949            lib_dest="${2}/`basename ${1}`" 
    4050        fi 
     51 
     52        if [ "${4}" != "" ]; then 
     53            lib_install_prefix="${4}" 
     54        else 
     55            lib_install_prefix="@loader_path/../lib" 
     56        fi 
    4157         
    4258        if test -e ${1} && ((! test -e ${lib_dest}) || test ${1} -nt ${lib_dest} ); then 
     59             
    4360            mkdir -p ${2} 
    44              
     61 
    4562            # 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} 
    4764 
    4865            # Update the dynamic library so it will know where to look for the other libraries 
    4966            echo "Installing ${3} `basename ${lib_dest}`" 
    5067 
    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     
    5673            # Iterate through each installed library and modify the references to other dynamic libraries to match the framework's library directory 
    5774            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 
    6688            done 
    67         fi 
     89        fi 
    6890    } 
    6991    # @function install_library 
     
    104126    for linked_lib in ${linked_libs} ; do 
    105127        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" 
    112131                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 
    114137                ;; 
    115138        esac 
     
    118141    install_library "${VLC_BUILD_DIR}/src/.libs/libvlc-control.dylib" ${target_lib} "library" 
    119142    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 
    120149 
    121150    ##########################