Dave Perrett

Compile LibTorrent on OSX

bittorrent, linux, osx, programming

Before you do anything, install darwinports , and then use it to install boost :

1
2
3
$ sudo port install boost
$ sudo port install boost-build
$ sudo port install boost-jam

To compile libtorrent:

1
2
3
4
5
6
7
8
9
10
11
12
export LDFLAGS=-L/opt/local/lib
export CXXFLAGS=-I/opt/local/include/boost-1_33_1/boost
export BOOST_BUILD_PATH=/path/to/where/you/want/to/build/libtorrent
export BOOST_ROOT=/opt/local/include/boost-1_33_1/boost
aclocal -I m4
autoheader
glibtoolize --copy --force
automake --add-missing --copy --gnu
autoconf
CXXFLAGS="-I/opt/local/include/boost-1_33_1/boost -I/opt/local/include" LDFLAGS="-L/opt/local/lib" ./configure
make
make check

Replace /path/to/where/you/want/to/build/libtorrent with a temporary directory somewhere to store the build products.

Make sure to add the –enable-debug=no option to ./configure for production builds.