Commit 87ad2e0b authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

MacOSX/Framework: Properly track updated library and modules.

parent 6de31c59
......@@ -37,7 +37,7 @@ if test "${ACTION}" = "build"; then
lib_dest="${2}/`basename ${1}`"
fi
if test -e ${1} && ! test -e ${lib_dest}; then
if test -e ${1} && ((! test -e ${lib_dest}) || test ${1} -nt ${lib_dest} ); then
mkdir -p ${2}
# Lets copy the library from the source folder to our new destination folder
......
......@@ -251,6 +251,7 @@
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "VLC" */;
compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
mainGroup = 0867D691FE84028FC02AAC07 /* VLC */;
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
......@@ -284,7 +285,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if test \"${ACTION}\" = \"\"; then\n # Debug --\n TARGET_BUILD_DIR=\".\"\n FULL_PRODUCT_NAME=\"VLC.framework\"\n CONTENTS_FOLDER_PATH=\"${FULL_PRODUCT_NAME}/Versions/A\"\n VLC_BUILD_DIR=\"../../..\"\n VLC_SRC_DIR=\"../../..\"\n ACTION=\"build\"\n rm -fr ${FULL_PRODUCT_NAME}\n # Debug --\nfi\n\nif test \"${ACTION}\" = \"build\"; then \n vlc_config=\"${VLC_SRC_DIR}/vlc-config\"\n lib=\"lib\"\n modules=\"modules\"\n target=\"${TARGET_BUILD_DIR}/${CONTENTS_FOLDER_PATH}\"\n target_lib=\"${target}/${lib}\" # Should we consider using a different well-known folder like shared resources?\n target_modules=\"${target}/${modules}\" # Should we consider using a different well-known folder like shared resources?\n linked_libs=\" \"\n \n ##########################\n # @function install_library(src_lib, dest_dir)\n # @description Installs the specified library into the destination folder, automatically changes the references to dependencies\n # @param src_lib source library to copy to the destination directory\n # @param dest_dir destination directory where the src_lib should be copied to\n install_library() { \n if [ ${3} = \"library\" ]; then\n install_name=\"@loader_path/lib\"\n else\n install_name=\"@loader_path/modules\"\n fi\n \n if [ \"${4}\" != \"\" ]; then\n lib_dest=\"${2}/${4}\"\n else\n lib_dest=\"${2}/`basename ${1}`\"\n fi\n \n if test -e ${1} && ! test -e ${lib_dest}; then\n mkdir -p ${2}\n \n # Lets copy the library from the source folder to our new destination folder\n cp ${1} ${lib_dest}\n\n # Update the dynamic library so it will know where to look for the other libraries\n echo \"Installing ${3} `basename ${lib_dest}`\"\n\n # Change the reference of libvlc.1 stored in the usr directory to libvlc.dylib in the framework's library directory\n install_name_tool -change /usr/local/lib/libvlc.1.dylib @loader_path/../lib/libvlc.dylib ${lib_dest}\n install_name_tool -change @executable_path/lib/vlc_libintl.dylib @loader_path/../lib/vlc_libintl.dylib ${lib_dest}\n install_name_tool -id \"${install_name}/`basename ${lib_dest}`\" ${lib_dest}\n\n # Iterate through each installed library and modify the references to other dynamic libraries to match the framework's library directory\n for linked_lib in `otool -L ${lib_dest} | grep '(' | sed 's/\\((.*)\\)//'`; do\n ref_lib=`echo \"${linked_lib}\" | sed 's:executable_path/:loader_path/../:'`\n \n if test \"${ref_lib}\" != \"${linked_lib}\"; then\n install_name_tool -change ${linked_lib} ${ref_lib} ${lib_dest}\n fi\n if test `echo \"${ref_lib}\" | grep \"^@loader_path\"`; then\n linked_libs=\"${linked_libs} ${ref_lib}\"\n fi;\n done\n fi\n }\n # @function install_library\n ##########################\n\n ##########################\n # Build the modules folder (Same as VLC.framework/modules in Makefile)\n echo \"Building modules folder...\"\n # Figure out what modules are available to install\n for module in `top_builddir=\"${VLC_BUILD_DIR}\" ${vlc_config} --target plugin` ; do\n # Check to see that the reported module actually exists\n if test -n ${module}; then\n module_src=\"`dirname ${module}`/.libs/`basename ${module}`.dylib\"\n install_library ${module_src} ${target_modules} \"module\"\n fi\n done\n # Build the modules folder\n ##########################\n\n ##########################\n # Create a symbolic link in the root of the framework\n mkdir -p ${target_lib}\n mkdir -p ${target_modules}\n \n pushd `pwd` > /dev/null \n cd ${TARGET_BUILD_DIR}/${FULL_PRODUCT_NAME}\n \n ln -sf Versions/Current/${lib} .\n ln -sf Versions/Current/${modules} .\n \n popd > /dev/null \n # Create a symbolic link in the root of the framework\n ##########################\n \n ##########################\n # Build the library folder (Same as VLC.framework/lib in Makefile)\n echo \"Building library folder...\"\n for linked_lib in ${linked_libs} ; do\n case \"${linked_lib}\" in\n @loader_path/../lib/*)\n ref_lib=`echo ${linked_lib} | sed 's:@loader_path/../lib/::'`\n if test -e ${VLC_BUILD_DIR}/extras/contrib/vlc-lib/${ref_lib}; then\n src_lib=${VLC_BUILD_DIR}/extras/contrib/vlc-lib/${ref_lib}\n elif test -e ${VLC_BUILD_DIR}/src/.libs/${ref_lib}; then\n src_lib=${VLC_BUILD_DIR}/src/.libs/${ref_lib}\n fi\n install_library ${src_lib} ${target_lib} \"library\"\n ;;\n esac\n done\n # Build the library folder\n ##########################\n install_library \"${VLC_BUILD_DIR}/src/.libs/libvlc-control.dylib\" ${target_lib} \"library\"\nfi";
shellScript = "if test \"${ACTION}\" = \"\"; then\n # Debug --\n TARGET_BUILD_DIR=\".\"\n FULL_PRODUCT_NAME=\"VLC.framework\"\n CONTENTS_FOLDER_PATH=\"${FULL_PRODUCT_NAME}/Versions/A\"\n VLC_BUILD_DIR=\"../../..\"\n VLC_SRC_DIR=\"../../..\"\n ACTION=\"build\"\n rm -fr ${FULL_PRODUCT_NAME}\n # Debug --\nfi\n\nif test \"${ACTION}\" = \"build\"; then \n vlc_config=\"${VLC_SRC_DIR}/vlc-config\"\n lib=\"lib\"\n modules=\"modules\"\n target=\"${TARGET_BUILD_DIR}/${CONTENTS_FOLDER_PATH}\"\n target_lib=\"${target}/${lib}\" # Should we consider using a different well-known folder like shared resources?\n target_modules=\"${target}/${modules}\" # Should we consider using a different well-known folder like shared resources?\n linked_libs=\" \"\n \n ##########################\n # @function install_library(src_lib, dest_dir)\n # @description Installs the specified library into the destination folder, automatically changes the references to dependencies\n # @param src_lib source library to copy to the destination directory\n # @param dest_dir destination directory where the src_lib should be copied to\n install_library() { \n if [ ${3} = \"library\" ]; then\n install_name=\"@loader_path/lib\"\n else\n install_name=\"@loader_path/modules\"\n fi\n \n if [ \"${4}\" != \"\" ]; then\n lib_dest=\"${2}/${4}\"\n else\n lib_dest=\"${2}/`basename ${1}`\"\n fi\n \n if test -e ${1} && ((! test -e ${lib_dest}) || test ${1} -nt ${lib_dest} ); then\n mkdir -p ${2}\n \n # Lets copy the library from the source folder to our new destination folder\n cp ${1} ${lib_dest}\n\n # Update the dynamic library so it will know where to look for the other libraries\n echo \"Installing ${3} `basename ${lib_dest}`\"\n\n # Change the reference of libvlc.1 stored in the usr directory to libvlc.dylib in the framework's library directory\n install_name_tool -change /usr/local/lib/libvlc.1.dylib @loader_path/../lib/libvlc.dylib ${lib_dest}\n install_name_tool -change @executable_path/lib/vlc_libintl.dylib @loader_path/../lib/vlc_libintl.dylib ${lib_dest}\n install_name_tool -id \"${install_name}/`basename ${lib_dest}`\" ${lib_dest}\n\n # Iterate through each installed library and modify the references to other dynamic libraries to match the framework's library directory\n for linked_lib in `otool -L ${lib_dest} | grep '(' | sed 's/\\((.*)\\)//'`; do\n ref_lib=`echo \"${linked_lib}\" | sed 's:executable_path/:loader_path/../:'`\n \n if test \"${ref_lib}\" != \"${linked_lib}\"; then\n install_name_tool -change ${linked_lib} ${ref_lib} ${lib_dest}\n fi\n if test `echo \"${ref_lib}\" | grep \"^@loader_path\"`; then\n linked_libs=\"${linked_libs} ${ref_lib}\"\n fi;\n done\n fi\n }\n # @function install_library\n ##########################\n\n ##########################\n # Build the modules folder (Same as VLC.framework/modules in Makefile)\n echo \"Building modules folder...\"\n # Figure out what modules are available to install\n for module in `top_builddir=\"${VLC_BUILD_DIR}\" ${vlc_config} --target plugin` ; do\n # Check to see that the reported module actually exists\n if test -n ${module}; then\n module_src=\"`dirname ${module}`/.libs/`basename ${module}`.dylib\"\n install_library ${module_src} ${target_modules} \"module\"\n fi\n done\n # Build the modules folder\n ##########################\n\n ##########################\n # Create a symbolic link in the root of the framework\n mkdir -p ${target_lib}\n mkdir -p ${target_modules}\n \n pushd `pwd` > /dev/null \n cd ${TARGET_BUILD_DIR}/${FULL_PRODUCT_NAME}\n \n ln -sf Versions/Current/${lib} .\n ln -sf Versions/Current/${modules} .\n \n popd > /dev/null \n # Create a symbolic link in the root of the framework\n ##########################\n \n ##########################\n # Build the library folder (Same as VLC.framework/lib in Makefile)\n echo \"Building library folder...\"\n for linked_lib in ${linked_libs} ; do\n case \"${linked_lib}\" in\n @loader_path/../lib/*)\n ref_lib=`echo ${linked_lib} | sed 's:@loader_path/../lib/::'`\n if test -e ${VLC_BUILD_DIR}/extras/contrib/vlc-lib/${ref_lib}; then\n src_lib=${VLC_BUILD_DIR}/extras/contrib/vlc-lib/${ref_lib}\n elif test -e ${VLC_BUILD_DIR}/src/.libs/${ref_lib}; then\n src_lib=${VLC_BUILD_DIR}/src/.libs/${ref_lib}\n fi\n install_library ${src_lib} ${target_lib} \"library\"\n ;;\n esac\n done\n # Build the library folder\n ##########################\n install_library \"${VLC_BUILD_DIR}/src/.libs/libvlc-control.dylib\" ${target_lib} \"library\"\nfi";
};
/* End PBXShellScriptBuildPhase section */
......
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