Compiling the GLib package
3
GLib Library
Compiling the GLib Package
How to compile GLib itself
Building the Library on UNIX
On UNIX, GLib uses the standard GNU build system,
using autoconf for package
configuration and resolving portability issues,
automake for building makefiles
that comply with the GNU Coding Standards, and
libtool for building shared
libraries on multiple platforms. The normal sequence for
compiling and installing the GLib library is thus:
./configure
make
make install
The standard options provided by GNU
autoconf may be passed to the
configure script. Please see the
autoconf documentation or run
./configure --help for information about
the standard options.
The GTK+ documentation contains
further details
about the build process and ways to influence it.
Dependencies
Before you can compile the GLib library, you need to have
various other tools and libraries installed on your
system. The two tools needed during the build process (as
differentiated from the tools used in when creating GLib
mentioned above such as autoconf)
are pkg-config and GNU make.
pkg-config
is a tool for tracking the compilation flags needed for
libraries that are used by the GLib library. (For each
library, a small .pc text file is
installed in a standard location that contains the compilation
flags needed for that library along with version number
information.) The version of pkg-config
needed to build GLib is mirrored in the
dependencies directory
on the GTK+ FTP
site.
The GTK+ makefiles will mostly work with different versions
of make, however, there tends to be
a few incompatibilities, so the GTK+ team recommends
installing GNU
make if you don't already have it on your system
and using it. (It may be called gmake
rather than make.)
GLib depends on a number of other libraries.
The GNU
libiconv library is needed to build GLib if your
system doesn't have the iconv()
function for doing conversion between character
encodings. Most modern systems should have
iconv(), however many older systems lack
an iconv() implementation. On such systems,
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 libiconv instead, you can pass the
--with-libiconv option to configure. This forces
libiconv to be used.
Note that if you have libiconv installed in your default include
search path (for instance, in /usr/local/), but
don't enable it, you will get an error while compiling GLib because
the iconv.h that libiconv installs hides the
system iconv.
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.
At a minimum you'll need the SUNWuiu8 package. You probably
should also install the SUNWciu8, SUNWhiu8, SUNWjiu8, and
SUNWkiu8 packages.
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.
The libintl library from the GNU gettext
package is needed if your system doesn't have the
gettext() functionality for handling
message translation databases.
A thread implementation is needed, unless you want to compile GLib
without thread support, which is not recommended. The thread support
in GLib can be based upon several native thread implementations,
e.g. POSIX threads, DCE threads or Solaris threads.