ios交叉编译参数

IXCODE=`xcode-select -print-path`
ISYSROOT=$IXCODE/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk
LIBNAME=libopus
DESTDIR=.libs


set -e


if [ ! -e ios ]; then
        mkdir ios
fi


rm -rf ios/*


for arch in x86_64 i386; do
        make clean
        ./configure \
                CFLAGS="-arch $arch -O2 -Wall" \
                LDFLAGS="-arch $arch" 
        make
        cp $DESTDIR/$LIBNAME.a ios/$LIBNAME-$arch.a
done


for arch in armv7 armv7s arm64; do
        make clean
        ./configure --host=arm-apple-darwin \
                CFLAGS="-arch $arch -O2 -Wall -isysroot $ISYSROOT" \
                LDFLAGS="-arch $arch" 
        make
        cp $DESTDIR/$LIBNAME.a ios/$LIBNAME-$arch.a
done




lipo -create ios/$LIBNAME-*.a -output ios/$LIBNAME.a
strip -S ios/$LIBNAME.a
lipo -info ios/$LIBNAME.a

你可能感兴趣的:(ios交叉编译参数)