Chinaunix首页 | 论坛 | 博客
  • 博客访问: 950478
  • 博文数量: 214
  • 博客积分: 10173
  • 博客等级: 上将
  • 技术积分: 1867
  • 用 户 组: 普通用户
  • 注册时间: 2007-06-18 13:48
文章分类

全部博文(214)

文章存档

2012年(1)

2010年(13)

2009年(5)

2008年(98)

2007年(97)

分类: LINUX

2008-05-08 15:17:00

Posted by spari on March 23, 2008

Cross-compiling rtorrent for my Slug running Debian/ARM involved a bit more work, but worthwhile as most of the dependencies are commonly used (ncurses, openssl, curl). I could have just simply copied these libraries over from my Slug - but that would be cheating ;-).Did it work? somewhat. Cross-compiled transmission worked well on the Slug, but as for rtorrent - works when started without any parameters, but the moment I load a file I get:

rtorrent: Last minute panic; sizeof(off_t) != 8.

Anyway, saving it for later time to figure that out, but here’s what I did so far.

Setup:

  1. If you don’t already have an ARM toolchain, build one using Kegel’s crosstool.
  2. Set up the environment variables as I have in .

Note:

  • In most of thes builds below, the configure step is outside/before setting the ARM toolchain environment as the configure does some fancy stuff (like tests and generating scripts) that needs the hosts toolchain (x86_64-linux-gcc) as well. In some cases the generated makefile also needs the hosts toolchain (see ncurses).
  • Each of the builds assumes a fresh environment/terminal!

openssl-0.9.8g:

$ ./Configure linux-generic32 shared --prefix=$BUILDS/arm
$ . ~/.arm_env
$ make
$ make install

libsigc++-2.0.18:

$ ./configure --host=arm-linux --with-shared --with-normal CC=$ARM_GCC LD=$ARM_LD CXX=$ARM_CXX --prefix=$BUILDS/arm
$ make
$ make install

libtorrent-0.12.0:
Found out that libtorrent’s configure wasn’t generating a proper libtool. It had references to the hosts libraries (x86_64) instead of the ARM toolchain libraries — no matter what options I gave on the command line it didn’t take it like the other packages did. So what did I do? I copied the libtool from transmission (see ). It worked :-). Also did a diff between the two and saw that for the most part it was just those path references that where different.

$ svn co svn://rakshasa.no/libtorrent/trunk/libtorrent

$ ./configure --host=arm-linux --with-shared --with-normal --prefix=$BUILDS/arm
$ cp ../transmission-1.06/libtool .
$ . ~/.arm_env
$ make
$ make install

libcurl-7.18.0:

$ ./configure --host=arm-linux --with-shared --with-normal --prefix=$BUILDS/arm
$ . ~/.arm_env
$ make
$ make install

ncurses-5.6:
This thing was a beast to compile, but once all figured out (thanks to this ) it cleanly made use of the host and target toolchain flags (without needing to switch environments). But it didn’t automatically install a pkg-config file!

$ ./configure --host=arm-linux --with-shared --with-normal CC=$ARM_GCC LD=$ARM_LD CXX=$ARM_CXX --with-build-cc=gcc --prefix=$BUILDS/arm
$ make
$ make install

rtorrent-0.8.0:

$ svn co svn://rakshasa.no/libtorrent/trunk/rtorrent

This should work - but doesn’t:

$ ./configure --host=arm-linux --prefix=$BUILDS/arm

For some reason configure fails to use pkg-config to pickup the cross-compiled ncurses. So had to use STUFF_CFLAGS and STUFF_LIBS (both of these overrides detection using pkg-config).

$ ./configure --host=arm-linux --prefix=$BUILDS/arm STUFF_CFLAGS="-I$BUILDS/arm/include/sigc++-2.0 -I$BUILDS/arm/lib/sigc++-2.0/include -I$BUILDS/arm/include -I$BUILDS/arm/include/ncurses" STUFF_LIBS="-L$BUILDS/arm/lib -lsigc-2.0 -lcurl -ltorrent"

$ . ~/.arm_env
$ make
$ make install

阅读(2358) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~