README.win32 4.05 KB
Newer Older
Tor Lillqvist's avatar
Tor Lillqvist committed
1
The Win32 port of GTK+ is a work in progress, and not as stable or
Tor Lillqvist's avatar
Tor Lillqvist committed
2
correct as the Unix/X11 version. For more information about the Win32
Tor Lillqvist's avatar
Tor Lillqvist committed
3 4
port, and prebuilt runtime and developer packages see
http://www.gimp.org/win32/ .
Tor Lillqvist's avatar
Tor Lillqvist committed
5

Tor Lillqvist's avatar
Tor Lillqvist committed
6 7 8 9
There is a gtk-1-3-win32-production branch of GTK+ that was branched
off from before the addition of the no-flicker and other recent
functionality. That is what should be used by "production" code until
this CVS HEAD (2.0) version is useable. (But note, the Win32 backend
10 11
has never been claimed to be "production quality", although it works
surprisingly well for the GIMP.)
Tor Lillqvist's avatar
Tor Lillqvist committed
12

13 14 15
Building GTK+ on Win32
======================

Tor Lillqvist's avatar
Tor Lillqvist committed
16
There are two ways to build GTK+ for win32:
17

Tor Lillqvist's avatar
Tor Lillqvist committed
18 19 20
1) Use the autoconf-generated configure script, and the resulting
Makefiles (which use libtool and gcc to do the compilation). I use
this myself, but it might be hell to setup correctly. 
Tor Lillqvist's avatar
Tor Lillqvist committed
21

22 23 24
Personally I run configure with:
CC='gcc -mpentium -fnative-struct' CPPFLAGS='-I/target/include' CFLAGS=-O2 LDFLAGS='-L/target/lib' ./configure --disable-static --prefix=/target --with-gdktarget=win32 --with-wintab=/src/wtkit126 --with-ie55=/src/workshop/ie55_lib --host=i386-pc-mingw32 --enable-maintainer-mode

Tor Lillqvist's avatar
Tor Lillqvist committed
25 26 27 28
It might well be that in order for this to work, you will have to get
a bleeding-edge version of libtool for Win32, run libtoolize yourself,
and then run autoconf to generate the configure script.

Tor Lillqvist's avatar
Tor Lillqvist committed
29 30 31 32
2) Use the Microsoft compiler, cl and Make, nmake. Say nmake -f
makefile.msc in gdk and gtk.

Alternative 1 also generates Microsoft import libraries (.lib), if you
Tor Lillqvist's avatar
Tor Lillqvist committed
33
have lib.exe available. It might also work for cross-compilation from
Tor Lillqvist's avatar
Tor Lillqvist committed
34 35
Unix.

Tor Lillqvist's avatar
Tor Lillqvist committed
36 37
Note that I use method 1 myself. Hans Breuer has been taking care of
the MSVC makefiles. At times, we disagree a bit about various issues,
38 39 40
and for instance the makefile.msc files will not produce identically
named DLLs and import libraries as the "autoconfiscated" makefiles and
libtool do. If this bothers you, you will have to fix the makefiles.
Tor Lillqvist's avatar
Tor Lillqvist committed
41

42 43 44
Using GTK+ on Win32
===================

Tor Lillqvist's avatar
Tor Lillqvist committed
45
To use GTK+ on Win32, you also need either one of the above mentioned
Tor Lillqvist's avatar
Tor Lillqvist committed
46 47
compilers. Other compilers might work, but don't count on it. Look for
prebuilt developer packages (DLLs, import libraries, headers) on the
Tor Lillqvist's avatar
Tor Lillqvist committed
48
above website.
Tor Lillqvist's avatar
Tor Lillqvist committed
49

50 51 52 53 54 55 56 57 58 59 60
Multi-threaded use of GTK+ on Win32
===================================

Multi-threaded GTK+ programs might work in special simple cases, but
not in general. Sorry. If you have all GTK+ and GDK calls in the same
thread, it might work. Otherwise, probably not at all. Possible ways
to fix this are being investigated.

Wintab
======

Tor Lillqvist's avatar
Tor Lillqvist committed
61
The tablet support uses the Wintab API. The Wintab development kit can
Tor Lillqvist's avatar
Tor Lillqvist committed
62 63 64 65
be downloaded from http://www.pointing.com. Pass the --with-wintab
flag to configure if you use that. If you use nmake and you don't care
for Wintab, undefine HAVE_WINTAB in config.h.win32 and remove
references to the wntab32x library from the makefile before building.
66

67 68 69
Libintl
=======

70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
Before building GTK+ you must also have GNU gettext. Get prebuilt
binaries of gettext-runtime (0.12.1 or newer) from your nearest GNU
ftp mirror. If you use gcc, you will also have to edit the libintl.h
file from gettext a tiny bit: Change the

# if __GNUC__ >= 2 && !defined __APPLE_CC__ && (defined __STDC__ || defined __cplusplus)

line to

# if __GNUC__ >= 2 && !defined __APPLE_CC__ && !defined __MINGW32__ && (defined __STDC__ || defined __cplusplus)

around line 102.

If you use libtool, you will also have to copy intl.lib to libintl.a
so that libtool will find them. Alternatively, use pexports and
dlltool to generate a gcc import library.
Tor Lillqvist's avatar
Tor Lillqvist committed
86

87 88 89 90 91 92 93
ActiveIMM
=========

If you want to build a GTK+ that supports ActiveIMM (the Input Method
Manager for non-EastAsia locales that can be used on Win9x/NT4), you
need the dimm.h header file. That is somewhat difficult to find, but
http://msdn.microsoft.com/downloads/samples/internet/wizard/ seems to
Tor Lillqvist's avatar
Tor Lillqvist committed
94
be a good place to look nowadays. If you use "autoconfiscated" build,
95 96 97 98
pass the --with-ie55 flag to configure specifyin the location of the
ie55_lib directory created by downloading the IE5.5 headers and libs
from the above URL.

Tor Lillqvist's avatar
Tor Lillqvist committed
99
--Tor Lillqvist <tml@iki.fi>