交叉編譯rTorrent-0.8.6-arm:mini2440

背景:
本機環境Ubuntu8.4 目標板mini2440
環境變量已經導入/opt/FriendlyARM/toolschain/4.4.3/bin/


openssl-0.9.8g
1 ./Configure no-asm  os/compiler:arm-linux-gcc
2 make && make install

libsigc++-2.2.4
libsigc++-2.2.4依賴於m4-1.4.16
./configure CC=arm-linux-gcc --build=i386-linux --host=arm-linux CXX=arm-linux-c++
make
make install

libsigc++-2.2.4 
1 ./configure --host=arm-linux --with-shared --with-normal CC=arm-linux-gcc LD=arm-linux-ld CXX=arm-linux-g++ --prefix=/home/wrr/install
2 make  && make install
libsigc++-2.2.4依賴於m4-1.4.16
./configure CC=arm-linux-gcc --build=i386-linux --host=arm-linux CXX=arm-linux-c++
make
make install

ncurses-5.8
1 ./configure --host=arm-linux --with-shared --with-normal CC=arm-linux-gcc LD=arm-linux-ld CXX=arm-linux-g++ --with-build-cc=gcc --prefix=/home/wrr/install
2 make  && make install
這一句很重要"--with-build-cc=gcc" gcc會生成一個在本機運行的tic程序,而不是板子上的,如果沒有這句,會生成arm下的tic。安裝的時候會提示tic不能運行。 

這一步檢查本機pkg-config
檢查PKG_CONFIG_CONFIG_PATH和PKG_CONFIG兩個環境變量
因爲我們前面的庫安裝於/home/wrr/install
export PKG_CONFIG_PATH=/home/wrr/install/lib/pkgconfig
export PKG_CONFIG=/usr/bin/pkg-config
pkg-config --list-all 打印所有可用的庫。
其中必須有
sigc++-2.0
libncurses  
libcrypto 
libssl
如果沒有,別往下幹了。
libtorrent和rTorrent出自一家,因此configure和make風格也一樣。都依賴於pkg-config.因此要在這裏設置好。

libtorrent-0.12.6(依賴openssl libsigc)
1 刪掉14777到14811行,如果不刪掉執行下面這句會提示cannot run test program while cross compiling並且退出
具體來說就是從"if test "$cross_compiling" = yes; then :"
到下面第二個fi,注意if和fi一定要確定成對的刪,具體提示原因我不知道。也沒看。腳本文件太難懂了。下面的rtorrent-0.8.6 configure時也會有這樣的提示。我也找到並刪除。
好在工作量並不大。各自僅有一個。
1 ./configure --host=arm-linux --prefix=/home/wrr/install OPENSSL_CFLAGS=-I/home/wrr/install/openssl-0.9.8b/include OPENSSL_LIBS=-L/home/wrr/install/openssl-0.9.8b/lib STUFF_CFLAGS="-I/home/wrr/install/include/sigc++-2.0 -I/home/wrr/install/lib/sigc++-2.0/include" STUFF_LIBS="-L/home/wrr/install/lib -lsigc-2.0" 
3 make && make install

rtorrent-0.8.6
1 執行步驟2並根據config.log文件找到cannot run test program while cross compiling所在位置。同樣刪掉。
2 ./configure --host=arm-linux --prefix=/home/wrr/install/rTorrent CPPFLAGS=-I/home/wrr/install/include/ncurses LIBS="-L/home/wrr/install/lib -lncurses"
--disable-largefile
3 make && make install

生成的rtorrent是debug版的,達到11M。如果你願意也可以刪掉調試信息
arm-linux-strip -g rtorrent
刪掉後只剩1M多。

enjoy it!
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章