1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Compiling the GNOME Print library</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="GNOME Print Reference Manual">
<link rel="up" href="libgnomeprint.html" title="Part I. GNOME Print Overview">
<link rel="prev" href="libgnomeprint.html" title="Part I. GNOME Print Overview">
<link rel="next" href="libgnomeprint-compiling.html" title="Compiling GNOME Print Applications">
<meta name="generator" content="GTK-Doc V1.15.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
<td><a accesskey="p" href="libgnomeprint.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="libgnomeprint.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GNOME Print Reference Manual</th>
<td><a accesskey="n" href="libgnomeprint-compiling.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="libgnomeprint-building"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle">Compiling the GNOME Print library</span></h2>
<p>Compiling the GNOME Print library —
How to compile libgnomeprint
</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="overview"></a><h2>Building GNOME Print on UNIX-like systems</h2>
<p>
This chapter covers building and installing GNOME Print on UNIX and
UNIX-like systems such as Linux.
</p>
<p>
Before we get into the details of how to compile GNOME Print, we should
mention that in many cases, binary packages of GNOME Print prebuilt for
your operating system will be available, either from your
operating system vendor or from independent sources. If such a
set of packages is available, installing it will get you
programming wih GNOME Print much faster than building it yourself. In
fact, you may well already have GNOME Print installed on your system
already.
</p>
<p>
On UNIX-like systems GNOME Print uses the standard GNU build system,
using <span class="application">autoconf</span> for package
configuration and resolving portability issues,
<span class="application">automake</span> for building makefiles that
comply with the GNU Coding Standards, and
<span class="application">libtool</span> for building shared libraries
on multiple platforms.
</p>
<p>
If you are building GNOME Print from the distributed source packages,
then won't need these tools installed; the necessary pieces
of the tools are already included in the source packages. But
it's useful to know a bit about how packages that use these
tools work. A source package is distributed as a
<code class="literal">tar.gz</code> file which you unpack into a
directory full of the source files as follows:
</p>
<pre class="programlisting">
tar xvfz libgnomeprint-2.0.0.tar.gz
</pre>
<p>
In the toplevel of the directory that is created, there will be
a shell script called <code class="filename">configure</code> which
you then run to take the template makefiles called
<code class="filename">Makefile.in</code> in the package and create
makefiles customized for your operating system. The <code class="filename">configure</code>
script can be passed various command line arguments to determine how
the package is built and installed. The most commonly useful
argument is the <code class="systemitem">--prefix</code> argument which
determines where the package is installed. To install a package
in <code class="filename">/opt/libgnomeprint</code> you would run configure as:
</p>
<pre class="programlisting">
./configure --prefix=/opt/libgnomeprint
</pre>
<p>
A full list of options can be found by running
<code class="filename">configure</code> with the
<code class="systemitem">--help</code> argument. In general, the defaults are
right and should be trusted. After you've run
<code class="filename">configure</code>, you then run the
<span class="command"><strong>make</strong></span> command to build the package and install
it.
</p>
<pre class="programlisting">
make
make install
</pre>
<p>
If you don't have permission to write to the directory you are
installing in, you may have to change to root temporarily before
running <code class="literal">make install</code>. Also, if you are
installing in a system directory, on some systems (such as
Linux), you will need to run <span class="command"><strong>ldconfig</strong></span> after
<code class="literal">make install</code> so that the newly installed
libraries will be found.
</p>
<p>
Several environment variables are useful to pass to set before
running configure. <code class="envar">CPPFLAGS</code> contains options to
pass to the C compiler, and is used to tell the compiler where
to look for include files. The <code class="envar">LDFLAGS</code> variable
is used in a similar fashion for the linker. Finally the
<code class="envar">PKG_CONFIG_PATH</code> environment variable contains
a search path that <span class="command"><strong>pkg-config</strong></span> (see below)
uses when looking for for file describing how to compile
programs using different libraries. If you were installing GNOME Print
and it's dependencies into <code class="filename">/opt/libgnomeprint</code>, you
might want to set these variables as:
</p>
<pre class="programlisting">
CPPFLAGS="-I/opt/libgnomeprint/include"
LDFLAGS="-L/opt/libgnomeprint/lib"
PKG_CONFIG_PATH="/opt/libgnomeprint/lib/pkgconfig"
export CPPFLAGS LDFLAGS PKG_CONFIG_PATH
</pre>
<p>
You may also need to set the <code class="envar">LD_LIBRARY_PATH</code>
environment variable so the systems dynamic linker can find
the newly installed libraries, and the <code class="envar">PATH</code>
environment program so that utility binaries installed by
the various libraries will be found.
</p>
<pre class="programlisting">
LD_LIBRARY_PATH="/opt/libgnomeprint/lib"
PATH="/opt/libgnomeprint/bin:$PATH"
export LD_LIBRARY_PATH PATH
</pre>
</div>
<div class="refsect1">
<a name="dependencies"></a><h2>Dependencies</h2>
<p>
Before you can compile the GNOME Print, 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 GNOME Print
mentioned above such as <span class="application">autoconf</span>)
are <span class="command"><strong>pkg-config</strong></span> and GNU make.
</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem"><p>
<a class="ulink" href="http://www.freedesktop.org/software/pkgconfig/" target="_top">pkg-config</a>
is a tool for tracking the compilation flags needed for
libraries that is used by the GNOME Print library. (A small
<code class="literal">.pc</code> text file is installed in a standard
location that contains the compilation flags needed for the
library along with version number information.)
</p></li>
<li class="listitem"><p>
The GNOME Print makefiles will mostly work with different versions
of <span class="command"><strong>make</strong></span>, however, there tends to be
a few incompatibilities, so the GNOME Print team recommends
installing <a class="ulink" href="http://www.gnu.org/software/make" target="_top">GNU
make</a> if you don't already have it on your system
and using it. (It may be called <span class="command"><strong>gmake</strong></span>
rather than <span class="command"><strong>make</strong></span>.)
</p></li>
</ul></div>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem"><p>
The libart module. It is available from the
<a class="ulink" href="ftp://ftp.gnome.org/pub/GNOME/earthquake/sources/libart_lgpl/" target="_top">
GNOME FTP site.</a>
</p></li>
<li class="listitem"><p>
The libxml2 module. It is available from the
<a class="ulink" href="ftp://ftp.gnome.org/pub/GNOME/earthquake/sources/libxml2/" target="_top">
GNOME FTP site.</a>
</p></li>
<li class="listitem"><p>
The libbonobo module. It's available from the
<a class="ulink" href="ftp://ftp.gnome.org/pub/GNOME/earthquake/sources/libbonobo/" target="_top">
GNOME FTP site.</a>
</p></li>
<li class="listitem"><p>
The GLib library provides core non-graphical functionality
such as high level data types, Unicode manipulation, and
a object and type system to C programs. It is available
from the <a class="ulink" href="ftp://ftp.gtk.org/pub/gtk/v2.0/" target="_top">GTK+
FTP site.</a>
</p></li>
<li class="listitem"><p>
Pango is a library for internationalized text handling. It
is available from the <a class="ulink" href="ftp://ftp.gtk.org/pub/gtk/v2.0/" target="_top">GTK+ FTP site.</a>
</p></li>
<li class="listitem"><p>
The libintl library from the <a class="ulink" href="ftp://ftp.gnu.org/gnu/gettext/" target="_top">GNU gettext
package</a> is needed if your system doesn't have the
<code class="function">gettext()</code> functionality for handling
message translation databases.
</p></li>
</ul></div>
</div>
<div class="refsect1">
<a name="building"></a><h2>Building and testing GNOME Print</h2>
<p>
First make sure that you have the necessary dependencies installed:
<span class="command"><strong>pkg-config</strong></span>, GNU make, libart, libxml2, libbonobo, glib,
and, if necessary, libintl. To get detailed information about building
these packages, see the documentation provided with the
individual packages.
On a Linux system, it's quite likely you'll have all of these
installed already except for <span class="command"><strong>pkg-config</strong></span>.
</p>
<p>
Then build and install the GNOME Print library, follow the
steps of <code class="literal">configure</code>, <code class="literal">make</code>,
<code class="literal">make install</code> mentioned above. If you're
lucky, this will all go smoothly, and you'll be ready to
<a class="link" href="libgnomeprint-compiling.html" title="Compiling GNOME Print Applications">start compiling your own
GNOME Print applications</a>.
</p>
<p>
If the <code class="filename">configure</code> scripts fails or running
<span class="command"><strong>make</strong></span> fails, look closely at the error
messages printed; these will often provide useful information
as to what went wrong. When <code class="filename">configure</code>
fails, extra information, such as errors that a test compilation
ran into, is found in the file <code class="filename">config.log</code>.
Looking at the last couple of hundred lines in this file will
frequently make clear what went wrong. If all else fails, you
can ask for help on the gnome-print mailing list.
See <a class="xref" href="libgnomeprint-resources.html" title="Mailing lists and bug reports"><span class="refentrytitle">Mailing lists and bug reports</span>(3)</a> for more information.
</p>
</div>
<div class="refsect1">
<a name="extra-configuration-options"></a><h2>Extra Configuration Options</h2>
<p>
In addition to the normal options, the
<span class="command"><strong>configure</strong></span> script for the GNOME Print library
supports a number of additional arguments.
</p>
<div class="cmdsynopsis"><p><code class="command">configure</code> [[--with-omni-libdir=DIR]] [[--with-omni-includedir=DIR]] [[--enable-font-install=[yes|no]]] [[--with-html-dir=PATH]] [[--disable-gtk-doc] | [--enable-gtk-doc]]</p></div>
<p>
</p>
<p><b><code class="systemitem">--with-omni-libdir=DIR</code>. </b>
FIXME: Add information here.
</p>
<p><b><code class="systemitem">--with-omni-includedir=DIR</code>. </b>
FIXME: Add information here.
</p>
<p><b><code class="systemitem">--with-html-dir=PATH</code>. </b>
FIXME: Add information here.
</p>
<p><b><code class="systemitem">--disable-gtk-doc</code> and
<code class="systemitem">--enable-gtk-doc</code>. </b>
The <span class="application">gtk-doc</span> package is
used to generate the reference documentation included
with GNOME Print. By default support for
<span class="application">gtk-doc</span> is disabled because it
requires various extra dependencies to be installed. If you have
<span class="application">gtk-doc</span> installed and
are modifying GNOME Print, you may want to enable
<span class="application">gtk-doc</span> support by passing
in <code class="systemitem">--enable-gtk-doc</code>. If not
enabled, pre-generated HTML files distributed with GNOME Print
will be installed.
</p>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.15.1</div>
</body>
</html>
|