158 lines
7.1 KiB
HTML
158 lines
7.1 KiB
HTML
<?xml version="1.0" encoding="utf-8" ?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta name="generator" content="Docutils 0.3.9: http://docutils.sourceforge.net/" />
|
|
<title>Building libtorrent on Ubuntu 6.06</title>
|
|
<meta name="date" content="Nov 6, 2006" />
|
|
<meta name="author" content="Xi Stan" />
|
|
<meta name="author" content="Francois Dermu" />
|
|
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div class="document" id="building-libtorrent-on-ubuntu-6-06">
|
|
<h1 class="title">Building libtorrent on Ubuntu 6.06</h1>
|
|
<table class="docinfo" frame="void" rules="none">
|
|
<col class="docinfo-name" />
|
|
<col class="docinfo-content" />
|
|
<tbody valign="top">
|
|
<tr><th class="docinfo-name">Date:</th>
|
|
<td>Nov 6, 2006</td></tr>
|
|
<tr><th class="docinfo-name">Author:</th>
|
|
<td>Xi Stan</td></tr>
|
|
<tr><th class="docinfo-name">Author:</th>
|
|
<td>Francois Dermu</td></tr>
|
|
<tr><th class="docinfo-name">Contact:</th>
|
|
<td><a class="first last reference" href="mailto:stan8688@gmail.com">stan8688@gmail.com</a></td></tr>
|
|
</tbody>
|
|
</table>
|
|
<div class="section" id="prerequisites">
|
|
<h1><a name="prerequisites">Prerequisites</a></h1>
|
|
<p>To build libtorrent, you need the following libraries:</p>
|
|
<ul class="simple">
|
|
<li><a class="reference" href="http://www.rasterbar.com/products/libtorrent/index.html">http://www.rasterbar.com/products/libtorrent/index.html</a></li>
|
|
<li><a class="reference" href="http://www.boost.org">http://www.boost.org</a></li>
|
|
<li><a class="reference" href="http://asio.sourceforge.net/">http://asio.sourceforge.net/</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="section" id="step-1-acquire-the-source-code-from-cvs">
|
|
<h1><a name="step-1-acquire-the-source-code-from-cvs">Step 1: Acquire the source code from cvs</a></h1>
|
|
<p>Create a directory for the project:</p>
|
|
<pre class="literal-block">
|
|
mkdir ${HOME}/work
|
|
cd ${HOME}/work
|
|
</pre>
|
|
<p>Check out <tt class="docutils literal"><span class="pre">boost</span></tt>, <tt class="docutils literal"><span class="pre">libtorrent</span></tt>, <tt class="docutils literal"><span class="pre">asio</span></tt> source code from cvs
|
|
by executing the following commands:</p>
|
|
<p><em>No password needed (just hit enter when prompted)</em></p>
|
|
<pre class="literal-block">
|
|
cvs -d:pserver:anonymous@boost.cvs.sourceforge.net:/cvsroot/boost login
|
|
cvs -z3 -d:pserver:anonymous@boost.cvs.sourceforge.net:/cvsroot/boost checkout boost
|
|
cvs -d:pserver:anonymous@boost.cvs.sourceforge.net:/cvsroot/boost logout
|
|
|
|
cvs -d:pserver:anonymous@libtorrent.cvs.sourceforge.net:/cvsroot/libtorrent login
|
|
cvs -z3 -d:pserver:anonymous@libtorrent.cvs.sourceforge.net:/cvsroot/libtorrent co -P libtorrent
|
|
cvs -d:pserver:anonymous@libtorrent.cvs.sourceforge.net:/cvsroot/libtorrent logout
|
|
|
|
cvs -d:pserver:anonymous@asio.cvs.sourceforge.net:/cvsroot/asio login
|
|
cvs -z3 -d:pserver:anonymous@asio.cvs.sourceforge.net:/cvsroot/asio co -P asio
|
|
cvs -d:pserver:anonymous@asio.cvs.sourceforge.net:/cvsroot/asio login
|
|
</pre>
|
|
</div>
|
|
<div class="section" id="step-2-building-boost">
|
|
<h1><a name="step-2-building-boost">Step 2: Building boost</a></h1>
|
|
<p>To build boost, first build boost-build and then use that to build
|
|
the libraries themselves:</p>
|
|
<pre class="literal-block">
|
|
BASE_DIR=${HOME} <em>### Feel free to change this one.</em>
|
|
BOOST_ROOT=${BASE_DIR}/boost
|
|
BOOST_BUILD_PATH=${BOOST_ROOT}/tools/build/v2
|
|
cd ${BOOST_ROOT}/tools/jam/src
|
|
./build.sh
|
|
sudo cp ./bin.linuxx86/bjam /usr/bin
|
|
cd $BOOST_ROOT
|
|
sudo bjam -sTOOLS=gcc install
|
|
</pre>
|
|
<p><em>It takes about 45 min. (so if you want to grap a coke, now is the time)</em></p>
|
|
<p>If you're successful you will see the following files in <tt class="docutils literal"><span class="pre">/usr/local/lib</span></tt>:</p>
|
|
<pre class="literal-block">
|
|
libboost_date_time-gcc-d-1_31.so
|
|
libboost_date_time-gcc-mt-d-1_31.so
|
|
libboost_date_time-gcc-1_31.so
|
|
libboost_date_time-gcc-mt-1_31.so
|
|
libboost_date_time-gcc-d-1_31.a
|
|
libboost_date_time-gcc-mt-d-1_31.a
|
|
libboost_date_time-gcc-1_31.a
|
|
libboost_date_time-gcc-mt-1_31.a
|
|
</pre>
|
|
</div>
|
|
<div class="section" id="step-3-copy-asio-into-the-libtorrent-directory">
|
|
<h1><a name="step-3-copy-asio-into-the-libtorrent-directory">Step 3: Copy asio into the libtorrent directory</a></h1>
|
|
<p>Skip this step if you're using a released tarball.</p>
|
|
<p>Execute the following command:</p>
|
|
<pre class="literal-block">
|
|
cp -R ${BASE_DIR}/asio/include/asio* ${BASE_DIR}/libtorrent/include/libtorrent
|
|
</pre>
|
|
</div>
|
|
<div class="section" id="step-4-building-libtorrent">
|
|
<h1><a name="step-4-building-libtorrent">Step 4: Building libtorrent</a></h1>
|
|
<div class="section" id="building-with-autotools">
|
|
<h2><a name="building-with-autotools">building with autotools</a></h2>
|
|
<p>First of all, you need to install automake and autoconf. Many unix/linux systems
|
|
comes with these preinstalled. The prerequisites for building libtorrent are
|
|
boost.thread, boost.date_time and boost.filesystem. Those are the <em>compiled</em> boost
|
|
libraries needed. The headers-only libraries needed include (but is not necessarily
|
|
limited to) boost.bind, boost.ref, boost.multi_index, boost.optional,
|
|
boost.lexical_cast, boost.integer, boost.iterator, boost.tuple, boost.array,
|
|
boost.function, boost.smart_ptr, boost.preprocessor, boost.static_assert.</p>
|
|
<p>If you want to build the client_test example, you'll also need boost.regex and boost.program_options.</p>
|
|
</div>
|
|
<div class="section" id="generating-the-build-system">
|
|
<h2><a name="generating-the-build-system">generating the build system</a></h2>
|
|
<p>No build system is present if libtorrent is checked out from CVS - it needs to be
|
|
generated first. If you're building from a released tarball, you may skip directly
|
|
to <a class="reference" href="#running-configure">running configure</a>.</p>
|
|
<p>Execute the following commands, in the given order, to generate the build system:</p>
|
|
<pre class="literal-block">
|
|
cd ${BASE_DIR}/libtorrent
|
|
CXXFLAGS="-I/usr/local/include/boost-1_35 -I${BASE_DIR}/libtorrent/include/libtorrent"
|
|
LDFLAGS=-L/usr/local/lib
|
|
|
|
aclocal -I m4
|
|
autoheader
|
|
libtoolize --copy --force
|
|
automake --add-missing --copy --gnu
|
|
autoconf
|
|
</pre>
|
|
<p>On darwin/OSX you have to run glibtoolize instead of libtoolize.</p>
|
|
</div>
|
|
<div class="section" id="running-configure">
|
|
<h2><a name="running-configure">running configure</a></h2>
|
|
<p>To use the auto tools to build libtorrent, execute the following commands:</p>
|
|
<pre class="literal-block">
|
|
cd ${BASE_DIR}/libtorrent
|
|
CXXFLAGS="-I/usr/local/include/boost-1_35 -I${BASE_DIR}/libtorrent/include/libtorrent"
|
|
LDFLAGS=-L/usr/local/lib
|
|
|
|
./configure --with-boost-date-time=boost_date_time-gcc \
|
|
--with-boost-filesystem=boost_filesystem-gcc \
|
|
--with-boost-thread=boost_thread-gcc-mt
|
|
|
|
make
|
|
sudo make install
|
|
</pre>
|
|
<p>If successful, you will see the following files:</p>
|
|
<pre class="literal-block">
|
|
/usr/local/lib/libtorrent.a
|
|
/usr/local/lib/libtorrent.so.0
|
|
/usr/local/lib/libtorrent.la
|
|
/usr/local/lib/libtorrent.so.0.1.0
|
|
/usr/local/lib/libtorrent.so
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|