Building gmp library for the iPhone

Pierre-Henri Jondot mpkju at free.fr
Wed Jul 15 12:12:20 CEST 2009


Hi,

I am an iPhone developer, and I do have a project making use of  
several libraries (LGPL and GPL), and the gpm library is the first I  
am trying to build. (Of course the final project will then have to be  
GPL)

I browsed the archives to see if others went the same route previously  
and couldn't find any.

I've failed miserably so far to build the library. My os is OSX 10.5.7  
with iPhone SDK 3.0.

What I have tried so far :

./configure --disable-shared --enable-static --prefix=/Developer/ 
Platforms/iPhoneOS.platform/Developer/usr/local --build=i686-apple- 
darwin --host=armv6-apple-darwin CC="/Developer/Platforms/ 
iPhoneOS.platform/Developer/usr/bin/gcc-4.2"

but doing this seems not enough to cross-compile for arm architecture  
(it builds for x86 it seems), and the first asm file triggers an error.

Replacing --host=armv6-apple-darwin with --host=none-apple-darwin  
allowed me to build a library... but for x86 architecture...

Doing :

/configure --disable-shared --enable-static --prefix=/Developer/ 
Platforms/iPhoneOS.platform/Developer/usr/local --build=i686-apple- 
darwin --host=armv6-apple-darwin CC="/Developer/Platforms/ 
iPhoneOS.platform/Developer/usr/bin/gcc-4.2" CFLAGS="-arch armv6"

fails at the configure step : "could not find a working compiler", and  
the config.log shows :
configure:3900: /Developer/Platforms/iPhoneOS.platform/Developer/usr/ 
bin/gcc-4.2 -arch armv6  conftest.c >&5
ld: library not found for -lcrt1.o

Any idea of what I have been doing wrong ?

Regards,

Pierre-Henri Jondot


More information about the gmp-discuss mailing list