2013-08-22 19:14:21 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2013-08-26 20:39:29 +02:00
|
|
|
echo "Building libffi ============================="
|
|
|
|
|
2013-08-22 19:14:21 +02:00
|
|
|
. $(dirname $0)/environment.sh
|
|
|
|
|
|
|
|
if [ ! -f $CACHEROOT/libffi-$FFI_VERSION.tar.gz ]; then
|
2013-08-23 14:16:31 +02:00
|
|
|
try curl -L ftp://sourceware.org/pub/libffi/libffi-$FFI_VERSION.tar.gz > $CACHEROOT/libffi-$FFI_VERSION.tar.gz
|
2013-08-22 19:14:21 +02:00
|
|
|
fi
|
|
|
|
if [ ! -d $TMPROOT/libffi-$FFI_VERSION ]; then
|
2013-08-23 14:16:31 +02:00
|
|
|
try rm -rf $TMPROOT/libffi-$FFI_VERSION
|
|
|
|
try tar xvf $CACHEROOT/libffi-$FFI_VERSION.tar.gz
|
|
|
|
try mv libffi-$FFI_VERSION $TMPROOT
|
2013-08-22 19:14:21 +02:00
|
|
|
fi
|
|
|
|
|
2013-10-08 11:02:05 +02:00
|
|
|
if [ -f $TMPROOT/libffi-$FFI_VERSION/build/Release-iphoneos/libffi.a ]; then
|
2013-08-23 14:16:31 +02:00
|
|
|
exit 0;
|
2013-08-22 19:14:21 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
# lib not found, compile it
|
|
|
|
pushd $TMPROOT/libffi-$FFI_VERSION
|
2013-08-26 20:39:29 +02:00
|
|
|
try patch -p1 < $KIVYIOSROOT/src/ffi_files/ffi-$FFI_VERSION-sysv.S.patch
|
2013-08-22 19:14:21 +02:00
|
|
|
|
|
|
|
try xcodebuild -project libffi.xcodeproj -target "libffi iOS" -configuration Release -sdk iphoneos$SDKVER OTHER_CFLAGS="-no-integrated-as"
|
|
|
|
|
|
|
|
try cp build/Release-iphoneos/libffi.a $BUILDROOT/lib/libffi.a
|
|
|
|
try cp -a build/Release-iphoneos/usr/local/include $BUILDROOT/include/ffi
|
|
|
|
popd
|