Remove framework-only links when packaging VLC-release.app
[vlc.git] / projects / macosx / framework / Pre-Compile.sh
index 15c3369..4065f4a 100644 (file)
@@ -94,15 +94,17 @@ if test "${ACTION}" = "build"; then
         install_library "${VLC_BUILD_DIR}/src/${prefix}vlc" "${target}" "bin" "@loader_path/lib"
         mv ${target}/vlc ${target}/VLC
         chmod +x ${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"
@@ -115,28 +117,23 @@ if test "${ACTION}" = "build"; then
     # Create a symbolic link in the root of the framework
     mkdir -p ${target_lib}
     mkdir -p ${target_modules}
-    
-    pushd `pwd` > /dev/null 
-    cd ${TARGET_BUILD_DIR}/${FULL_PRODUCT_NAME}
-    
-    ln -sf Versions/Current/${lib} .
-    ln -sf Versions/Current/${modules} .
-    
-    popd > /dev/null 
-    # Create a symbolic link in the root of the framework
-    ##########################
-    
+
+    if [ "$FULL_PRODUCT_NAME" != "VLC-release.app" ] ; then
+        pushd `pwd` > /dev/null
+        cd ${TARGET_BUILD_DIR}/${FULL_PRODUCT_NAME}
+
+        ln -sf Versions/Current/${lib} .
+        ln -sf Versions/Current/${modules} .
+
+        popd > /dev/null
+    fi
+
     ##########################
     # Build the library folder
     echo "Building library folder... ${linked_libs}"
     for linked_lib in ${linked_libs} ; do
         case "${linked_lib}" in
-            */extras/contrib/lib/*.dylib)
-                if test -e ${linked_lib}; then
-                    install_library ${linked_lib} ${target_lib} "library"
-                fi
-                ;;
-            */vlc_install_dir/lib/*.dylib)
+            */extras/contrib/lib/*.dylib|*/vlc_install_dir/lib/*.dylib)
                 if test -e ${linked_lib}; then
                     install_library ${linked_lib} ${target_lib} "library"
                 fi