[Libtorrent-devel] Statically compliled rtorrent (howto)

Vladimir Solomenchuk vovasty at gmail.com
Wed May 28 09:04:17 UTC 2008


Hi,

this Makefile will statically compile rtorrent under Macosx 10.5
Requirements:
XCode
Usage:
1. create new directory
2. create in this directory file with name Makefile.
3. download and unpack in this folder following libraries:
pkg-config http://pkgconfig.freedesktop.org/releases/
libsig++ http://libsigc.sourceforge.net/stable.shtml
xml-rpc-c http://sourceforge.net/project/showfiles.php?group_id=16847
libtorrent http://libtorrent.rakshasa.no/
rtorrent http://libtorrent.rakshasa.no/
4. redefine in Makefile variables pkg-config-dir, libsig-dir, xml-rpc-dir,
libtorrent-dir and rtorrent-dir to corresponding values
6. redefine variable sandbox to absolute path to current directory plus san
5. comment in file /usr/lib/pkgconfig/libcurl.pc line
Libs: -L${libdir} -lcurl -arch ppc -arch ppc64 -arch i386 -arch
x86_64             -dynamic -arch ppc -arch ppc64 -arch i386 -arch x86_64 -g
-Os -pipe -arch ppc -arch ppc64 -arch i386 -arch x86_64 -pipe
-Wl,-search_paths_first -Wl,-weak-lgssapi_krb5 -Wl,-weak-lkrb5
-Wl,-weak-lk5crypto -Wl,-weak-lcom_err -Wl,-weak-lresolv
and write new one (you need remove all arch except 386)
Libs: -L${libdir} -lcurl -arch i386 -dynamic -arch i386 -g -Os -pipe -arch
i386 -pipe -Wl,-search_paths_first -Wl,-weak-lgssapi_krb5 -Wl,-weak-lkrb5
-Wl,-weak-lk5crypto -Wl,-weak-lcom_err -Wl,-weak-lresolv
6. run make. rtorrent will be in your current folder
7. return back /usr/lib/pkgconfig/libcurl.pc


===Makefile===
SHELL = /bin/sh

#redefine to absolute path to build directory
current=/Users/solomenchuk/Documents/rtorrent

#redefine to path to pkg-config sources, related to current directory
pkg-config-dir=pkg-config-0.23

#redefine to path to libtorrent sources, related to current directory
libtorrent-dir=libtorrent-0.12.2

#redefine to path to libsig++ sources, related to current directory
libsig-dir=libsigc++-2.0.18

#redefine to path to rtorrent sources, related to current directory
rtorrent-dir=rtorrent-0.8.2

#redefine to path to xml-rpc-c sources, related to current directory
xml-rpc-dir=xmlrpc-c-1.06.27

#redefine to path to openssl sources, related to current directory
(optional)
openssl-dir=openssl-0.9.8g

sandbox=$(current)/sandbox
PATH:=$(PATH):$(sandbox)
PKG_CONFIG_PATH=$(sandbox)/pkgconfig:$(sandbox)/lib/pkgconfig:/usr/lib/pkgconfig

all: init pkg-config libsig libtorrent xml-rpc rtorrent
    cp $(sandbox)/rtorrent ./

init:
    mkdir -p $(sandbox)

pkg-config:
    cd $(pkg-config-dir) && \
    $(SHELL) configure  \
        --enable-static=yes \
        --enable-shared=no \
        --bindir=$(sandbox) \
        --sbindir=$(sandbox) \
        --libexecdir=$(sandbox) \
        --datadir=$(sandbox) \
        --sysconfdir=$(sandbox) \
        --sharedstatedir=$(sandbox) \
        --localstatedir=$(sandbox) \
        --libdir=$(sandbox) \
        --includedir=$(sandbox) \
        --oldincludedir=$(sandbox) \
        --info=$(sandbox) \
        --mandir=$(sandbox) && \
        make all install

libsig:
    cd $(libsig-dir) && \
    $(SHELL) configure  \
            --enable-static=yes \
            --enable-shared=no \
            --bindir=$(sandbox) \
            --sbindir=$(sandbox) \
            --libexecdir=$(sandbox) \
            --datadir=$(sandbox) \
            --sysconfdir=$(sandbox) \
            --sharedstatedir=$(sandbox) \
            --localstatedir=$(sandbox) \
            --libdir=$(sandbox) \
            --includedir=$(sandbox) \
            --oldincludedir=$(sandbox) \
            --info=$(sandbox) \
            --mandir=$(sandbox) && \
            make all install
xml-rpc:
    cd $(xml-rpc-dir) && \
    $(SHELL) configure  \
            --disable-cplusplus \
            --enable-static=yes \
            --enable-shared=no \
            --bindir=$(sandbox) \
            --sbindir=$(sandbox) \
            --libexecdir=$(sandbox) \
            --datadir=$(sandbox) \
            --sysconfdir=$(sandbox) \
            --sharedstatedir=$(sandbox) \
            --localstatedir=$(sandbox) \
            --libdir=$(sandbox) \
            --includedir=$(sandbox) \
            --oldincludedir=$(sandbox) \
            --info=$(sandbox) \
            --mandir=$(sandbox) && \
    make all install

libtorrent:
    export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) && \
    cd $(libtorrent-dir) && \
    $(SHELL) configure \
        --enable-static=yes \
        --enable-shared=no \
        --bindir=$(sandbox) \
        --sbindir=$(sandbox) \
        --libexecdir=$(sandbox) \
        --datadir=$(sandbox) \
        --sysconfdir=$(sandbox) \
        --sharedstatedir=$(sandbox) \
        --localstatedir=$(sandbox) \
        --libdir=$(sandbox) \
        --includedir=$(sandbox) \
        --oldincludedir=$(sandbox) \
        --info=$(sandbox) \
        --mandir=$(sandbox) && \
    make all install

rtorrent:
    export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) && \
    cd $(rtorrent-dir) && \
    $(SHELL) configure  \
            --with-xmlrpc-c \
            --enable-static=yes \
            --enable-shared=no \
            --bindir=$(sandbox) \
            --sbindir=$(sandbox) \
            --libexecdir=$(sandbox) \
            --datadir=$(sandbox) \
            --sysconfdir=$(sandbox) \
            --sharedstatedir=$(sandbox) \
            --localstatedir=$(sandbox) \
            --libdir=$(sandbox) \
            --includedir=$(sandbox) \
            --oldincludedir=$(sandbox) \
            --info=$(sandbox) \
            --mandir=$(sandbox) && \
    make all install

openssl:
    cd $(openssl-dir) && \
    $(SHELL) config  \
            no-shared \
            --openssldir=$(sandbox) && \
    make all install
clean:
    rm -r $(sandbox)
    cd $(pkg-config-dir) && make distclean
    cd $(libsig-dir) && make distclean
    cd $(libtorrent-dir) && make distclean
    cd $(xml-rpc-dir) && make distclean
    cd $(rtorrent-dir) && make distclean
===CUT===
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rakshasa.no/pipermail/libtorrent-devel/attachments/20080528/fe1ea537/attachment.html


More information about the Libtorrent-devel mailing list