curl-library
Re: Building universal libcurl on Mac OS X 10.5
Date: Sun, 06 Mar 2011 14:41:48 -0500
On 3/5/11 11:20:29 PM, Daniel Johnson wrote:
> On Mar 5, 2011, at 10:17 PM, Cameron Kaiser wrote:
>> That's exactly what happens. I haven't tried this, but you could add compiler
>> flags such as
>>
>> -arch ppc -arch i386
>>
> This works as long as you're building just an only 32 bit or only 64 bit curl, but not a mixed 32/64 bit one. The problem is that curlbuild.h has macros whose value varies between 32 and 64 bit. If you want a true universal binary you need to do what the MacOSX-Framework script does; do a -arch ppc -arch i386 build and then a -arch ppc64 -arch x86_64 build and lipo the result together.
> Then it'll work. I recommend looking at the MacOSX-Framework script since it does everything you need. You can skip the framework specific stuff if you just want a regular library.
>
> Daniel
Thanks everybody for all the info!
I'm fine with 32-bit binary, but so far still run into errors in Xcode.
I managed to build curl using the following flags:
env CFLAGS="-O -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch i386 -arch
ppc" LDFLAGS="-arch i386 -arch ppc" ./configure
--disable-dependency-tracking --prefix /curl-test-1
(As a test, I also run it using -arch ppc only, which resulted in a
library almost twice as small in size, so I guess it confirms I
succeeded to build a fat one).
I tried to include it in my Xcode project, but first got errors that my
libcurl.dylib is of wrong architecture.
Then I read some info on static linking, and added "Other Linker Flags”
in Xcode’s target build configuration (the output from curl-config
--static-libs):
/curl-test-1/lib/libcurl.a -arch i386 -arch ppc -lldap -lz
After this, the "wrong architecture" errors have gone, but a new one
occurred at the end of building my project in Xcode:
/usr/bin/lipo:
/Users/me/Development/MyApp/build/MyApp.build/Deployment/MyApp.build/Objects-normal/i386/MyApp
and
/Users/me/Development/MyApp/build/MyApp.build/Deployment/MyApp.build/Objects-normal/ppc/MyApp
have the same architectures (i386) and can't be in the same fat output file
Any advice on what I'm doing wrong would be appreciated!
Thanks,
Leo
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-03-06