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.
31 lines
853 B
Bash
31 lines
853 B
Bash
#!/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!
|
|
##
|