229 lines
6.6 KiB
HTML
229 lines
6.6 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
|
|
|
|
|
|
|
|
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<title>Build environment</title>
|
|
<meta content="$Author$" name="author">
|
|
</head>
|
|
|
|
|
|
<body>
|
|
|
|
|
|
<h1>Preface</h1>
|
|
|
|
|
|
This document is part of the <a href="http://livesupport.campware.org/">LiveSupport</a>
|
|
project, Copyright © 2004 <a href="http://www.mdlf.org/">Media
|
|
Development Loan Fund</a>, under the GNU <a href="http://www.gnu.org/licenses/gpl.html">GPL</a>.<br>
|
|
|
|
|
|
<ul>
|
|
|
|
|
|
<li>Author: $Author$</li>
|
|
|
|
|
|
<li>Version: $Revision$</li>
|
|
|
|
|
|
<li>Location: $URL:
|
|
svn+ssh://maroy@code.campware.org/home/svn/repo/livesupport/trunk/livesupport/doc/developmentEnvironment/buildEnvironment.html
|
|
$<br>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
<h1>Scope</h1>
|
|
|
|
|
|
This document describes the build environment for components of the
|
|
LiveSupport project.<br>
|
|
|
|
|
|
<h1>Introduction</h1>
|
|
|
|
|
|
As seen in the <a href="directoryStructure.html">directory structure</a>
|
|
description, each component is contained in its own directory, and has
|
|
the same general directory layout, which includes a <code>configure</code> script on the top
|
|
of the directory. This script is responsible for gathering compilation and installation information, and for creating a <code>Makefile</code> in the top directory. All components are built by using <a href="http://www.gnu.org/directory/make.html">GNU make</a> working on
|
|
that <code>Makefile</code>.<br>
|
|
|
|
<br>
|
|
|
|
This document describes details about the <code>configure</code> script, the targets for the generated <code>Makefile</code>, and related files involved with the installation of the component.<br>
|
|
|
|
|
|
<br>
|
|
|
|
|
|
Parts of this document are inspired by the <a href="http://www.gnu.org/prep/standards.html">GNU Coding Standards</a>
|
|
<a href="http://www.gnu.org/prep/standards_50.html">Makefile
|
|
Conventions Standard targets</a>.<br>
|
|
|
|
|
|
<h1>The <code>configure</code> script and generated files<br>
|
|
|
|
</h1>
|
|
|
|
<h2><code>configure</code> options</h2>
|
|
|
|
The <code>configure</code> script should honor the generic directory settings passed to it:<br>
|
|
|
|
<br>
|
|
|
|
<pre>Installation directories:<br> --prefix=PREFIX install architecture-independent files in PREFIX<br> [/usr/local]<br> --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX<br> [PREFIX]<br><br>Fine tuning of the installation directories:<br> --bindir=DIR user executables [EPREFIX/bin]<br> --sbindir=DIR system admin executables [EPREFIX/sbin]<br> --libexecdir=DIR program executables [EPREFIX/libexec]<br> --datadir=DIR read-only architecture-independent data [PREFIX/share]<br> --sysconfdir=DIR read-only single-machine data [PREFIX/etc]<br> --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]<br> --localstatedir=DIR modifiable single-machine data [PREFIX/var]<br> --libdir=DIR object code libraries [EPREFIX/lib]<br> --includedir=DIR C header files [PREFIX/include]<br> --oldincludedir=DIR C header files for non-gcc [/usr/include]<br> --infodir=DIR info documentation [PREFIX/info]<br> --mandir=DIR man documentation [PREFIX/man]<br></pre>
|
|
|
|
<br>
|
|
|
|
Other configuration-time options should be processed using <code>--with-XXX</code> arguments, using the <a href="http://www.gnu.org/software/autoconf/manual/autoconf-2.57/html_node/autoconf_130.html#IDX835"><code>AC_ARG_WITH</code></a> <code>autoconf</code> macro.<br>
|
|
|
|
<br>
|
|
|
|
Note: when writing <code>etc/configure.ac</code>, the input for the <code>configure</code> script, the <a href="http://autoconf-archive.cryp.to/">Autoconf Macro Archive</a> can provide quite useful.<br>
|
|
|
|
<br>
|
|
|
|
<h2>generated files</h2>
|
|
|
|
The main file generated by the <code>configure</code> script will the the <code>Makefile</code>. The input for the <code>Makefile</code>, <code>etc/Makefile.in</code>, can refer to the variables substituted by <code>configure</code> in the following way:<br>
|
|
|
|
<br>
|
|
|
|
<pre><code>prefix = @prefix@<br>some_other_var = @some_other_var@</code></pre>
|
|
|
|
<br>
|
|
|
|
Because these variables might need to be overwritten when running the <code>Makefile</code>, make sure to use the same name for the variable inside the <code>Makefile</code> as was used by the configure script (as in the above example). For example:<br>
|
|
|
|
<br>
|
|
|
|
<pre><code># these are wrong!<br>PREFIX = @prefix@<br>myvar = @some_other_var@<br><br># these are correct, and have the same desired effect:<br></code><code>prefix = @prefix@<br>some_other_var = @some_other_var@<br>PREFIX = ${prefix}<br>myvar = ${some_other_var}</code></pre>
|
|
|
|
<span style="font-weight: bold;"><br>
|
|
|
|
</span><span style="font-weight: bold;"></span>Using the same names will make it possible to overwrite the values substituted by <code>configure</code> when invoking the <code>Makefile</code>, for example:<br>
|
|
|
|
<br>
|
|
|
|
<pre><code>make prefix=/foo/bar install</code></pre>
|
|
|
|
<br>
|
|
|
|
will cause installation under the prefix <code>/foo/bar</code>, irrespective of the prefix supplied to <code>configure</code>.<br>
|
|
|
|
<span style="font-weight: bold;"></span><span style="font-weight: bold;"></span>
|
|
<h1>Make targets<br>
|
|
|
|
|
|
</h1>
|
|
|
|
|
|
The following make targets are required for all components to support:<br>
|
|
|
|
|
|
<ul>
|
|
|
|
|
|
<li>all</li>
|
|
|
|
|
|
<li>clean</li>
|
|
|
|
|
|
<li>depclean</li>
|
|
|
|
|
|
<li>doc<br>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
<li>dist</li>
|
|
|
|
|
|
<li>check</li>
|
|
|
|
<li>install</li>
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
<h4>all</h4>
|
|
|
|
|
|
Compile all source files for this component. As a result, the
|
|
component is ready to be run (if an executable) or linked to (if a
|
|
library).<br>
|
|
|
|
|
|
This target traverses the dependent modules, and executes the all
|
|
target on them, if their targets do not exist.<br>
|
|
|
|
|
|
<h4>clean</h4>
|
|
|
|
|
|
Delete all files generated by the all target, but only for this module
|
|
(e..g. no files for dependent modules are deleted).<br>
|
|
|
|
|
|
<h4>depclean</h4>
|
|
|
|
|
|
Delete all the dependent target files. Executing the depclean target
|
|
with an all target afterwards results in a full recompilation of all
|
|
the dependent modules.<br>
|
|
|
|
|
|
<h4>doc</h4>
|
|
|
|
|
|
Generate the documentation for this component. This would include
|
|
processing info pages, or using tools to generate documentation based
|
|
on comments in the source code (like javadoc).<br>
|
|
|
|
|
|
<h4>dist</h4>
|
|
|
|
|
|
Create a distribution package for this component. This involves
|
|
possibly compiling, document generation and other tasks, and results in
|
|
an archive containing the distribution.<br>
|
|
|
|
|
|
<h4>check</h4>
|
|
|
|
|
|
Run all tests, especially unit tests, for the component. This usually
|
|
results in a generated test-report.<br>
|
|
|
|
|
|
<br>
|
|
|
|
<h4>install</h4>
|
|
|
|
Installs the component into the specified prefix. (See the <a href="installation.html">Installation</a> document for details.)<br>
|
|
|
|
<br>
|
|
|
|
</body>
|
|
</html>
|