1
<refentry id="gtkglext-building" revision="11 Dec 2001">
3
<refentrytitle>Compiling the GtkGLExt libraries</refentrytitle>
4
<manvolnum>3</manvolnum>
5
<refmiscinfo>GtkGLExt Library</refmiscinfo>
9
<refname>Compiling the GtkGLExt Libraries</refname>
11
How to compile GtkGLExt
14
<refsect1 id="overview">
15
<title>Building GtkGLExt on UNIX-like systems</title>
17
This chapter covers building and installing GtkGLExt on UNIX and
18
UNIX-like systems such as Linux. Compiling GtkGLExt on Microsoft
19
Windows is different in detail and somewhat more difficult to
20
get going since the necessary tools aren't included with
24
On UNIX-like systems GtkGLExt uses the standard GNU build system,
25
using <application>autoconf</application> for package
26
configuration and resolving portability issues,
27
<application>automake</application> for building makefiles that
28
comply with the GNU Coding Standards, and
29
<application>libtool</application> for building shared libraries
30
on multiple platforms.
33
If you are building GtkGLExt from the distributed source packages,
34
then won't need these tools installed; the necessary pieces
35
of the tools are already included in the source packages. But
36
it's useful to know a bit about how packages that use these
37
tools work. A source package is distributed as
38
<literal>tar.gz</literal> or <literal>tar.bz2</literal> file
39
which you unpack into a directory full of the source files as follows:
42
tar zxvf gtkglext-x.y.z.tar.gz
44
tar jxvf gtkglext-x.y.z.tar.bz2
47
In the toplevel of the directory that is created, there will be
48
a shell script called <filename>configure</filename> which
49
you then run to take the template makefiles called
50
<filename>Makefile.in</filename> in the package and create
51
makefiles customized for your operating system. The <filename>configure</filename>
52
script can be passed various command line arguments to determine how
53
the package is built and installed. The most commonly useful
54
argument is the <systemitem>--prefix</systemitem> argument which
55
determines where the package is installed. To install a package
56
in <filename>/opt/gtk</filename> you would run configure as:
59
./configure --prefix=/opt/gtk
62
A full list of options can be found by running
63
<filename>configure</filename> with the
64
<systemitem>--help</systemitem> argument. In general, the defaults are
65
right and should be trusted. After you've run
66
<filename>configure</filename>, you then run the
67
<command>make</command> command to build the package and install
75
If you don't have permission to write to the directory you are
76
installing in, you may have to change to root temporarily before
77
running <literal>make install</literal>. Also, if you are
78
installing in a system directory, on some systems (such as
79
Linux), you will need to run <command>ldconfig</command> after
80
<literal>make install</literal> so that the newly installed
81
libraries will be found.
84
If you want to compile example programs shipped with the source
85
package, run the following command.
91
Several environment variables are useful to pass to set before
92
running configure. <envar>CPPFLAGS</envar> contains options to
93
pass to the C compiler, and is used to tell the compiler where
94
to look for include files. The <envar>LDFLAGS</envar> variable
95
is used in a similar fashion for the linker. Finally the
96
<envar>PKG_CONFIG_PATH</envar> environment variable contains
97
a search path that <command>pkg-config</command> (see below)
98
uses when looking for for file describing how to compile
99
programs using different libraries. If you were installing GTK+
100
and it's dependencies into <filename>/opt/gtk</filename>,
101
you might want to set these variables as:
104
CPPFLAGS="-I/opt/gtk/include"
105
LDFLAGS="-L/opt/gtk/lib"
106
PKG_CONFIG_PATH="/opt/gtk/lib/pkgconfig"
107
export CPPFLAGS LDFLAGS PKG_CONFIG_PATH
110
You may also need to set the <envar>LD_LIBRARY_PATH</envar>
111
environment variable so the systems dynamic linker can find
112
the newly installed libraries, and the <envar>PATH</envar>
113
environment program so that utility binaries installed by
114
the various libraries will be found.
117
LD_LIBRARY_PATH="/opt/gtk/lib"
118
PATH="/opt/gtk/bin:$PATH"
119
export LD_LIBRARY_PATH PATH
122
<refsect1 id="dependencies">
123
<title>Dependencies</title>
125
Before you can compile the GtkGLExt library, you need to have
126
various other tools and libraries installed on your
127
system. The two tools needed during the build process (as
128
differentiated from the tools used in when creating GTK+
129
mentioned above such as <application>autoconf</application>)
130
are <command>pkg-config</command> and GNU make.
136
url="http://www.freedesktop.org/software/pkgconfig/">pkg-config</ulink>
137
is a tool for tracking the compilation flags needed for
138
libraries that is used by the GTK+ libraries. (For each
139
library, a small <literal>.pc</literal> text file is
140
installed in a standard location that contains the
141
compilation flags needed for that library along with version
147
The GtkGLExt makefiles will mostly work with different versions
148
of <command>make</command>, however, there tends to be
149
a few incompatibilities, so we recommend installing
150
<ulink url="http://www.gnu.org/software/make">GNU make</ulink>
151
if you don't already have it on your system
152
and using it. (It may be called <command>gmake</command>
153
rather than <command>make</command>.)
158
<ulink url="http://www.gtk.org/">GTK+</ulink>
159
-- The GIMP Toolkit -- version 2.0 or above.
164
OpenGL or <ulink url="http://www.mesa3d.org/">Mesa</ulink>.
169
<refsect1 id="extra-configuration-options">
170
<title>Extra Configuration Options</title>
173
In addition to the normal options, the
174
<command>configure</command> script for the GtkGLExt
175
supports the following additional arguments.
178
<command>configure</command>
181
<arg>--with-gl-prefix=DIR</arg>
184
<arg>--with-gl-includedir=DIR</arg>
187
<arg>--with-gl-libdir=DIR</arg>
190
<arg>--enable-debug=[no|minimum|yes]</arg>
193
<arg>--disable-gtk-doc</arg>
194
<arg>--enable-gtk-doc</arg>
197
<arg>--with-html-dir=PATH</arg>
200
<arg>--with-gdktarget=[x11|win32]</arg>
206
<title><systemitem>--with-gl-prefix=DIR</systemitem></title>
209
Directory where OpenGL (Mesa) is installed.
210
The default is 'auto'.
215
<title><systemitem>--with-gl-includedir=DIR</systemitem></title>
218
Directory where OpenGL (Mesa) header files are installed.
219
The default is 'auto'.
224
<title><systemitem>--with-gl-libdir=DIR</systemitem></title>
227
Directory where OpenGL (Mesa) libraries are installed.
228
The default is 'auto'.
233
<title><systemitem>--enable-debug</systemitem></title>
236
Turns on various amounts of debugging support. Setting this to 'no'
237
disables g_assert(), g_return_if_fail(), g_return_val_if_fail() and
238
all cast checks between different object types. Setting it to 'minimum'
239
disables only cast checks. Setting it to 'yes' enables
240
<link linkend="GTK-GL-Debug-Options">runtime debugging</link>.
241
The default is 'minimum'.
242
Note that 'no' is fast, but dangerous as it tends to destabilize
243
even mostly bug-free software by changing the effect of many bugs
244
from simple warnings into fatal crashes. Thus
245
<option>--enable-debug=no</option> should <emphasis>not</emphasis>
246
be used for stable releases of GtkGLExt.
251
<title><systemitem>--disable-gtk-doc</systemitem> and
252
<systemitem>--enable-gtk-doc</systemitem></title>
255
The <application>gtk-doc</application> package is
256
used to generate the reference documentation included
257
with GtkGLExt. By default support for
258
<application>gtk-doc</application>
259
is disabled because it requires various extra dependencies
260
to be installed. If you have
261
<application>gtk-doc</application> installed and
262
are modifying GtkGLExt, you may want to enable
263
<application>gtk-doc</application> support by passing
264
in <systemitem>--enable-gtk-doc</systemitem>. If not
265
enabled, pre-generated HTML files distributed with GtkGLExt
271
<title><systemitem>--with-html-dir</systemitem></title>
274
Path to installed the reference documentation. The default is
275
<filename>${datadir}/gtk-doc/html</filename>.
280
<title><systemitem>--with-gdktarget</systemitem></title>
283
Toggles between the supported backends for GdkGLExt.
284
The default is x11, unless the platform is Windows, in which
285
case the default is win32.
293
<!-- Local Variables: -->
294
<!-- sgml-parent-document: ("gtk-docs.sgml" "chapter" "refentry") -->