2012年9月10日 星期一

rTurrent cross compiler

 安裝編譯所需要的依賴包
apt-get install libcurl4-openssl-dev
apt-get install libsigc++-2.0-dev
apt-get install libncurses5-dev


編譯安裝xmlrpc-c
apt-get install subversion
cd /usr/local/src
svn checkout https://xmlrpc-c.svn.sourceforge.net/svnroot/xmlrpc-c/advanced xmlrpc-c
cd ./xmlrpc-c
./configure
make
sudo make install

編譯安裝libtorrent
wget http://libtorrent.rakshasa.no/downloads/libtorrent-0.13.2.tar.gz
tar -xzvf libtorrent-0.13.2.tar.gz

cd libtorrent-0.13.2/
./configure
make
sudo make install


 編譯安裝rtorrent
wget http://libtorrent.rakshasa.no/downloads/rtorrent-0.9.2.tar.gz
tar -xzvf rtorrent-0.9.2.tar.gz

cd rtorrent-0.9.2
./configure --with-xmlrpc-c libtorrent_CFLAGS="-I/usr/local/include" libtorrent_LIBS="-ltorrent" CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" LIBS="-lxmlrpc"
make
sudo make install


#-----------------------------------------------------------------------
# ----------------------------------------
# rtorrent 設定檔
# 檔名:.rtorrent.rc  (隱藏檔,前面有點)
# 存放位置:~  (使用者家目錄)
# ----------------------------------------

# 每 torrent 最小/最大連接數
min_peers = 50
max_peers = 200

# 每 torrent 最大上傳數
max_uploads = 2

# 上傳和下載速度限制,設0=無限制.(單位 KiB)
download_rate = 150
upload_rate = 8

# 隨機 port 範圍
# 範例:port_range = 6890-6999
port_range = 19000-19000

# 下載檔名編碼
encoding_list = UTF-8

# 下載檔案存放目錄
directory = /home/neo/bt

# 快取存放目錄
session = /home/neo/bt/session

# torrent 存放目錄 和 排程設定
# 放在此目錄的中的 torrent 會自動加入列表
schedule = watch_directory,5,5,load_start=/home/neo/bt/seeds/*.torrent

# DHT 開關
dht = on

# DHT port (預設為 6881)
dht_port = 19000
#------------------------------------------------------------------------------------




先試$:/usr/bin/pkg-config看有沒有這程式
沒有的話sudo apt-get install pkg-config
等等編譯libtorrent會用到
還有 sudo apt-get install gettext

1:curl-7.23.1.tar.gz
 wget http://curl.haxx.se/download/curl-7.23.1.tar.gz
tar xvf curl-7.23.1.tar.gz
./configure --prefix=/opt/curl7231 --host=sh4-linux 
make
sudo make install

$:/opt/curl7231/curl -L www.google.com 

2:GNU M4
wget http://ftp.gnu.org/gnu/m4/m4-latest.tar.gz 
tar xvf m4-latest.tar.gz
./configure --prefix=/opt/m4 --host=sh4-linux 
 make
sudo make install

 3:libsigc++-2.2.10
sudo cp /opt/m4/bin/m4 /sbin/m4
wget http://ftp.gnome.org/pub/GNOME/sources/libsigc++/2.2/libsigc++-2.2.10.tar.bz2
tar xvf libsigc++-2.2.10.tar.bz2
./configure --prefix=/opt/libsigc++ --host=sh4-linux 
 make
sudo make install
sudo rm /sbin/m4

4:glib2.3
wget http://ftp.acc.umu.se/pub/gnome/sources/glib/2.30/glib-2.30.0.tar.bz2
tar jxvf glib-2.30.0.tar.bz2
./configure --prefix=/opt/glib230 --host=sh4-linux 
 make
sudo make install



 5:libtorrent 
sudo cp /opt/STM/STLinux-2.3/devkit/sh4/target/usr/lib/libstdc++.la /usr/lib
sudo cp /opt/STM/STLinux-2.3/devkit/sh4/target/usr/lib/libstdc++.so /usr/lib

wget  http://libtorrent.rakshasa.no/downloads/libtorrent-0.13.2.tar.gz
tar xvf libtorrent-0.13.2.tar.gz
export PKG_CONFIG_PATH="/opt/libsigc++/lib/pkgconfig:/opt/curl7231/lib/pkgconfig"
./configure --without-PACKAGE --prefix=/opt/libtorrent --disable-openssl
vi Makefile
replace  gcc => sh4-linux-gcc
replace  cpp => sh4-linux-cpp
replace  g++ => sh4-linux-g++
replace  ar => sh4-linux-ar
replace /use/bin/ld => /opt/STM/STLinux-2.3/devkit/sh4/sh4-linux/bin/ld
#-------------------------------------------------------------

apt-get install libcurl4-openssl-dev
apt-get install libsigc++-2.0-dev
編譯安裝libtorrent
wget http://libtorrent.rakshasa.no/downloads/libtorrent-0.12.6.tar.gz
tar -xzvf libtorrent-0.12.2.tar.gz
cd libtorrent-0.12.2/
./configure
make
make install
 

沒有留言:

張貼留言