3 PLATFORM_IOS
=/Developer
/Platforms
/iPhoneOS.platform
/
4 PLATFORM_IOS_SIM
=/Developer
/Platforms
/iPhoneSimulator.platform
/
7 OUTPUT_DIR
="universal-ios"
16 mkdir
-p "${builddir}"
18 export CC
="${platform}"/Developer
/usr
/bin
/gcc-4.2
19 export CFLAGS
="-arch ${arch} -isysroot ${sdk} -miphoneos-version-min=${MIN_IOS_VERSION}"
20 ..
/configure
--host=${triple} && make
25 build_target
"${PLATFORM_IOS}" "${PLATFORM_IOS}/Developer/SDKs/iPhoneOS${SDK_IOS_VERSION}.sdk/" armv6 arm-apple-darwin10 armv6-ios
26 build_target
"${PLATFORM_IOS}" "${PLATFORM_IOS}/Developer/SDKs/iPhoneOS${SDK_IOS_VERSION}.sdk/" armv7 arm-apple-darwin10 armv7-ios
27 build_target
"${PLATFORM_IOS_SIM}" "${PLATFORM_IOS_SIM}/Developer/SDKs/iPhoneSimulator${SDK_IOS_VERSION}.sdk/" i386 i386-apple-darwin10 i386-ios-sim
29 # Create universal output directories
30 mkdir
-p "${OUTPUT_DIR}"
31 mkdir
-p "${OUTPUT_DIR}/include"
32 mkdir
-p "${OUTPUT_DIR}/include/armv6"
33 mkdir
-p "${OUTPUT_DIR}/include/armv7"
34 mkdir
-p "${OUTPUT_DIR}/include/i386"
36 # Create the universal binary
37 lipo
-create armv6-ios
/.libs
/libffi.a armv7-ios
/.libs
/libffi.a i386-ios-sim
/.libs
/libffi.a
-output "${OUTPUT_DIR}/libffi.a"
44 # Fix non-relative header reference
45 sed 's/<ffitarget.h>/"ffitarget.h"/' < "${src}/include/ffi.h" > "${dest}/ffi.h"
46 cp "${src}/include/ffitarget.h" "${dest}"
49 copy_headers armv6-ios
"${OUTPUT_DIR}/include/armv6"
50 copy_headers armv7-ios
"${OUTPUT_DIR}/include/armv7"
51 copy_headers i386-ios-sim
"${OUTPUT_DIR}/include/i386"
53 # Create top-level header
59 #include "include/armv6/ffi.h"
61 #include "include/armv7/ffi.h"
63 #elif defined(__i386__)
64 #include "include/i386/ffi.h"
67 ) > "${OUTPUT_DIR}/ffi.h"