premiere-libtorrent/docs/ubuntu_build_notes.rst

147 lines
4.5 KiB
ReStructuredText
Raw Normal View History

2006-10-12 23:24:24 +02:00
==================================
Building libtorrent on Ubuntu 6.06
==================================
2006-11-08 01:38:30 +01:00
:Date: Nov 6, 2006
:Authors: Xi Stan, Francois Dermu
2006-10-12 23:24:24 +02:00
:Contact: stan8688@gmail.com
2006-11-08 01:34:02 +01:00
2006-10-12 23:24:24 +02:00
Prerequisites
=============
To build libtorrent, you need the following libraries:
* http://www.rasterbar.com/products/libtorrent/index.html
* http://www.boost.org
* http://asio.sourceforge.net/
Step 1: Acquire the source code from cvs
========================================
2006-10-12 23:37:16 +02:00
Create a directory for the project::
2006-10-12 23:24:24 +02:00
2006-11-08 01:34:02 +01:00
mkdir ${HOME}/work
cd ${HOME}/work
2006-10-12 23:24:24 +02:00
2006-10-12 23:37:16 +02:00
Check out ``boost``, ``libtorrent``, ``asio`` source code from cvs
2006-11-08 01:34:02 +01:00
by executing the following commands:
*No password needed (just hit enter when prompted)*
::
2006-10-12 23:24:24 +02:00
2006-10-12 23:37:16 +02:00
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
2006-10-12 23:24:24 +02:00
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
2006-10-12 23:24:24 +02:00
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
2006-10-12 23:24:24 +02:00
Step 2: Building boost
======================
To build boost, first build boost-build and then use that to build
2006-11-08 01:34:02 +01:00
the libraries themselves:
.. parsed-literal::
BASE_DIR=${HOME} *### Feel free to change this one.*
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
2006-10-12 23:24:24 +02:00
2006-11-08 01:34:02 +01:00
*It takes about 45 min. (so if you want to grap a coke, now is the time)*
2006-10-12 23:24:24 +02:00
2006-11-08 01:34:02 +01:00
If you're successful you will see the following files in ``/usr/local/lib``::
2006-10-12 23:24:24 +02:00
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
Step 3: Copy asio into the libtorrent directory
===============================================
2006-11-08 01:34:02 +01:00
Skip this step if you're using a released tarball.
2006-10-12 23:24:24 +02:00
Execute the following command::
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
Step 4: Building libtorrent
===========================
2006-11-08 01:34:02 +01:00
building with autotools
-----------------------
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 *compiled* 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.
If you want to build the client_test example, you'll also need boost.regex and boost.program_options.
generating the build system
---------------------------
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 `running configure`_.
Execute the following commands, in the given order, to generate the build system::
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
On darwin/OSX you have to run glibtoolize instead of libtoolize.
running configure
-----------------
2006-10-12 23:24:24 +02:00
To use the auto tools to build libtorrent, execute the following commands::
2006-11-08 01:34:02 +01:00
cd ${BASE_DIR}/libtorrent
CXXFLAGS="-I/usr/local/include/boost-1_35 -I${BASE_DIR}/libtorrent/include/libtorrent"
LDFLAGS=-L/usr/local/lib
2006-10-12 23:24:24 +02:00
2006-11-08 01:34:02 +01:00
./configure --with-boost-date-time=boost_date_time-gcc \
--with-boost-filesystem=boost_filesystem-gcc \
--with-boost-thread=boost_thread-gcc-mt
2006-10-12 23:24:24 +02:00
2006-11-08 01:34:02 +01:00
make
sudo make install
2006-10-12 23:24:24 +02:00
2006-11-08 01:34:02 +01:00
If successful, you will see the following files::
2006-10-12 23:24:24 +02:00
/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