I found this post sometime ago and very interrested in CodeSourcery's tool chain.
motz diary: Compile Android kernel from the source
First of all, downlaod the toolchain tar ball. Make sure choice is ARM
Download the ARM 2007q3 Release
Correction on Jan 18, 2008: A choice should be a pair of ARM GNU/Linux and IA32 GNU/Linux. We need -arm-none-linux-gnueabi-, not -arm-none-eabi-. Sorry for any inconvenience.
Then unpack it somewhere convenient for you. My case, /opt.
$ cd /optDownload source code of w3m from SourceForge.
$ sudo tar jxvf arm-2007q3-51-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
$ sudo ln -s arm-2007q3 arm-cc
$ export PATH=/opt/arm-cc/bin:$PATH
$ export CC=arm-none-linux-gnueabi-gcc
Try configure and build.
$ tar zxvf w3m-0.5.2.tar.gzSo, w3m wants Hans_Boehm gc. After some googling, I found it in HP's site.
$ cd w3m-0.5.2
$ ./configure --host=arm-none-linux-gnueabi --enable-japanese=U
checking GC header location... /usr /usr/local ~/
checking /usr/include... checking gc.h usability... no
checking gc.h presence... no
checking for gc.h... no
$ wget http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc.tar.gzCommand is there and path is OK. So just edit the shell script to tell the absolute path to ranlib.
$ tar zxvf gc.tar.gz
$ cd gc6.7
$ ./configure --host=arm-none-linux-gnueabi --prefix=/opt/arm-cc
$ sudo make --dry-run install
$ sudo make install
error!
arm-none-linux-gnueabi-ranlib /opt/arm-cc/lib/libgc.a
./libtool: line 4680: arm-none-linux-gnueabi-ranlib: command not found
Edit libtool at line 172
Before: RANLIB="arm-none-linux-gnueabi-ranlib"
After: RANLIB="/opt/arm-cc/bin/arm-none-linux-gnueabi-ranlib"
Try again.
$ sudo make installSeems to be OK.
Go back to w3m build.
$ cd w3m-0.5.2So, w3m really doesn't support cross compiling. Let's edit configure not to bail out on this error.
$ ./configure --host=arm-none-linux-gnueabi \
--prefix=/opt/arm-cc \
--with-gc=/opt/arm-cc \
--enable-japanese=U
checking whether setpgrp takes no argument...
configure: error: cannot check setpgrp when cross compiling
Comment out exit in configure at line 10501
# { (exit 1); exit 1; };
Try configure again, then make.
$ ./configure --host=arm-none-linux-gnueabi \My setpgrp looks like void function. Edit configure again.
--prefix=/opt/arm-cc \
--with-gc=/opt/arm-cc \
--enable-japanese=U
$ make
etc.c: In function 'setup_child':
etc.c:1366: error: too many arguments to function 'setpgrp'
Add a following line to configure at line 10554
ac_cv_func_setpgrp_void=yes
Retry.
$ ./configure --host=arm-none-linux-gnueabi \Gee. Make try to build a tool runtime.
--prefix=/opt/arm-cc \
--with-gc=/opt/arm-cc \
--enable-japanese=U
$ make
./mktable 100 functable.tab > functable.c
/bin/bash: ./mktable: cannot execute binary file
$ file mktable
mktable: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.14, dynamically linked (uses shared libs), not stripped
Edit Makefile to make x86 executable for mktable. It's kind a long story. So see w3m-0.5.2-arm-patch.tar.gz if you are interrested in.
Retry.
$ make cleanNow I got tons of errors related ncurses is missing.
$ make
$ wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.4.tar.gzIt looks like very tough thing to do.
$ tar zxvf ncurses-5.4.tar.gz
$ cd ncurses-5.4
$ ./configure --host=arm-none-linux-gnueabi --prefix=/opt/arm-cc
$ make
AWK=mawk sh ./tinfo/MKkeys_list.sh ../include/Caps | sort >keys.list
./make_keys keys.list > init_keytry.h
./make_keys: 1: Syntax error: word unexpected (expecting ")")
Forget to build ncurses from scratch. Intead, copy them from openembedded image which I already have.
$ pushd ~/openembedded/tmp/work/armv5te-angstrom-linux-gnueabi/ncurses-5.4-r9/image/Or download ncurses-dev package on Angsrom Zaurus and copy them back.
$ cd usr/lib
$ cp -a . /opt/arm-cc/lib
$ cd ../share
$ cp -a . /opt/arm-cc/share
$ ssh root@zaurusTry again.
# ipkg update
# ipkg install ncurses-dev
# ipkg files ncurses-dev
Package ncurses-dev (5.4-r10) is installed on root and has the following files:
/usr/lib/libcurses.a
/usr/lib/libncurses.a
... snip ...
/usr/lib/libncurses.so
/usr/include/unctrl.h
/usr/include/term.h
/usr/include/menu.h
/usr/include/ncurses.h
$ make cleanLooks good. Copy to Angsrom Zaurus and try.
$ make
$ tar zcvf /tmp/arm-w3m.tar.gz w3m w3mbookmark w3mhelperpanel w3mimgdisplay
$ pushd /opt/arm-cc/lib/gcc/arm-none-linux-gnueabi/4.2.1/
$ find . -name "libgc.*" -print | xargs tar zcvf /tmp/arm-libgc.tar.gz
$ scp /tmp/arm-w3m.tar.gz root@zaurus:/home/root
$ scp /tmp/arm-libgc.tar.gz root@zaurus:/home/root
$ ssh root@zaurus
# tar zxvf arm-w3m.tar.gz
# cd /usr/lib
# tar zxvf /home/root/arm-libgc.tar.gz
# LANG=c ./w3m http://hogehoge
というわけで、お約束のビルド方法について。こんな感じでクロスビルドしてますよ、ということで。
んでもってCodeSourceryのツールチェーンはAngstromに使えますよ、ということで。