Presented here are instruction to build CHDK from scratch with GCC v4.x on Win32.
Contents |
Get Cygwin
Edit
Obtain/update a copy with the Cygwin Setup.
Beyond the default install items, you will need to add the following packages:
- Devel
- binutils
- gcc
- make
- subversion
- Libs
- libgmp-devel
- libmpfr-devel
Install.
Building cross-compiling toolchain
Edit
Building binutils
Edit
Get the latest version of binutils and download it into "C:\cygwin\tmp". [Update: binutils 2.19 causes issues with chdk booting, 2.18 wouldn't compile on Vista, best to use 2.17]
Start the "Cygwin Bash Shell" from the Start Menu, and unpack binutils:
> cd /tmp > tar -xjf binutils-2.18.tar.bz2 > cd binutils-2.18
Configure, build, and install binutils:
> mkdir build > cd build > ../configure --target=arm-elf --prefix=/arm-elf > make > make install
Building gcc
Edit
Get the latest version of gcc and download it into "C:\cygwin\tmp".
From the "Cygwin Bash Shell", unpack gcc:
> cd /tmp > tar -xjf gcc-4.3.2.tar.bz2 > cd gcc-4.3.2
Modify the ARM configuration for gcc by removing comments on the following lines in "gcc/config/arm/t-arm-elf":
MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork MULTILIB_DIRNAMES += normal interwork
Configure, build, and install GCC:
> mkdir build
> cd build
> ../configure --target=arm-elf --prefix=/arm-elf --enable-languages=c \
--disable-shared --disable-newlib --disable-libssp
> make
> make install
Building CHDK
Edit
Get the latest version of CHDK from the subversion repository:
> cd /tmp > svn co http://tools.assembla.com/svn/chdk/trunk chdk > cd chdk
Configure CHDK by editing "makefile.inc". Be sure to change the comments to enable your desired camera.
Build CHDK:
> PATH=/arm-elf/bin:$PATH make fir
Dance like a child.