58067f7c5642c02fb8e5121a647a3093783d1e57
[platform/upstream/glib.git] / INSTALL.in
1 Simple install procedure
2 ========================
3
4   % gzip -cd glib-@GLIB_VERSION@.tar.gz | tar xvf -  # unpack the sources
5   % cd glib-@GLIB_VERSION@                           # change to the toplevel directory
6   % ./configure                             # run the `configure' script
7   % make                                    # build GLIB
8
9   [ Become root if necessary ]
10   % rm -rf /install-prefix/include/glib.h /install-prefix/include/gmodule.h
11   % make install                            # install GLIB
12
13 Requirements
14 ============
15
16 In order to implement conversions between character sets,
17 GLib requires an implementation of the standard iconv() routine.
18 Most modern systems will have a suitable implementation, however
19 many older systems lack an iconv() implementation. On such systems, 
20 you must install the libiconv library. This can be found at:
21
22  http://clisp.cons.org/~haible/packages-libiconv.html
23
24 If your system has an iconv implementation but you want to use
25 libiconv instead, you can pass the --with-libiconv option to
26 configure. This forces libiconv to be used. 
27
28 Note that if you have libiconv installed in your default include
29 search path (for instance, in /usr/local/), but don't enable
30 it, you will get an error while compiling GTK+ because the
31 iconv.h that libiconv installs hides the system iconv.
32
33 The Nitty-Gritty
34 ================
35
36 The 'configure' script can be given a number of options to enable
37 and disable various features. For a complete list, type:
38
39   ./configure --help
40
41 A few of the more important ones:
42
43 *  --prefix=PREFIX         install architecture-independent files in PREFIX
44                            [ Defaults to /usr/local ]
45
46 *  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
47                            [ Defaults to the value given to --prefix ]
48
49 *  --enable-gc-friendly    When enabled all memory freed by the application,
50                            but retained by GLib for performance reasons  
51                            is set to zero, thus making deployed garbage
52                            collection or memory profiling tools detect 
53                            unlinked memory correctly. This will make GLib 
54                            slightly slower.
55                            [ Disabled by default ]
56
57 * --disable-threads        Do not compile GLib to be multi thread safe. GLib
58                            will be slightly faster then. This is however not
59                            recommended, as many programs rely on GLib being 
60                            multi thread safe.
61                            [ Enabled by default ]
62
63 * --with-threads=[none/posix/dce/solaris/win32] Specify a thread 
64                            implementation to use. 
65                            * 'posix' and 'dce' can be used interchangeable 
66                              to mean the different versions of posix 
67                              threads. configure tries to find out, which 
68                              one is installed. 
69                            * 'solaris' uses the native Solaris thread
70                              implementation. 
71                            * 'none' means that GLib will be thread safe, 
72                              but does not have a default thread 
73                              implementation. This has to be supplied to 
74                              g_thread_init() by the programmer. 
75                            [ Determined by configure by default ]
76
77 Options can be given to the compiler and linker by setting
78 environment variables before running configure. A few of the more
79 important ones:
80
81  CC       : The C compiler to use
82  CPPFLAGS : Flags for the C preprocesser such as -I and -D
83  CFLAGS   : C compiler flags
84
85 The most important use of this is to set the
86 optimization/debugging flags. For instance, to compile with no
87 debugging information at all, run configure as:
88
89  CFLAGS=-O2 ./configure           # Bourne compatible shells (sh/bash/zsh)
90
91 or,
92
93  setenv CFLAGS -O2 ; ./configure  # csh and variants
94
95
96 Installation directories
97 ========================
98
99 The location of the installed files is determined by the --prefix
100 and --exec-prefix options given to configure. There are also more
101 detailed flags to control individual directories. However, the
102 use of these flags is not tested.
103
104 One particular detail to note, is that the architecture-dependent
105 include file glibconfig.h is installed in:
106
107   $exec_pref/lib/glib/include/
108
109 if you have a version in $prefix/include, this is out of date
110 and should be deleted.
111
112 A shell script glib-config is created during the configure
113 process, and installed in the bin/ directory
114 ($exec_prefix/bin). This is used to determine the location of glib
115 when building applications.  If you move glib after installation,
116 it will be necessary to edit this file.
117