-for arch in armv6 armv7; do
- build "ios-${arch}" iphoneos5.1 "-arch ${arch} -miphoneos-version-min=2.0" --host=arm-apple-darwin10 CPPFLAGS="-I../libffi.${arch}/include -I../sysroot.ios/usr/include -I../sysroot.ios/usr/include/apr-1" LTLIBAPR="../sysroot.ios/usr/lib/libapr-1.dylib" LDFLAGS="-L.. -L../sysroot.ios/usr/lib"
+for arch in armv6 armv7 armv7s arm64; do
+ cpf="-I../libffi.${arch}/include"
+ ldf="-L.."
+
+ flg=()
+ if [[ ${arch} != armv6 ]]; then
+ flg+=(--disable-console)
+ else
+ flg+=(LTLIBAPR="../sysroot.ios/usr/lib/libapr-1.dylib")
+ flg+=(LTLIBGCC="-lgcc_s.1")
+ cpf+=" -include ${PWD}/xcode.h"
+ cpf+=" -mllvm -arm-reserve-r9"
+ cpf+=" -I../sysroot.ios/usr/include -I../sysroot.ios/usr/include/apr-1"
+ ldf+=" -L../sysroot.ios/usr/lib"
+ fi
+
+ if [[ ${arch} == arm64 ]]; then
+ min=7.0
+ else
+ min=2.0
+ #cpf+=" -mthumb"
+ fi
+
+ build "ios-${arch}" iphoneos "-arch ${arch} -miphoneos-version-min=${min}" --host=arm-apple-darwin10 \
+ CPPFLAGS="${cpf}" LDFLAGS="${ldf}" "${flg[@]}" --host=arm-apple-darwin10