#!/bin/bash ## # makeUniversal - combine .i386 and .x86_64 build results into .libs # this script is called by buildForMac ## ## # search for directories called .x86_64 # run every file and lipo .x86_64/file .x86_64/file -> .libs/file for D in $(find . -name ".x86_64"); do for F in $(find $(dirname $D)/.x86_64 -type f); do f=$(echo $F | sed -E -e "s/.x86_64/.i386/") U=$(echo $F | sed -E -e "s/.x86_64/.libs/") if [[ -e $f && -e $F ]]; then # echo $F $f -> $U lipo -arch i386 $f -arch x86_64 $F -create -output $U if [ $? != '0' ]; then echo FAILED lipo -arch i386 $f -arch x86_64 $F -create -output $U else eval $(stat -s $U) s=$(printf "%10s" ${st_size}) echo $(lipo -info $U|sed -E -e "s/Architectures in the fat file://" -e "s/ are://" -e "s#$U##" ) "$s" $U fi fi done done # That's all Folks! ##