4d4e023fe66106cc3075acb8788ad04646e065d1
[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 the pthreads
6 emulation 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 Support for building using the cygwin tools (without depending on the
22 cygwin runtime, i.e. "mingw32"), and maybe LCC-Win32 might be added
23 later. When using the cygwin tools *with* the cygwin runtime the
24 normal Unix configuration method should work as if on Unix (knock on
25 wood).
26
27 With a little work, it might be possible to use the ./configure
28 mechanism also with a "mingw32" configuration. I.e. building GLib for
29 Win32 would use the cygwin tools (and runtime), but the produced
30 libraries would not depend on the cygwin runtime being present.
31
32 The following preprocessor macros are used for conditional compilation 
33 related to Win32:
34
35 - WIN32 is defined when compiling for the Win32 platform, regardless
36   if using the X11 or Win32 windowing API (in the case of GLib, this
37   dimension isn't significant), regardless whether using a more or
38   less complete POSIX emulation runtime layer (like Cygwin) or not.
39
40 - NATIVE_WIN32 is defined when compiling for Win32, *and* without
41   any POSIX emulation, other that to the extent provided by the
42   (Microsoft) C library, or the pthreads-win32 library. For instance,
43   pathnames use the native Windows syntax.
44
45 - _MSC_VER is defined when using the Microsoft compiler.
46
47 Currently the Win32 port uses the combination with all three of those
48 on, but eventually "gcc -mno-cygwin" will be supported also, and in
49 that case _MSC_VER wouldn't be defined.
50
51 Some of the usage of these macros is probably a bit mixed up, and will
52 have to be straightened out when actually trying other combinations.
53
54 The pthreads for Win32 package that the thread support uses isn't
55 quite ready yet, and thus threads really should not be relied upon.