Re: [Tuxpaint-devel] Tux Paint 0.9.16 build for Mac OS X?
An award-winning drawing program for children of all ages
Brought to you by:
wkendrick
|
From: Martin F. <mf...@gm...> - 2006-10-15 23:25:35
|
On 15-Oct-06, at 4:33 PM, Albert Cahalan wrote: >>> Would you be able to build a binary that runs native on Intel, too? >> >> Yes, I will look into making a Universal binary (PPC/Intel). The SDL >> libraries are already universal, so the frameworks just need to be >> included in the TuxPaint application bundle. I'll have to compile >> libiconv, libintl, and libpng as universal libraries, and link those >> in - provided this goes alright, we should be in business. We have >> to keep in mind that universal binary apps need to be compiled with >> gcc 4, and gcc 4 compiled apps typically require Mac OS X 10.3.9 or >> later to run (so a universal binary that also runs on 10.2.8 is most >> likely not possible). > > I think you can do this: > > 1. compile the ppc version with the old tools > 2. compile the x86 version with the new tools > 3. use the new tools (lipo?) to join them into a universal binary > > If you do end up with two separate installs, there isn't much > point in doing a universal binary. I have universal binaries working (I'll get them posted tonight for public testing). In short, to compile universal binaries of libraries with configure scripts, I did the following: > setenv CFLAGS '-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386'' > setenv CXXFLAGS '-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386' > setenv LDFLAGS '-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk - arch ppc -arch i386' > ./configure > make Both ppc and x86 object files and libraries are generated and "lipoed" together into universal libraries. To check the architecture of a library file, I run: > lipo -info libiconv.a Architectures in the fat file: libiconv.a are: i386 ppc For libraries without configure scripts (eg. libpng), I first ran make to build the ppc library, and copied it into a "ppc" directory. I then manually edited the makefiles to include the "-arch i386" compiler flag, ran make to build the x86 library, and copied it into an "i386" directory. Finally, I ran lipo as follows: > lipo -create i386/libpng.a ppc/libpng.a -output libpng.a In the TuxPaint XCode project, I turned on the Intel and PPC options and selected the Mac OS X 10.4u SDK (see the Read Me in the XCode project), and compiled the app. Martin |