212163c1b8ba75b0aa9636a08ea1e96f9d682e8c
[platform/upstream/glib.git] / README.win32
1 For more information about the port or GLib, GTk+ and the GIMP to
2 native Windows, and pre-built binary packages, see
3 http://www.iki.fi/tml/gimp/win32/ . "Native" means that we use the
4 Win32 API only, and not any POSIX emulation layer except that provided
5 by the Microsoft runtime C library. Additionally, a pthreads emulation
6 library is used.
7
8 As for now, to build GLib on Win32, you need the Microsoft compiler
9 and tools. Both the compiler from MSVC 5.0 and from MSVC 6.0 have been
10 used successfully.
11
12 Before building you must get the pthreads library for Windows from
13 http://sourceware.cygnus.com/pthreads-win32/. The pthreads-win32
14 snapshot from 1999-03-16 is mostly OK. Edit the location of the
15 pthreads library and include files in makefile.msc. Also edit the BIN
16 definition in makefile.msc.
17
18 Build with `nmake -f makefile.msc`. Install with `nmake -f
19 makefile.msc install`.
20
21 To test the GLib functions, go to the tests subdirectory and enter
22 `nmake -f makefile.msc check`.
23
24 Support for building using the cygwin tools (without depending on the
25 cygwin runtime, i.e. "mingw32"), and maybe LCC-Win32 might be added
26 later. When using the cygwin tools *with* the cygwin runtime the
27 normal Unix configuration method should work as if on Unix (knock on
28 wood).
29
30 With a little work, it might be possible to use the ./configure
31 mechanism also with a "mingw32" configuration. I.e. building GLib for
32 Win32 would use the cygwin tools (and runtime), but the produced
33 libraries would not depend on the cygwin runtime being present.
34
35 The following preprocessor macros are used for conditional compilation 
36 related to Win32:
37
38 - WIN32 is defined when compiling for the Win32 platform, regardless
39   if using the X11 or Win32 windowing API (in the case of GLib, this
40   dimension isn't significant), regardless whether using a more or
41   less complete POSIX emulation runtime layer (like Cygwin) or not.
42
43 - NATIVE_WIN32 is defined when compiling for Win32, *and* without
44   any POSIX emulation, other that to the extent provided by the
45   (Microsoft) C library, or the pthreads-win32 library. For instance,
46   pathnames use the native Windows syntax.
47
48 - _MSC_VER is defined when using the Microsoft compiler.
49
50 Currently the Win32 port uses the combination with all three of those
51 on, but eventually "gcc -mno-cygwin" will be supported also, and in
52 that case _MSC_VER wouldn't be defined.
53
54 Some of the usage of these macros is probably a bit mixed up, and will
55 have to be straightened out when actually trying other combinations.
56
57 The pthreads for Win32 package that the thread support uses isn't
58 quite ready yet, and thus threads really should not be relied upon.