[cairo] Cairo on iOS

Dan Cartman DanC at xta.co.uk
Tue Dec 14 05:53:53 PST 2010


I'm working on a project using Cairo which is working on Win32 and MacOSX and I'm now trying to build Cairo for use on iOS.  I know several people have successfully achieved this already but I'm not an expert in this area and would appreciate a little advice.

My plan is to roughly follow the end-to-end build instructions for MaxOSX on the website, but to use a configure script for each package to set the various options needed to create the simulator and iOS versions of the library.  Following a previous post and various search results, I'm using the following configure script for the simulator :

#!/bin/sh

export DEVROOT=/Developer/Platforms/iPhoneSimulator.platform/Developer
export SDKROOT=$DEVROOT/SDKs/iPhoneSimulator4.2.sdk

export CPPFLAGS="-I$SDKROOT/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/ -I$SDKROOT/usr/include/ -I$SDKROOT/System/Library/Frameworks/"
export CFLAGS="$CPPFLAGS -arch i686 -pipe -no-cpp-precomp -isysroot $SDKROOT"
export CPP="$DEVROOT/usr/bin/cpp $CPPFLAGS"
export CXXFLAGS="$CFLAGS"

LIBNAME="cairosim"

../configure CXX=$DEVROOT/usr/bin/i686-apple-darwin10-g++-4.2.1 CC=$DEVROOT/usr/bin/i686-apple-darwin10-gcc-4.2.1 LD=$DEVROOT/usr/bin/ld --host=i686-apple-darwin 

However, I'm getting the following error :

configure: WARNING: if you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used
checking for arm-apple-darwin-gcc... /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1
checking whether the C compiler works... no

Looking at the config.log file the error seems to be at this point :

configure:3463: checking whether the C compiler works
configure:3485: /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/i686-apple-darwin10-gcc-4.2.1 -I/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/ -I/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/usr/include/ -I/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/System/Library/Frameworks/ -arch i686 -pipe -no-cpp-precomp -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk -I/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/ -I/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sd
k/usr/include/ -I/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/System/Library/Frameworks/  conftest.c  >&5
cc1: error: unrecognized command line option "-arch"
configure:3489: $? = 1
configure:3527: result: no

If anyone can shed some light on what I'm doing wrong, I'd be very grateful.
Thanks,
Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20101214/117ecd6d/attachment.html>


More information about the cairo mailing list