You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
803 B
Plaintext

#!/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
echo $U $(lipo -info $U|sed -E -e "s/Architectures in the fat file://" -e "s/ are:/ : /") $(stat $U | cut -d' ' -f 2)
fi
fi
done
done
# That's all Folks!
##