Merge "Fix crashes in various GParamSpec creation functions" into tizen
[platform/upstream/glib.git] / INSTALL.md
1 Simple install procedure
2 ========================
3
4 ```sh
5 tar xf glib-*.tar.gz                    # unpack the sources
6 cd glib-*                               # change to the toplevel directory
7 meson setup _build                      # configure the build
8 meson compile -C _build                 # build GLib
9
10 # Become root if necessary
11
12 meson install -C _build                 # install GLib
13 ```
14
15 Requirements
16 ============
17
18 GLib requires a C90-compliant (but not necessarily C99-compliant) C
19 compiler and libc. On UNIX-like systems, it also assumes compliance
20 with at least the original 1990 version of POSIX.
21
22 GLib-2.0 requires pkg-config, which is tool for tracking the
23 compilation flags needed for libraries. (For each library, a small `.pc`
24 text file is installed in a standard location that contains the
25 compilation flags needed for that library along with version number
26 information.) Information about pkg-config can be found at:
27
28   http://www.freedesktop.org/software/pkgconfig/
29
30 Meson (http://mesonbuild.com/) is also required. If your distribution does not
31 package a new enough version of Meson, it can be [installed using
32 `pip`](https://mesonbuild.com/Getting-meson.html#installing-meson-with-pip).
33
34 In order to implement conversions between character sets,
35 GLib requires an implementation of the standard `iconv()` routine.
36 Most modern systems will have a suitable implementation, however
37 many older systems lack an `iconv()` implementation. On such systems,
38 you must install the libiconv library. This can be found at:
39
40  http://www.gnu.org/software/libiconv/
41
42 If your system has an iconv implementation but you want to use
43 libiconv instead, you can pass the `--with-libiconv` option to
44 configure. This forces libiconv to be used.
45
46 Note that if you have libiconv installed in your default include
47 search path (for instance, in `/usr/local/`), but don't enable
48 it, you will get an error while compiling GLib because the
49 `iconv.h` that libiconv installs hides the system iconv.
50
51 If you are using the native iconv implementation on Solaris
52 instead of libiconv, you'll need to make sure that you have
53 the converters between locale encodings and UTF-8 installed.
54 At a minimum you'll need the `SUNWuiu8` package. You probably
55 should also install the `SUNWciu8`, `SUNWhiu8`, `SUNWjiu8`, and
56 `SUNWkiu8` packages.
57
58 The native iconv on Compaq Tru64 doesn't contain support for
59 UTF-8, so you'll need to use GNU libiconv instead. (When
60 using GNU libiconv for GLib, you'll need to use GNU libiconv
61 for GNU gettext as well.) This probably applies to related
62 operating systems as well.
63
64 Finally, for message catalog handling, GLib requires an implementation
65 of `gettext()`. If your system doesn't provide this functionality,
66 you should use the libintl library from the GNU gettext package,
67 available from:
68
69  http://www.gnu.org/software/gettext/
70
71 Support for extended attributes and SELinux in GIO requires
72 libattr and libselinux.
73
74 Some of the mimetype-related functionality in GIO requires the
75 `update-mime-database` and `update-desktop-database` utilities, which
76 are part of shared-mime-info and desktop-file-utils, respectively.
77
78 GObject uses libffi to implement generic marshalling functionality.
79
80 The Nitty-Gritty
81 ================
82
83 Complete information about installing GLib can be found
84 in the file:
85
86  docs/reference/glib/html/glib-building.html
87
88 Or online at:
89
90  https://docs.gtk.org/glib/building.html
91
92
93 Installation directories
94 ========================
95
96 The location of the installed files is determined by the `--prefix`
97 and `--exec-prefix` options given to configure. There are also more
98 detailed flags to control individual directories. However, the
99 use of these flags is not tested.
100
101 One particular detail to note, is that the architecture-dependent
102 include file `glibconfig.h` is installed in `$libdir/glib-2.0/include/`.
103
104 `.pc` files for the various libraries are installed in
105 `$libdir/pkgconfig` to provide information when compiling
106 other packages that depend on GLib. If you set `PKG_CONFIG_PATH`
107 so that it points to this directory, then you can get the
108 correct include flags and library flags for compiling a GLib
109 application with:
110
111 ```sh
112 pkg-config --cflags glib-2.0
113 pkg-config --libs glib-2.0
114 ```
115
116 This is the only supported way of determining the include and library flags
117 for building against GLib.
118
119
120 Cross-compiling GLib
121 ====================
122
123 Information about cross-compilation of GLib can be found
124 in the file:
125
126  docs/reference/glib/html/glib-cross-compiling.html
127
128 Or online at:
129
130  https://docs.gtk.org/glib/cross-compiling.html