CHDK/Compiling CHDK under Linux

This is the procedure I used to compile CHDK (April 2007).


 * Create a directory where to load the CHDK source code.

> mkdir ~/chdk && cd ~/chdk


 * Get the CHDK source code.

> svn co http://tools.assembla.com/svn/chdk/trunk

or

> svn co http://tools.assembla.com/svn/chdk/grand


 * Or update the source code

> cd grand && svn up


 * Install the cross compiler


 * Get the sources of gcc and binutils from a GNU repository. I used the latest available version of each.


 * Decide where the cross compiler will be on your computer.

> mkdir ~/arm-elf


 * Tell your computer you are going to run programs from that location.

> export PATH=${HOME}/arm-elf/bin:$PATH


 * Create a working area and build binutils and gcc.

> mkdir ~/wa > cd ~/wa > tar xvfj ../src/rlx_dist/binutils-2.17.tar.bz2 > tar xvfj ../src/rlx_dist/gcc-4.1.2.tar.bz2

> cd binutils-2.17 > ./configure --srcdir=../binutils-2.17 --target=arm-elf \ --prefix=~/arm-elf > make > make install > cd ..


 * Manually edit file  to include the following lines without a "#" character in front of the line.

MULTILIB_EXCEPTIONS += *mapcs-26/*mthumb-interwork MULTILIB_OPTIONS   += mno-thumb-interwork/mthumb-interwork MULTILIB_DIRNAMES  += normal interwork

> mkdir gcc-4.1.2-arm-elf && cd gcc-4.1.2-arm-elf > ../gcc-4.1.2/configure --srcdir=../gcc-4.1.2 --target=arm-elf --with-cpu=arm9 --disable-libm --disable-libc --disable-threads --disable-nls --disable-libssp --disable-intl --disable-libiberty --enable-languages=c --with-softfloat-supp --with-float=soft --prefix=~/arm-elf > make > make install


 * That's it for the installation of the cross-compiler.


 * Compiling the CHDK. Go to either 'trunk' or 'grand'.

> cd ~/chdk/grand


 * Manually edit file  to select PLATFORM and PLATFORMSUB for your camera: just remove the "#" comment characters. Also, add the following line at the beginning of file  to tell CHDK where the arm cross compiler is,

PATH := $(HOME)/arm-elf/bin:$(PATH)


 * You should be ready to compile everything.

> make fir


 * PS.FIR should be in the "bin" directory.