~ubuntu-branches/ubuntu/gutsy/gtkglext/gutsy

« back to all changes in this revision

Viewing changes to docs/reference/gtkglext/building.sgml

  • Committer: Bazaar Package Importer
  • Author(s): Marcelo E. Magallon
  • Date: 2004-04-03 17:43:17 UTC
  • Revision ID: james.westby@ubuntu.com-20040403174317-d5gb2d2gftaligp8
Tags: upstream-1.0.6
ImportĀ upstreamĀ versionĀ 1.0.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<refentry id="gtkglext-building" revision="11 Dec 2001">
 
2
<refmeta>
 
3
<refentrytitle>Compiling the GtkGLExt libraries</refentrytitle>
 
4
<manvolnum>3</manvolnum>
 
5
<refmiscinfo>GtkGLExt Library</refmiscinfo>
 
6
</refmeta>
 
7
 
 
8
<refnamediv>
 
9
<refname>Compiling the GtkGLExt Libraries</refname>
 
10
<refpurpose>
 
11
How to compile GtkGLExt
 
12
</refpurpose>
 
13
</refnamediv>
 
14
  <refsect1 id="overview">
 
15
    <title>Building GtkGLExt on UNIX-like systems</title>
 
16
    <para>
 
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
 
21
      the operating system.
 
22
    </para>
 
23
    <para>
 
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.
 
31
    </para>
 
32
    <para>
 
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:
 
40
    </para>
 
41
    <programlisting>
 
42
      tar zxvf gtkglext-x.y.z.tar.gz
 
43
 
 
44
      tar jxvf gtkglext-x.y.z.tar.bz2
 
45
    </programlisting>
 
46
    <para>
 
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:
 
57
    </para>
 
58
    <programlisting>
 
59
      ./configure --prefix=/opt/gtk
 
60
    </programlisting>
 
61
    <para>
 
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
 
68
      it.
 
69
    </para>
 
70
    <programlisting>
 
71
      make
 
72
      make install
 
73
    </programlisting>
 
74
    <para>
 
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.
 
82
    </para>
 
83
    <para>
 
84
      If you want to compile example programs shipped with the source
 
85
      package, run the following command.
 
86
    </para>
 
87
    <programlisting>
 
88
      make examples
 
89
    </programlisting>
 
90
    <para>
 
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:
 
102
    </para>
 
103
    <programlisting>
 
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
 
108
    </programlisting>
 
109
    <para>
 
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.
 
115
    </para>
 
116
    <programlisting>
 
117
      LD_LIBRARY_PATH="/opt/gtk/lib"
 
118
      PATH="/opt/gtk/bin:$PATH"
 
119
      export LD_LIBRARY_PATH PATH
 
120
    </programlisting>
 
121
  </refsect1>
 
122
  <refsect1 id="dependencies">
 
123
    <title>Dependencies</title>
 
124
    <para>
 
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.
 
131
    </para>
 
132
    <itemizedlist>
 
133
      <listitem>
 
134
        <para>
 
135
          <ulink
 
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
 
142
          number information.)
 
143
        </para>
 
144
      </listitem>
 
145
      <listitem>
 
146
        <para>
 
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>.)
 
154
        </para>
 
155
      </listitem>
 
156
      <listitem>
 
157
        <para>
 
158
          <ulink url="http://www.gtk.org/">GTK+</ulink>
 
159
          -- The GIMP Toolkit -- version 2.0 or above.
 
160
        </para>
 
161
      </listitem>
 
162
      <listitem>
 
163
        <para>
 
164
          OpenGL or <ulink url="http://www.mesa3d.org/">Mesa</ulink>.
 
165
        </para>
 
166
      </listitem>
 
167
    </itemizedlist>
 
168
  </refsect1>
 
169
  <refsect1 id="extra-configuration-options">
 
170
    <title>Extra Configuration Options</title>
 
171
 
 
172
      <para>
 
173
        In addition to the normal options, the
 
174
        <command>configure</command> script for the GtkGLExt
 
175
        supports the following additional arguments.
 
176
 
 
177
        <cmdsynopsis>
 
178
          <command>configure</command>
 
179
 
 
180
          <group>
 
181
            <arg>--with-gl-prefix=DIR</arg>
 
182
          </group>
 
183
          <group>
 
184
            <arg>--with-gl-includedir=DIR</arg>
 
185
          </group>
 
186
          <group>
 
187
            <arg>--with-gl-libdir=DIR</arg>
 
188
          </group>
 
189
          <group>
 
190
            <arg>--enable-debug=[no|minimum|yes]</arg>
 
191
          </group>
 
192
          <group>
 
193
            <arg>--disable-gtk-doc</arg>
 
194
            <arg>--enable-gtk-doc</arg>
 
195
          </group>
 
196
          <group>
 
197
            <arg>--with-html-dir=PATH</arg>
 
198
          </group>
 
199
          <group>
 
200
            <arg>--with-gdktarget=[x11|win32]</arg>
 
201
          </group>
 
202
        </cmdsynopsis>
 
203
      </para>
 
204
 
 
205
      <formalpara>
 
206
        <title><systemitem>--with-gl-prefix=DIR</systemitem></title>
 
207
          
 
208
        <para>
 
209
          Directory where OpenGL (Mesa) is installed.
 
210
          The default is 'auto'.
 
211
        </para>
 
212
      </formalpara>
 
213
 
 
214
      <formalpara>
 
215
        <title><systemitem>--with-gl-includedir=DIR</systemitem></title>
 
216
          
 
217
        <para>
 
218
          Directory where OpenGL (Mesa) header files are installed.
 
219
          The default is 'auto'.
 
220
        </para>
 
221
      </formalpara>
 
222
 
 
223
      <formalpara>
 
224
        <title><systemitem>--with-gl-libdir=DIR</systemitem></title>
 
225
          
 
226
        <para>
 
227
          Directory where OpenGL (Mesa) libraries are installed.
 
228
          The default is 'auto'.
 
229
        </para>
 
230
      </formalpara>
 
231
 
 
232
      <formalpara>
 
233
        <title><systemitem>--enable-debug</systemitem></title>
 
234
          
 
235
        <para>
 
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.
 
247
        </para>
 
248
      </formalpara>
 
249
 
 
250
      <formalpara>
 
251
        <title><systemitem>--disable-gtk-doc</systemitem> and
 
252
          <systemitem>--enable-gtk-doc</systemitem></title>
 
253
 
 
254
        <para>
 
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
 
266
          will be installed.
 
267
        </para>
 
268
      </formalpara>
 
269
 
 
270
      <formalpara>
 
271
        <title><systemitem>--with-html-dir</systemitem></title>
 
272
          
 
273
        <para>
 
274
         Path to installed the reference documentation. The default is
 
275
         <filename>${datadir}/gtk-doc/html</filename>.
 
276
        </para>
 
277
      </formalpara>
 
278
 
 
279
      <formalpara>
 
280
        <title><systemitem>--with-gdktarget</systemitem></title>
 
281
 
 
282
        <para>
 
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.
 
286
        </para>
 
287
      </formalpara>
 
288
 
 
289
    </refsect1>
 
290
 
 
291
</refentry>
 
292
 
 
293
<!-- Local Variables: -->
 
294
<!-- sgml-parent-document: ("gtk-docs.sgml" "chapter" "refentry")  -->
 
295
<!-- End: -->