glib2.0/INSTALL.md

131 lines
4.4 KiB
Markdown
Raw Normal View History

2022-06-29 16:02:05 +08:00
Simple install procedure
========================
2023-02-14 16:00:02 +08:00
```sh
tar xf glib-*.tar.gz # unpack the sources
cd glib-* # change to the toplevel directory
2024-02-29 14:32:35 +08:00
meson setup _build # configure the build
meson compile -C _build # build GLib
2022-06-29 16:02:05 +08:00
2023-02-14 16:00:02 +08:00
# Become root if necessary
2024-02-29 14:32:35 +08:00
meson install -C _build # install GLib
2023-02-14 16:00:02 +08:00
```
2022-06-29 16:02:05 +08:00
Requirements
============
GLib requires a C90-compliant (but not necessarily C99-compliant) C
compiler and libc. On UNIX-like systems, it also assumes compliance
with at least the original 1990 version of POSIX.
GLib-2.0 requires pkg-config, which is tool for tracking the
2023-02-14 16:00:02 +08:00
compilation flags needed for libraries. (For each library, a small `.pc`
2022-06-29 16:02:05 +08:00
text file is installed in a standard location that contains the
compilation flags needed for that library along with version number
information.) Information about pkg-config can be found at:
http://www.freedesktop.org/software/pkgconfig/
2023-02-14 16:00:02 +08:00
Meson (http://mesonbuild.com/) is also required. If your distribution does not
package a new enough version of Meson, it can be [installed using
`pip`](https://mesonbuild.com/Getting-meson.html#installing-meson-with-pip).
2022-06-29 16:02:05 +08:00
In order to implement conversions between character sets,
2023-02-14 16:00:02 +08:00
GLib requires an implementation of the standard `iconv()` routine.
2022-06-29 16:02:05 +08:00
Most modern systems will have a suitable implementation, however
2023-02-14 16:00:02 +08:00
many older systems lack an `iconv()` implementation. On such systems,
2022-06-29 16:02:05 +08:00
you must install the libiconv library. This can be found at:
http://www.gnu.org/software/libiconv/
If your system has an iconv implementation but you want to use
2023-02-14 16:00:02 +08:00
libiconv instead, you can pass the `--with-libiconv` option to
2022-06-29 16:02:05 +08:00
configure. This forces libiconv to be used.
Note that if you have libiconv installed in your default include
2023-02-14 16:00:02 +08:00
search path (for instance, in `/usr/local/`), but don't enable
2022-06-29 16:02:05 +08:00
it, you will get an error while compiling GLib because the
2023-02-14 16:00:02 +08:00
`iconv.h` that libiconv installs hides the system iconv.
2022-06-29 16:02:05 +08:00
If you are using the native iconv implementation on Solaris
instead of libiconv, you'll need to make sure that you have
the converters between locale encodings and UTF-8 installed.
2023-02-14 16:00:02 +08:00
At a minimum you'll need the `SUNWuiu8` package. You probably
should also install the `SUNWciu8`, `SUNWhiu8`, `SUNWjiu8`, and
`SUNWkiu8` packages.
2022-06-29 16:02:05 +08:00
The native iconv on Compaq Tru64 doesn't contain support for
UTF-8, so you'll need to use GNU libiconv instead. (When
using GNU libiconv for GLib, you'll need to use GNU libiconv
for GNU gettext as well.) This probably applies to related
operating systems as well.
Finally, for message catalog handling, GLib requires an implementation
2023-02-14 16:00:02 +08:00
of `gettext()`. If your system doesn't provide this functionality,
2022-06-29 16:02:05 +08:00
you should use the libintl library from the GNU gettext package,
available from:
http://www.gnu.org/software/gettext/
Support for extended attributes and SELinux in GIO requires
libattr and libselinux.
Some of the mimetype-related functionality in GIO requires the
2023-02-14 16:00:02 +08:00
`update-mime-database` and `update-desktop-database` utilities, which
2022-06-29 16:02:05 +08:00
are part of shared-mime-info and desktop-file-utils, respectively.
GObject uses libffi to implement generic marshalling functionality.
The Nitty-Gritty
================
Complete information about installing GLib can be found
in the file:
docs/reference/glib/html/glib-building.html
Or online at:
2024-02-29 14:32:35 +08:00
https://docs.gtk.org/glib/building.html
2022-06-29 16:02:05 +08:00
Installation directories
========================
2023-02-14 16:00:02 +08:00
The location of the installed files is determined by the `--prefix`
and `--exec-prefix` options given to configure. There are also more
2022-06-29 16:02:05 +08:00
detailed flags to control individual directories. However, the
use of these flags is not tested.
One particular detail to note, is that the architecture-dependent
2023-02-14 16:00:02 +08:00
include file `glibconfig.h` is installed in `$libdir/glib-2.0/include/`.
2022-06-29 16:02:05 +08:00
2023-02-14 16:00:02 +08:00
`.pc` files for the various libraries are installed in
`$libdir/pkgconfig` to provide information when compiling
other packages that depend on GLib. If you set `PKG_CONFIG_PATH`
2022-06-29 16:02:05 +08:00
so that it points to this directory, then you can get the
correct include flags and library flags for compiling a GLib
application with:
2023-02-14 16:00:02 +08:00
```sh
pkg-config --cflags glib-2.0
pkg-config --libs glib-2.0
```
This is the only supported way of determining the include and library flags
for building against GLib.
2022-06-29 16:02:05 +08:00
Cross-compiling GLib
====================
Information about cross-compilation of GLib can be found
in the file:
docs/reference/glib/html/glib-cross-compiling.html
Or online at:
2024-02-29 14:32:35 +08:00
https://docs.gtk.org/glib/cross-compiling.html