Re: cross-compiling a GTK app, linux -> darwin



On Thu, 2007-03-29 at 22:42 -0400, Allin Cottrell wrote:
Does anyone have expertise/recommendations to share, on the 
subject of compiling a GTK app on x86 Linux for the 
powerpc-apple-darwin target?

I'm familiar with the linux -> win32 cross.  This is relatively 
easy since mingw makes the win32 API available in a single 
package, and Tor Lillqvist makes available the GTK dev material 
for win32, plus various dependencies, also nicely packaged.

I'm wondering if tarring up all the GTK+ stuff from a fink 
installation on OS X, and dumping it into a suitable directory on 
Linux, is going to get me anywhere (having built a suitable 
binutils and cross-gcc first, of course).

First, see http://ranger.befunk.com/fink/darwin-cross/ .  To build
useful exes, though, you have to populate the cross environment with
headers, libraries, and frameworks from the real OS X box.  It's a bit
tedious but doable.  Here are some tips:

- Place any .framework folders in the lib folder of the cross
environment.
- symlink any "Include" directories inside the frameworks to the include
folder, but without the .framwork extension. In otherwords, symlink
$CROSSROOT/lib/fooBar.framework/Headers to $CROSSROOT/include/fooBar
- You'll have to go through each dylib and use the otool and
install_name_tool command to find and fixup the linker paths to match
your cross environment's directory structure.  For example, many dylibs
want to link against /usr/lib/libSystem.B.dylib.  You'll have to use
install_name_tool to change that
to /path/to/cross/lib/libSystem.B.dylib.  This does not affect your exes
at all, unless you bundled a library with the exe, but then you'll want
to use install_name_tool anyway to adjust the paths to be relative to
the app bundle itself.  For more information on this in general, see the
following information that applies to more than just Qt:
http://doc.trolltech.com/4.2/deployment-mac.html


Right now I only have my OS X 10.3 PPC cross environment populated.  I
use it to, ahem, build Qt apps (app bundles and all) for OS X 10.3 or
later from my Linux box.  

I have some scripts I used to do the fixups, which I may be able to
e-mail to you.  I cannot offer the cross environment for download
anywhere because it contains actual apple libraries (the OS X runtime
libraries and frameworks) that cannot be distributed.  They'd have to
come from your own licensed copy of OS X.


I don't think it's currently possible to cross-compile GTK itself for
Quartz (you can for X11, though), but once GTK is built, it's just a
matter of transferring the headers, libraries, and frameworks to the
linux environment.

Michael



Allin Cottrell
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list





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