1 Simple install procedure
2 ========================
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
9 [ Become root if necessary ]
10 % rm -rf /install-prefix/include/glib.h /install-prefix/include/gmodule.h
11 % make install # install GLIB
16 GLib-2.0 requires pkg-config, which is tool for tracking the
17 compilation flags needed for libraries. (For each library, a small .pc
18 text file is installed in a standard location that contains the
19 compilation flags needed for that library along with version number
20 information.) Information about pkg-config can be found at:
22 http://www.freedesktop.org/software/pkgconfig/
24 GNU make (http://www.gnu.org/software/make) is also recommended.
26 In order to implement conversions between character sets,
27 GLib requires an implementation of the standard iconv() routine.
28 Most modern systems will have a suitable implementation, however
29 many older systems lack an iconv() implementation. On such systems,
30 you must install the libiconv library. This can be found at:
32 http://www.gnu.org/software/libiconv/
34 If your system has an iconv implementation but you want to use
35 libiconv instead, you can pass the --with-libiconv option to
36 configure. This forces libiconv to be used.
38 Note that if you have libiconv installed in your default include
39 search path (for instance, in /usr/local/), but don't enable
40 it, you will get an error while compiling GTK+ because the
41 iconv.h that libiconv installs hides the system iconv.
43 If you are using the native iconv implementation on Solaris
44 instead of libiconv, you'll need to make sure that you have
45 the converters between locale encodings and UTF-8 installed.
46 At a minimum you'll need the SUNWuiu8 package. You probably
47 should also install the SUNWciu8, SUNWhiu8, SUNWjiu8, and
50 Finally, for message catalog handling, GTK+ requires an implementation
51 of gettext(). If your system doesn't provide this functionality,
52 you should use the libintl library from the GNU gettext package,
55 http://www.gnu.org/software/gettext/
60 The 'configure' script can be given a number of options to enable
61 and disable various features. For a complete list, type:
65 A few of the more important ones:
67 * --prefix=PREFIX install architecture-independent files in PREFIX
68 [ Defaults to /usr/local ]
70 * --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
71 [ Defaults to the value given to --prefix ]
73 * --enable-gc-friendly When enabled all memory freed by the application,
74 but retained by GLib for performance reasons
75 is set to zero, thus making deployed garbage
76 collection or memory profiling tools detect
77 unlinked memory correctly. This will make GLib
79 [ Disabled by default ]
81 * --disable-threads Do not compile GLib to be multi thread safe. GLib
82 will be slightly faster then. This is however not
83 recommended, as many programs rely on GLib being
85 [ Enabled by default ]
87 * --with-threads=[none/posix/dce/solaris/win32] Specify a thread
88 implementation to use.
89 * 'posix' and 'dce' can be used interchangeable
90 to mean the different versions of posix
91 threads. configure tries to find out, which
93 * 'solaris' uses the native Solaris thread
95 * 'none' means that GLib will be thread safe,
96 but does not have a default thread
97 implementation. This has to be supplied to
98 g_thread_init() by the programmer.
99 [ Determined by configure by default ]
101 Options can be given to the compiler and linker by setting
102 environment variables before running configure. A few of the more
105 CC : The C compiler to use
106 CPPFLAGS : Flags for the C preprocesser such as -I and -D
107 CFLAGS : C compiler flags
109 The most important use of this is to set the
110 optimization/debugging flags. For instance, to compile with no
111 debugging information at all, run configure as:
113 CFLAGS=-O2 ./configure # Bourne compatible shells (sh/bash/zsh)
117 setenv CFLAGS -O2 ; ./configure # csh and variants
120 Installation directories
121 ========================
123 The location of the installed files is determined by the --prefix
124 and --exec-prefix options given to configure. There are also more
125 detailed flags to control individual directories. However, the
126 use of these flags is not tested.
128 One particular detail to note, is that the architecture-dependent
129 include file glibconfig.h is installed in:
131 $exec_prefix/lib/glib/include/
133 if you have a version in $prefix/include, this is out of date
134 and should be deleted.
136 .pc files for the various libraries are installed in
137 $exec_prefix/lib/pkgconfig to provide information when compiling
138 other packages that depend on GTK+. If you set PKG_CONFIG_PATH
139 so that it points to this directory, then you can get the
140 correct include flags and library flags for compiling a GLib
143 pkg-config --cflags glib-2.0
144 pkg-config --libs glib-2.0