facilitate compiling for iPhone OS on Linux, thanks to gwenhael

This commit is contained in:
matthias.ringwald 2010-03-02 20:09:12 +00:00
parent 75a700aaf9
commit 6aa07b5542

View File

@ -16,7 +16,10 @@ AC_ARG_WITH(iphone-ip, [AS_HELP_STRING([--with-iphone-ip=192.168.1.5], [Specify
AC_ARG_WITH(vendor-id, [AS_HELP_STRING([--with-vendor-id=vendorID], [Specify USB BT Dongle vendorID])], USB_VENDOR_ID=$withval, USB_VENDOR_ID="")
AC_ARG_WITH(product-id, [AS_HELP_STRING([--with-product-id=productID], [Specify USB BT Dongle productID])], USB_PRODUCT_ID=$withval, USB_PRODUCT_ID="")
AC_ARG_ENABLE(ldid, [AS_HELP_STRING([--enable-ldid], [Code sign binaries with ldid])], USE_LDID=$enableval, USE_LDID_ID="no")
AC_ARG_WITH(developer-path, [AS_HELP_STRING([--with-developer-path=path],
[Specify toolchain path])], DEVELOPER_PATH=$withval, DEVELOPER_PATH="/Developer/Platforms/iPhoneOS.platform/Developer")
AC_ARG_WITH(sdk-version, [AS_HELP_STRING([--with-sdk-version=2.0], [Specify SDK version])], SDK_VERSION=$withval, SDK_VERSION="2.0")
AC_ARG_WITH(gcc-version, [AS_HELP_STRING([--with-gcc-version=4.0.1], [Specify GCC version])], GCC_VERSION=$withval, GCC_VERSION="4.0.1")
# BUILD/HOST/TARGET
AC_CANONICAL_HOST
@ -70,6 +73,13 @@ case "$host_os" in
BTSTACK_LIB_LDFLAGS="-dynamiclib -install_name \$(prefix)/lib/libBTstack.dylib"
BTSTACK_LIB_EXTENSION="dylib"
;;
linux-*)
RUN_LOOP_SOURCES="$RUN_LOOP_SOURCES run_loop_cocoa.m"
LDFLAGS="$LDFLAGS -framework CoreFoundation"
USE_COCOA_RUN_LOOP="yes"
BTSTACK_LIB_LDFLAGS="-dynamiclib -install_name \$(prefix)/lib/libBTstack.dylib"
BTSTACK_LIB_EXTENSION="dylib"
;;
*)
USE_COCOA_RUN_LOOP="no"
BTSTACK_LIB_LDFLAGS="-shared -Wl,-rpath,\$(prefix)/lib"
@ -78,14 +88,12 @@ case "$host_os" in
esac
# iPhone/iPod touch cross-compilation for darwin
DEVELOPER_PATH="/Developer/Platforms/iPhoneOS.platform/Developer"
SDK_VERSION="2.0"
SDK_PATH="$DEVELOPER_PATH/SDKs/iPhoneOS$SDK_VERSION.sdk"
GCC_VERSION="4.0.1"
if test "x$target" = xiphone; then
case "$host_os" in
darwin*)
echo "Cross-compiling for iPhone/iPod touch using Apple's iPhone SDK"
echo "Cross-compiling for iPhone/iPod touch using Apple's iPhone SDK $SDK_VERSION, GCC $GCC_VERSION"
echo "SDK path: $SDK_PATH"
# echo "iPhone staging dir: $prefix"
echo "iPhone IP for install-iphone target: $IPHONE_IP"
CC="$DEVELOPER_PATH/usr/bin/arm-apple-darwin9-gcc-$GCC_VERSION"
@ -100,6 +108,23 @@ if test "x$target" = xiphone; then
LDFLAGS="$LDFLAGS $SDK_PATH/System/Library/PrivateFrameworks/BluetoothManager.framework/BluetoothManager"
LDFLAGS="$LDFLAGS -lIOKit -lobjc"
;;
linux*)
echo "Cross-compiling for iPhone/iPod touch using Apple's iPhone SDK $SDK_VERSION, GCC $GCC_VERSION"
echo "SDK path: $SDK_PATH"
# echo "iPhone staging dir: $prefix"
echo "iPhone IP for install-iphone target: $IPHONE_IP"
CC="$DEVELOPER_PATH/pre/bin/arm-apple-darwin9-gcc-$GCC_VERSION"
OBJC="$DEVELOPER_PATH/pre/bin/arm-apple-darwin9-g++"
CFLAGS="$CFLAGS -g"
CPPFLAGS="$CPPFLAGS -I$SDK_PATH/usr/include"
CPPFLAGS="$CPPFLAGS -I$SDK_PATH/usr/lib/gcc/arm-apple-darwin9/$GCC_VERSION/include"
CPPFLAGS="$CPPFLAGS -F$SDK_PATH/System/Library/Frameworks"
LDFLAGS="$LDFLAGS -F$SDK_PATH/System/Library/Frameworks"
LDFLAGS="$LDFLAGS -L$SDK_PATH/usr/lib -framework Foundation -framework CoreFoundation -framework UIKit"
LDFLAGS="$LDFLAGS -L$SDK_PATH/System/Library/Frameworks/IOKit.framework/Versions/A"
LDFLAGS="$LDFLAGS $SDK_PATH/System/Library/PrivateFrameworks/BluetoothManager.framework/BluetoothManager"
LDFLAGS="$LDFLAGS -lIOKit -lobjc"
;;
*)
AC_MSG_ERROR(Don't know how to compile without Apple's iPhone SDK, sorry.)
;;