CHDK Wiki
Register
Advertisement

Building CHDK requires gcc 4.3.2 and the ARM GCC toolchain.

1. Install MacPorts - http://www.macports.org/install.php

2. Before you install gcc you'll need a working compiler, so Apple's dev. tool (from the installation CD) should be installed.

3. Install gcc v4.3.2. from the terminal, type -

sudo port install gcc43
  (type the admin password as prompted)
  (this took several hours on my macbook pro)

4. Install arm-elf-gcc v4.3.2 - from the terminal.

sudo port deactivate arm-elf-gcc

# the above command may give an ignorable error -
# port deactivate failed: Registry error: arm-elf-gcc not registered as installed & active"

  sudo port install arm-elf-gcc

# the above command may give the fatal error
# "ld: duplicate symbol _init_inline_once in libbackend.a(tree-inline.o) and 
#   tree-inline.ocollect2: ld returned 1 exit status"
# still working out how to fix this, but see http://trac.macports.org/ticket/20816 (leads to diff error)

5. make gcc v4.3.2 the default compiler.

cd /usr/bin
  rm gcc
  ln -s /opt/local/bin/gcc-mp-4.3 gcc

6. make arm-elf-gcc v4.3.2 default.

cd /usr/local/arm/bin
  rm arm-elf-gcc
  ln -s /opt/local/bin/arm-elf-gcc-4.3.2 arm-elf-gcc

From here, the directions for compiling under linux will work Compiling_CHDK_under_Linux although the directions for installing the compiler and cross compiler can be skipped.

Troubleshooting

If arm-elf-gcc doesn't compile, make sure you are using the latest version of MacPorts. To update it, type:

sudo port selfupdate

If that doesn't work, reinstall it from the website. If it gives you an error about libmpfr or something like that, type:

sudo port install mpfr

and try again.

Advertisement