]> Pileus Git - ~andy/gtk/blob - README.win32
Update.
[~andy/gtk] / README.win32
1 The Win32 port of GTK+ is a work in progress, and not as stable or
2 correct as the Unix/X11 version. For more information about the Win32
3 port, and prebuilt runtime and developer packages see
4 http://www.gimp.org/win32/ .
5
6 There is a gtk-1-3-win32-production branch of GTK+ that was branched
7 off from before the addition of the no-flicker and other recent
8 functionality. That is what should be used by "production" code until
9 this CVS HEAD (2.0) version is useable. (But note, the Win32 backend
10 has never been claimed to be "production quality", although it works
11 surprisingly well for the GIMP.)
12
13 Building GTK+ on Win32
14 ======================
15
16 There are two ways to build GTK+ for win32.
17
18 1) Use the autoconf-generated configure script, and the resulting
19 Makefiles (which use libtool and gcc to do the compilation). I use
20 this myself, but it might be hell to setup correctly. 
21
22 Personally I run configure with:
23 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
24
25 Then, in theory, you can just say "make", like on Unix. In reality,
26 there are a few hickups that require manual intervention, and it's
27 best to run make separately in each subdirectory. At least for me,
28 when libtool creates an .exe file, it puts the real .exe in the .libs
29 directory, and leaves a wrapper .exe in the work directory. For some
30 reason that wrapper doesn't work for me, it doesn't do anything. So, I
31 always do a "cp .libs/*.exe ." after running a make that has produced
32 some exes.
33
34 Another issue is with the gdk-pixbuf.loaders file. It's probably best
35 to do a "make install" in the gdk-pixbuf directory, and let that set
36 up a mostly correct gdk-pixbuf.loaders in the target directory. Then
37 copy that back to the source directory. It's needed in gtk/stock-icons
38 where make runs gdk-pixbuf-csource.
39
40 Etc, you get the idea. It can be a bit of a pain.
41
42 2) Use the Microsoft compiler, cl and Make, nmake. Say nmake -f
43 makefile.msc in gdk and gtk. Be prepared to manually edit various
44 makefile.msc files, and the makefile snippets in build/win32.
45
46 Alternative 1 also generates Microsoft import libraries (.lib), if you
47 have lib.exe available. It might also work for cross-compilation from
48 Unix.
49
50 Note that I use method 1 myself. Hans Breuer has been taking care of
51 the MSVC makefiles. At times, we disagree a bit about various issues,
52 and for instance the makefile.msc files will not produce identically
53 named DLLs and import libraries as the "autoconfiscated" makefiles and
54 libtool do. If this bothers you, you will have to fix the makefiles.
55
56 Using GTK+ on Win32
57 ===================
58
59 To use GTK+ on Win32, you also need either one of the above mentioned
60 compilers. Other compilers might work, but don't count on it. Look for
61 prebuilt developer packages (DLLs, import libraries, headers) on the
62 above website.
63
64 Multi-threaded use of GTK+ on Win32
65 ===================================
66
67 Multi-threaded GTK+ programs might work in special simple cases, but
68 not in general. Sorry. If you have all GTK+ and GDK calls in the same
69 thread, it might work. Otherwise, probably not at all. Possible ways
70 to fix this are being investigated.
71
72 Wintab
73 ======
74
75 The tablet support uses the Wintab API. The Wintab development kit can
76 be downloaded from http://www.pointing.com. Pass the --with-wintab
77 flag to configure if you use that. If you use nmake and you don't care
78 for Wintab, undefine HAVE_WINTAB in config.h.win32 and remove
79 references to the wntab32x library from the makefile before building.
80
81 Libintl
82 =======
83
84 Before building GTK+ you must also have GNU gettext. Get prebuilt
85 binaries of gettext-runtime (0.12.1 or newer) from your nearest GNU
86 ftp mirror. If you use gcc, you will also have to edit the libintl.h
87 file from gettext a tiny bit: Change the
88
89 # if __GNUC__ >= 2 && !defined __APPLE_CC__ && (defined __STDC__ || defined __cplusplus)
90
91 line to
92
93 # if __GNUC__ >= 2 && !defined __APPLE_CC__ && !defined __MINGW32__ && (defined __STDC__ || defined __cplusplus)
94
95 around line 102.
96
97 If you use libtool, you will also have to copy intl.lib to libintl.a
98 so that libtool will find them. Alternatively, use pexports and
99 dlltool to generate a gcc import library.
100
101 ActiveIMM
102 =========
103
104 If you want to build a GTK+ that supports ActiveIMM (the Input Method
105 Manager for non-EastAsia locales that can be used on Win9x/NT4), you
106 need the dimm.h header file. That is somewhat difficult to find, but
107 http://msdn.microsoft.com/downloads/samples/internet/wizard/ seems to
108 be a good place to look nowadays. If you use "autoconfiscated" build,
109 pass the --with-ie55 flag to configure specifyin the location of the
110 ie55_lib directory created by downloading the IE5.5 headers and libs
111 from the above URL.
112
113 --Tor Lillqvist <tml@iki.fi>