1 <refentry id="glib-building" revision="16 Jan 2002">
3 <refentrytitle>Compiling the GLib package</refentrytitle>
4 <manvolnum>3</manvolnum>
5 <refmiscinfo>GLib Library</refmiscinfo>
9 <refname>Compiling the GLib Package</refname>
11 How to compile GLib itself
15 <refsect1 id="building">
16 <title>Building the Library on UNIX</title>
18 On UNIX, GLib uses the standard GNU build system,
19 using <application>autoconf</application> for package
20 configuration and resolving portability issues,
21 <application>automake</application> for building makefiles
22 that comply with the GNU Coding Standards, and
23 <application>libtool</application> for building shared
24 libraries on multiple platforms. The normal sequence for
25 compiling and installing the GLib library is thus:
28 <userinput>./configure</userinput>
29 <userinput>make</userinput>
30 <userinput>make install</userinput>
35 The standard options provided by <application>GNU
36 autoconf</application> may be passed to the
37 <command>configure</command> script. Please see the
38 <application>autoconf</application> documentation or run
39 <command>./configure --help</command> for information about
44 <refsect1 id="extra-configuration-options">
45 <title>Extra Configuration Options</title>
48 In addition to the normal options, the
49 <command>configure</command> script in the GTK+
50 library supports these additional arguments:
53 <command>configure</command>
55 <arg>--enable-debug=[no|minimum|yes]</arg>
58 <arg>--disable-gc-friendly</arg>
59 <arg>--enable-gc-friendly</arg>
62 <arg>--disable-mem-pools</arg>
63 <arg>--enable-mem-pools</arg>
66 <arg>--disable-threads</arg>
67 <arg>--enable-threads</arg>
70 <arg>--with-threads=[none|posix|dce|solaris|win32]</arg>
73 <arg>--disable-gtk-doc</arg>
74 <arg>--enable-gtk-doc</arg>
80 <title><systemitem>--enable-debug</systemitem></title>
83 Turns on various amounts of debugging support. Setting this to 'no'
84 disables g_assert(), g_return_if_fail(), g_return_val_if_fail() and
85 all cast checks between different object types. Setting it to 'minimum' disables only cast checks. Setting it to 'yes' enables
86 <link linkend="GLIB-Debug-Options">runtime debugging</link>.
87 The default is 'minimum'.
88 Note that 'no' is fast, but dangerous as it tends to destabilize
89 even mostly bug-free software by changing the effect of many bugs
90 from simple warnings into fatal crashes. Thus
91 <option>--enable-debug=no</option> should <emphasis>not</emphasis>
92 be used for stable releases of gtk+.
97 <title><systemitem>--disable-gc-friendly</systemitem> and
98 <systemitem>--enable-gc-friendly</systemitem></title>
101 When enabled all memory freed by the application,
102 but retained by GLib for performance reasons
103 is set to zero, thus making deployed garbage
104 collection or memory profiling tools detect
105 unlinked memory correctly. This will make GLib
106 slightly slower and is thus disabled by default.
111 <title><systemitem>--disable-mem-pools</systemitem> and
112 <systemitem>--enable-mem-pools</systemitem></title>
115 Many small chunks of memory are often allocated via collective pools
116 in GLib and are cached after release to speed up reallocations.
117 For sparse memory systems this behaviour is often inferior, so
118 memory pools can be disabled to avoid excessive caching and force
119 atomic maintenance of chunks through the <function>g_malloc()</function>
120 and <function>g_free()</function> functions. Code currently affected by
125 <structname>GList</structname>, <structname>GSList</structname>,
126 <structname>GNode</structname> allocations
131 <structname>GMemChunk</structname>s become basically non-effective
136 <structname>GSignal</structname> disables all caching (potentially
142 <structname>GType</structname> doesn't honour the
143 <structname>GTypeInfo</structname>
144 <structfield>n_preallocs</structfield> field anymore
149 the <structname>GBSearchArray</structname> flag
150 <literal>G_BSEARCH_ALIGN_POWER2</literal> becomes non-functional
158 <title><systemitem>--disable-threads</systemitem> and
159 <systemitem>--enable-threads</systemitem></title>
162 Do not compile GLib to be multi thread safe. GLib
163 will be slightly faster then. This is however not
164 recommended, as many programs rely on GLib being
170 <title><systemitem>--with-threads</systemitem></title>
173 Specify a thread implementation to use.
176 'posix' and 'dce' can be used interchangeable
177 to mean the different versions of posix
178 threads. configure tries to find out, which
183 'solaris' uses the native Solaris thread implementation.
187 'none' means that GLib will be thread safe,
188 but does not have a default thread
189 implementation. This has to be supplied to
190 g_thread_init() by the programmer.
198 <title><systemitem>--disable-gtk-doc</systemitem> and
199 <systemitem>--enable-gtk-doc</systemitem></title>
202 By default the <command>configure</command> script will try
203 to auto-detect whether the
204 <application>gtk-doc</application> package is installed. If
205 it is, then it will use it to extract and build the
206 documentation for the GLib library. These options
207 can be used to explicitly control whether
208 <application>gtk-doc</application> should be
209 used or not. If it is not used, the distributed,
210 pre-generated HTML files will be installed instead of
211 building them on your machine.