[vlc-commits] VLCKit: install fat binary when needed

Faustino E. Osuna git at videolan.org
Thu Jan 26 15:09:36 CET 2012


vlc | branch: master | Faustino E. Osuna <enrique.osuna at gmail.com> | Tue Jan 24 01:31:57 2012 +0100| [a16514d925db93bd46cd785745bc6cd013e778a8] | committer: Jean-Baptiste Kempf

VLCKit: install fat binary when needed

If we are only targeting a single architecture, then install the
architecture specific binary files instead of creating a fat binary
with a single architecture.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a16514d925db93bd46cd785745bc6cd013e778a8
---

 projects/macosx/framework/Pre-Compile.sh |   45 +++++++++++++++++------------
 1 files changed, 26 insertions(+), 19 deletions(-)

diff --git a/projects/macosx/framework/Pre-Compile.sh b/projects/macosx/framework/Pre-Compile.sh
index ef0aea6..9de7321 100644
--- a/projects/macosx/framework/Pre-Compile.sh
+++ b/projects/macosx/framework/Pre-Compile.sh
@@ -54,6 +54,7 @@ target_share="${target}/${share}"        # Should we consider using a different
 linked_libs=""
 prefix=".libs"
 suffix="dylib"
+num_archs=$(echo `echo $ARCHS | wc -w`)
 
 ##########################
 # @function vlc_install_object(src_lib, dest_dir, type, lib_install_prefix, destination_name, suffix)
@@ -178,26 +179,32 @@ vlc_install() {
                     rm "$fatdest"
                 fi
 
-                # Create a temporary destination dir to store each ARCH object file
-                local tmp_dest_dir="$VLC_BUILD_DIR/tmp/$type"
-                rm -Rf "${tmp_dest_dir}/*"
-                mkdir -p "$tmp_dest_dir"
-
-                # Search for each ARCH object file used to construct a fat image
-                local objects=""
-                for arch in $ARCHS; do
-                    local arch_src="$VLC_BUILD_DIR/$arch/$src_dir/$src"
-                    vlc_install_object "$arch_src" "$tmp_dest_dir" "$type" "$5" "" ".$arch"
-                    local dest="$tmp_dest_dir/$src.$arch"
-                    if [ -e ${dest} ]; then
-                        objects="${dest} $objects"
-                    else
-                        echo "Warning: building $arch_src without $arch"
-                    fi
-                done;
+                if test "$num_archs" = "1"; then
+                    echo "Copying $ARCHS $type $fatdest"
+                    local arch_src="$VLC_BUILD_DIR/$ARCHS/$src_dir/$src"
+                    vlc_install_object "$arch_src" "$dest_dir" "$type" "$5" ""
+                else
+                    # Create a temporary destination dir to store each ARCH object file
+                    local tmp_dest_dir="$VLC_BUILD_DIR/tmp/$type"
+                    rm -Rf "${tmp_dest_dir}/*"
+                    mkdir -p "$tmp_dest_dir"
+
+                    # Search for each ARCH object file used to construct a fat image
+                    local objects=""
+                    for arch in $ARCHS; do
+                        local arch_src="$VLC_BUILD_DIR/$arch/$src_dir/$src"
+                        vlc_install_object "$arch_src" "$tmp_dest_dir" "$type" "$5" "" ".$arch"
+                        local dest="$tmp_dest_dir/$src.$arch"
+                        if [ -e ${dest} ]; then
+                            objects="${dest} $objects"
+                        else
+                            echo "Warning: building $arch_src without $arch"
+                        fi
+                    done;
 
-                echo "Creating fat $type $fatdest"
-                lipo $objects -output "$fatdest" -create
+                    echo "Creating fat $type $fatdest"
+                    lipo $objects -output "$fatdest" -create
+                fi
             fi
         fi
     fi



More information about the vlc-commits mailing list