]> git.sesse.net Git - vlc/blobdiff - projects/macosx/framework/Pre-Compile.sh
macosx: Use $suffix in Pre-Compile.sh, and install as requested by funman.
[vlc] / projects / macosx / framework / Pre-Compile.sh
index 844bd6d0ca44342d7d3b2dc8a6657f7490545d13..fe503244c8148e11a56af1ddd5df8d5f422a7d97 100644 (file)
@@ -35,23 +35,23 @@ if test "${ACTION}" = "build"; then
     # @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 dest_dir    destination directory where the src_lib should be copied to
-    install_library() {    
+    install_library() { 
+   
         if [ ${3} = "library" ]; then
-            install_name="@loader_path/lib"
+            local install_name="@loader_path/lib"
         elif [ ${3} = "module" ]; then
-            install_name="@loader_path/modules"
+            local install_name="@loader_path/modules"
         fi
-        
         if [ "${5}" != "" ]; then
-            lib_dest="${2}/${5}"
+            local lib_dest="${2}/${5}"
         else
-            lib_dest="${2}/`basename ${1}`"
+            local lib_dest="${2}/`basename ${1}`"
         fi
 
         if [ "${4}" != "" ]; then
-            lib_install_prefix="${4}"
+            local lib_install_prefix="${4}"
         else
-            lib_install_prefix="@loader_path/../lib"
+            local lib_install_prefix="@loader_path/../lib"
         fi
         
         if test -e ${1} && ((! test -e ${lib_dest}) || test ${1} -nt ${lib_dest} ); 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
             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
-                    */vlc_build_dir/lib/*  | *vlc* | */extras/contrib/lib/*)
+                    */vlc_build_dir/*  | *vlc* | */extras/contrib/lib/*)
                         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}"
-
                             install_library ${linked_lib} ${target_lib} "library"
                         fi
                         ;;
-                    *)
-                        ;;
                 esac
             done
          fi
@@ -93,17 +90,20 @@ if test "${ACTION}" = "build"; then
     ##########################
     # Hack for VLC-release.app
     if [ "$FULL_PRODUCT_NAME" = "VLC-release.app" ] ; then
-        install_library "${VLC_BUILD_DIR}/${prefix}vlc" "${target}" "bin" "@loader_path/lib"
         prefix=".libs/"
+        install_library "${VLC_BUILD_DIR}/src/${prefix}vlc" "${target}" "bin" "@loader_path/lib"
+        install ${target}/vlc ${target}/VLC
+        suffix="dylib"
     else
         prefix=""
+        suffix="so"
     fi
 
     ##########################
     # Build the modules folder (Same as VLCKit.framework/modules in Makefile)
     echo "Building modules folder..."
     # Figure out what modules are available to install
-    for module in `find ${VLC_BUILD_DIR}/modules -name *.so` ; do
+    for module in `find ${VLC_BUILD_DIR}/modules -name *.${suffix}` ; do
         # Check to see that the reported module actually exists
         if test -n ${module}; then
             install_library ${module} ${target_modules} "module"
@@ -152,8 +152,7 @@ if test "${ACTION}" = "build"; then
     ##########################
     # Build the share folder
     echo "Building share folder..."
-    pbxcp="/Developer/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp -exclude .DS_Store -exclude CVS -exclude .svn -resolve-src-symlinks"
+    pbxcp="/Developer/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp -exclude .DS_Store -resolve-src-symlinks"
     mkdir -p ${target_share}
-    $pbxcp ${VLC_SRC_DIR}/share/luameta ${target_share}
-    $pbxcp ${VLC_SRC_DIR}/share/luaplaylist ${target_share}
+    $pbxcp ${VLC_SRC_DIR}/share/lua ${target_share}
 fi