Re: [gtk-osx-users] Universal ppc/i386 build



On Jan 22, 2013, at 9:53 AM, Steffen Gutmann <muibase yahoo com> wrote:

>>  
> 
>> The first problem I ran into is libffi.  I see that 10.5 has its own version of 
>> libffi.  Has anyone already tried using that one instead of building the one 
>> that comes with meta-osx-gtk-core?
> 
> 
> I answer the question myself.  meta-gtk-osx-core needs libffi version 3.0 or better.  otool -L /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libffi.dylib reports version 1.0.0 (it might be a later version but probably not 3.0).
> 
> Anyways, I have been successful in compiling gtk-osx for a universal ppc/x86 Leopard build.  I have only tested it for my app by running the same universal binary on a Leopard ppc and a Lion x86_64 Mac.
> 
> In .jhbuildrc-custom I set:
> 
> setup_universal_build(target="10.5", sdk_version="10.5", 
>                         architectures=["ppc", "i386"])
> 
> The only two modules that needed a change are libffi and glib.  Attached are the two diffs.  The way to apply them is to unpack each tarball manually and then use the 'patch' program to make the changes.  The patch needs to be applied before running configure.
> 
> While the changes I made (and therefore the resulting diff) are quite specific to a universal build for ppc/x86 on MacOSX I post them here in the hope that they will be useful for others.  In general, the modules try to determine architecture (libffi) or endianness (glib) in the configure script and then choose the one-for-all instantiation.  My modifications make them use the __POWERPC__ and __i386__ preprocessor symbols for choosing one or the other.  It would be great if some of these changes would go back to the maintainers of the two modules with the hope that they support universal builds directly for MacOSX.
> 
> Note that my app does not use the full feature set of Gtk, so there might be things missing or not working properly.
> 


For glib, write a bug in bugzilla.gnome.org and attach your patch, after fixing it up to conform to Gnome's patch standard [1]. For libffi, the author uses Github [2], so he probably wants you to fork and make a pull request.

However, what bothers me about this is that both packages compile just fine when building a one-off on the processor in question, so the issue should be cross-compilation (usually done by querying the "build" configure parameter). I don't see that in your changes, so what am I missing?

Regards,
John Ralls


[1] https://live.gnome.org/GnomeLove/SubmittingPatches
[2] http://github.com/atgreen/libffi


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]