premiere-libtorrent/docs/ubuntu_build_notes.html

158 lines
7.1 KiB
HTML
Raw Normal View History

2006-10-12 23:24:24 +02:00
<?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>
2006-11-08 01:38:30 +01:00
<meta name="date" content="Nov 6, 2006" />
2006-10-12 23:24:24 +02:00
<meta name="author" content="Xi Stan" />
2006-11-08 01:38:30 +01:00
<meta name="author" content="Francois Dermu" />
2006-10-12 23:24:24 +02:00
<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>
2006-11-08 01:38:30 +01:00
<td>Nov 6, 2006</td></tr>
2006-10-12 23:24:24 +02:00
<tr><th class="docinfo-name">Author:</th>
<td>Xi Stan</td></tr>
2006-11-08 01:38:30 +01:00
<tr><th class="docinfo-name">Author:</th>
<td>Francois Dermu</td></tr>
2006-10-12 23:24:24 +02:00
<tr><th class="docinfo-name">Contact:</th>
<td><a class="first last reference" href="mailto:stan8688&#64;gmail.com">stan8688&#64;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>
2006-10-12 23:37:16 +02:00
<p>Create a directory for the project:</p>
2006-10-12 23:24:24 +02:00
<pre class="literal-block">
2006-11-08 01:34:02 +01:00
mkdir ${HOME}/work
cd ${HOME}/work
2006-10-12 23:24:24 +02:00
</pre>
2006-10-12 23:37:16 +02:00
<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
2006-10-12 23:24:24 +02:00
by executing the following commands:</p>
2006-11-08 01:34:02 +01:00
<p><em>No password needed (just hit enter when prompted)</em></p>
2006-10-12 23:24:24 +02:00
<pre class="literal-block">
cvs -d:pserver:anonymous&#64;boost.cvs.sourceforge.net:/cvsroot/boost login
cvs -z3 -d:pserver:anonymous&#64;boost.cvs.sourceforge.net:/cvsroot/boost checkout boost
cvs -d:pserver:anonymous&#64;boost.cvs.sourceforge.net:/cvsroot/boost logout
cvs -d:pserver:anonymous&#64;libtorrent.cvs.sourceforge.net:/cvsroot/libtorrent login
cvs -z3 -d:pserver:anonymous&#64;libtorrent.cvs.sourceforge.net:/cvsroot/libtorrent co -P libtorrent
cvs -d:pserver:anonymous&#64;libtorrent.cvs.sourceforge.net:/cvsroot/libtorrent logout
2006-10-12 23:24:24 +02:00
cvs -d:pserver:anonymous&#64;asio.cvs.sourceforge.net:/cvsroot/asio login
cvs -z3 -d:pserver:anonymous&#64;asio.cvs.sourceforge.net:/cvsroot/asio co -P asio
cvs -d:pserver:anonymous&#64;asio.cvs.sourceforge.net:/cvsroot/asio login
2006-10-12 23:24:24 +02:00
</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
2006-11-08 01:34:02 +01:00
the libraries themselves:</p>
2006-10-12 23:24:24 +02:00
<pre class="literal-block">
2006-11-08 01:34:02 +01:00
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
2006-10-12 23:24:24 +02:00
./build.sh
2006-11-08 01:34:02 +01:00
sudo cp ./bin.linuxx86/bjam /usr/bin
cd $BOOST_ROOT
sudo bjam -sTOOLS=gcc install
2006-10-12 23:24:24 +02:00
</pre>
2006-11-08 01:34:02 +01:00
<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>
2006-10-12 23:24:24 +02:00
<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>
2006-11-08 01:34:02 +01:00
<p>Skip this step if you're using a released tarball.</p>
2006-10-12 23:24:24 +02:00
<p>Execute the following command:</p>
<pre class="literal-block">
2006-11-08 01:34:02 +01:00
cp -R ${BASE_DIR}/asio/include/asio* ${BASE_DIR}/libtorrent/include/libtorrent
2006-10-12 23:24:24 +02:00
</pre>
</div>
<div class="section" id="step-4-building-libtorrent">
<h1><a name="step-4-building-libtorrent">Step 4: Building libtorrent</a></h1>
2006-11-08 01:34:02 +01:00
<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=&quot;-I/usr/local/include/boost-1_35 -I${BASE_DIR}/libtorrent/include/libtorrent&quot;
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>
2006-10-12 23:24:24 +02:00
<p>To use the auto tools to build libtorrent, execute the following commands:</p>
<pre class="literal-block">
2006-11-08 01:34:02 +01:00
cd ${BASE_DIR}/libtorrent
CXXFLAGS=&quot;-I/usr/local/include/boost-1_35 -I${BASE_DIR}/libtorrent/include/libtorrent&quot;
LDFLAGS=-L/usr/local/lib
2006-10-12 23:24:24 +02:00
./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>
2006-11-08 01:34:02 +01:00
<p>If successful, you will see the following files:</p>
2006-10-12 23:24:24 +02:00
<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>
2006-11-08 01:34:02 +01:00
</div>
2006-10-12 23:24:24 +02:00
</body>
</html>