Forum Xamarin.iOS

Question for help regarding changes to cross compiling for iOS

JamesBentley.8175JamesBentley.8175 USMember
edited July 2016 in Xamarin.iOS

Hi everyone,

I used to use the following script to cross compile a number of C projects, including Flite. I was hoping to revisit some of my work, and update some projects to create a new cross-platform app, using a 'universal' C library.

This is the script I used to use (slightly modified to support whatever project I was working on):

https://gist.githubusercontent.com/rcarlsen/1029171/raw/46bf7c53804f28ba1349dcfe4eb430cec37fcfd0/build_fat.sh

The meat of it is this:

make distclean
unset CPPFLAGS CFLAGS LDFLAGS CPP CXX CC CXXFLAGS DEVROOT SDKROOT LD

export DEVROOT=/Developer/Platforms/iPhoneOS.platform/Developer
export SDKROOT=$DEVROOT/SDKs/iPhoneOS9.3.sdk
export CFLAGS="-arch armv6 -pipe -no-cpp-precomp -isysroot $SDKROOT -miphoneos-version-min=5.0 -I$SDKROOT/usr/include/"
export CPPFLAGS="$CFLAGS"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="-L$SDKROOT/usr/lib/"
export LD="$DEVROOT/usr/bin/ld"
export CPP="$DEVROOT/usr/bin/cpp-4.2.1"
export CXX="$DEVROOT/usr/bin/g++-4.2.1"
export CC="$DEVROOT/usr/bin/gcc-4.2.1"
./configure --host=arm-apple-darwin
make -j3

Now, since I worked on this stuff, the compiler used is no longer just GCC - it's clang, and I've not been able to find a good example that I can make work.

Can anyone help me out with an updated script/clang examples that they know work for cross compiling to iOS, so I don't keep bumping into dead ends?

Note: I don't care about a 'fat' library containing all rule-sets, at least not that much. I really just want to make sure I'm compiling the ARM libraries correctly for use. I'll look into the fat library after I get that part working.

Thanks for any help!

-Jim

Sign In or Register to comment.