<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    
  </head>
  <body text="#000000" bgcolor="#ffffff">
    <pre wrap="">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: <i class="moz-txt-slash"><span class="moz-txt-tag">/</span>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<span class="moz-txt-tag">/</span></i> -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 <i class="moz-txt-slash"><span class="moz-txt-tag">/</span>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<span class="moz-txt-tag">/</span></i> -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  &gt;&amp;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</pre>
  </body>
</html>