Re: Linux -> win32 cross-compile



On 2002.06.17 09:32 rhaarman ucdavis edu wrote:
> 
> Excuse me if this has been asked already, I haven't been able to find it 
> anywhere. I develop software with GTK as my GUI ToolKit of choice, and I 
> would love for my friends to see my work. However, they run various kinds 
> of Windows, and I can't afford to run a Windows box myself. My question, 
> then, is: Can anyone give me any help on cross-compiling GTK 2 apps from 
> Linux to Windows?

I'm not sure that I can give you specific advice as to your
problems, but I run a linux-x-mingw compile system here for
compiling Gtk2 programs which works very well. There are some
problems using pkg-config in this situation. I have a trivial 
patch for this that I'm plannng to submit but otherwise you can
work around the problem in the application's makefiles.

I attach copies of my build scripts and an application Makefile
in case they are helpful. The cross compiler lives in
/usr/local/cross-tools; My gtk_tree package (just a repackage
of Tor's stuff) lives in ~/vers/gtk_tree (the runtime
sub-directory is copied to the host machines); finally, a copy
of a standard linux compile of pkg-config v0.12 lives in /usr/devel.
You can see the hack to run the output via sed in the application
Makefile.

Some URLs of things I have used:

http://members.telering.at/jessich/mingw/mingwcross/cross_mingw.sh.gz
ftp://ftp.mirror.ac.uk/sites/sources.redhat.com/pub/binutils/releases/binutils-2.11.2.tar.bz2
ftp://ftp.mirror.ac.uk/sites/sources.redhat.com/pub/gcc/releases/gcc-2.95.3/gcc-2.95.3.tar.gz
http://belnet.dl.sourceforge.net/sourceforge/mingw/w32api-1.0.1-20010726-src.tar.gz
http://belnet.dl.sourceforge.net/sourceforge/mingw/mingw-runtime-1.0.1-20010726-src.tar.gz
http://www.gimp.org/~tml/gimp/win32/downloads.html

HTH

-- 
Ali Harlow                              Email: ali avrc city ac uk
Research programmer                     Tel:   (020) 7040 4348
Applied Vision Research Centre          Intl: +44 20 7040 4348
City University                         Fax:   (020) 7040 5515
London                                  Intl: +44 20 7040 5515

Attachment: build-mingw.sh
Description: Bourne shell script

Attachment: build-gtk_tree.sh
Description: Bourne shell script

GTK_TREE=$(HOME)/vers/gtk_tree
DCAMSDK=$(HOME)/vers/dcam
PKG_CONFIG=/usr/devel/bin/pkg-config

PATH:=/usr/local/cross-tools/bin;$(PATH)

CC=/usr/local/cross-tools/bin/mingw32-gcc
GTK_CFLAGS:=$(shell PKG_CONFIG_PATH=$(GTK_TREE)/lib/pkgconfig $(PKG_CONFIG) --cflags gtk+-win32-2.0 | sed 's:/target/:$(GTK_TREE)/:g')
GTK_LFLAGS:=$(shell PKG_CONFIG_PATH=$(GTK_TREE)/lib/pkgconfig $(PKG_CONFIG) --libs gtk+-win32-2.0 gthread-2.0 | sed 's:/target/:$(GTK_TREE)/:g')
CFLAGS=-fnative-struct -I $(DCAMSDK)/inc $(GTK_CFLAGS)
LFLAGS=$(GTK_LFLAGS)
DCAM_LIBS=$(DCAMSDK)/lib/dcamapi.lib

OBJS=test.o options.o camera.o

test.exe:   $(OBJS)
	$(CC) -Wl,-Map,test.map $(OBJS) $(DCAM_LIBS) $(LFLAGS) -o test.exe


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