Cross-compiling GTK+ for Win32



Hello!

I'm new to this list and I joined encouraged by Alberto Ruiz. I want to
share my experiences and my expectations about cross-compiling GTK+ for
Win32 on non-Win32 platforms, especially Ubuntu Linux.

Whenever necessary, please read the marvelous HOWTO[1] by Alberto, which
was my starting point. I don't use Windows myself, but my post is aimed
at encouraging people in the GTK+/GNOME community to look into
non-FreeNIX areas in order to achieve 10x10[2].

First the story:
sudo apt-get install mingw32 mingw32-binutils mingw32-runtime
svn co http://svn.gnome.org/svn/jhbuild/trunk jhbuild
cd jhbuild
make install
wget http://leto.homedns.org/~doomhammer/gtk+-win32.jhbuildrc # Modified
verion of [3]
jhbuild -f gtk+-win32.jhbuildrc build

The above is ok for the avarage i386 Linux. However, in order to build
it correctly on AMD64 machines one need to issue:

linux32 jhbuild -f gtk+-win32.jhbuildrc build

This is probably a bug in autotools, for running pure jhbuild results in
$LIBDIR=lib64, which is rubbish for win32 target build.

.jhbuildrc I modifies was tested on two machines - mine (AMD64) and my
friend's (i386), both running Linux. The result is really good, allowing
further cross compilation of GTK+ programs. I cross-compiled gxmessage
and Glade with them. gxmessage was running OK at my other friend's
Windows system with Tor's GTK+ runtime installed. Also it looked
ridiculous when run on my workstation through WINE. I was unable to test
Glade in real (Windows) environment. I only know it builds and looks
even more ridiculous with WINE.

The problem I remember now encountering is that with WINE enabled in
binfmt-misc there are some problems during libjpeg build. I attach both
the wined [4] and wineless [5] config.log for you to check.

Having established a nice target environment I wanted to be able to
build some more packages with it. Therefore I hacked an ugly little
script[6] that runs a shell in newly created environment and a configure
replacement[7] for easier software maintenance.

This way instead of "./configure && make && make install" I run
"configure-mingw && make && make install". It worked for both gxmessage
and Glade IIRC. I made then forgetting about Alberto's mingw-configure
script[8], which is probably superior to them.

That's for the story - I think it shows how easy cross-configuring and
automating build process for Win32 is.

Now about expectations. I would like to make my efforts available to the
public. The Windows public, I mean. So I'd like some nice installers
created from my cross-compiled libraries.

Currently I can compile with them on my machine and send resulting .exe
to friends who have Tor's GTK+ runtime installed. I have no idea how to
distribute Glade-based programs, because I don't know where to find
up-to-date Glade runtime.

That's not good. If I can compile the libs - I'd like to redistribute
them as well and having no idea whatsoever about DLL issues I have my
hands tied. Ideally I would like jhbuild spit .msi's/.msm's as well, as
posted by Alberto on his blog[9]. But that's not necessary - if anyone
could point me to a software allowing me to turn my generated libs into
an installer I would be content.

Second thing: wouldn't it be nice to see all the official core (and not
only) libraries of GNOME released _in one place_ somewhere with comfy
installers? I mean, Tor releases GTK+ runtime. But what about Glade,
PyGTK, and whatever else? I know they could probably be found somewhere
in the wild, but one central repository is a good idea.

I probably had something more to say, more ideas, more problems, and
whatever more, but forgot them somehow. Anyway this post is pretty long
in itself and I expect some feedback about it. Especially if anyone
could help me improving work I've already done, basing (mainly) on the
work of Alberto.

Hereby I'd like to thank to everybody in the community for providing
ideas, code and help. May the source be with you!

Piotr Gaczkowski

[1] http://live.gnome.org/Cross_compiling_GTK+_for_Win32
[2] http://live.gnome.org/10x10
[3] http://live.gnome.org/Cross_compiling_GTK%
2B_for_Win32?action=AttachFile&do=get&target=gtk%2B-win32.jhbuildrc
[4] http://leto.homedns.org/~doomhammer/wine.config.log
[5] http://leto.homedns.org/~doomhammer/wineless.config.log
[6] http://leto.homedns.org/~doomhammer/mingw-env
[7] http://leto.homedns.org/~doomhammer/configure-mingw
[8] http://live.gnome.org/Cross_compiling_GTK%
2B_for_Win32?action=AttachFile&do=get&target=mingw-configure
[9] http://aruiz.typepad.com/siliconisland/2007/05/call_for_gtk_wi.html

Attachment: signature.asc
Description: To jest =?UTF-8?Q?cz=C4=99=C5=9B=C4=87?= listu podpisana cyfrowo



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