Fandom

CHDK Wiki

Compiling CHDK under Mac OS X

598pages on
this wiki
Add New Page
Talk2 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Here are the necessary steps for building CHDK on a current Macintosh system. You'll need to install Apple's Xcode plus GNU's ARM toolchain.

Note: command examples below are all typed in a Terminal window.

Install necessary software Edit

Install your development environment and package manager:

1. Install Xcode , the Apple development system.  It's free, but you'll need to register.  Xcode installs the compilers needed to build MacPorts and CHDK as well as other vital tools such as Subversion. If you already have Xcode installed, check the App Store and make sure it's the latest version.

2. Either use the MacPorts or Brew package manager for installing open source software on Macs:

a. Install MacPorts If you have previously installed MacPorts, run sudo port selfupdate; but if your installation dates from an earlier version of MacOS, it's advisable to reinstall it.

b. Install Brew. Brew auto-updates every time you run it. One-liner:

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install compiler packages Edit

Use your package manager to install the GNU cross-compiler with thumb interwork multilib support.

1. With MacPorts:

$ sudo port install arm-elf-gcc +interwork

If MacPorts has neglected to define an "arm-elf-gcc" command in /opt/local/bin, you'll need to add this manually. Your version number may differ.

$ cd /opt/local/bin
$ ln -s arm-elf-gcc-4.6.1 arm-elf-gcc

2. With Brew:

To get the compilers, you need to tap an additional repository (this is subject to change):

$ brew tap sevki/homebrew-gcc_cross_compilers
$ brew install arm-elf-gcc
$ brew install gcc-arm-embedded

You might need to adjust the brews to your own compiler set, for example to use a specific version of the GNU compiler set:

$ grep "opt/gcc" /usr/local/Homebrew/Library/Taps/sevki/homebrew-gcc_cross_compilers/arm-elf-gcc.rb
    ENV['CC'] = '/usr/local/opt/gcc/bin/gcc-5'
    ENV['CXX'] = '/usr/local/opt/gcc/bin/g++-5'
    ENV['CPP'] = '/usr/local/opt/gcc/bin/cpp-5'
    ENV['LD'] = '/usr/local/opt/gcc/bin/gcc-5'

Check what works for you.

Download and configure CHDK Edit

1. Download the CHDK source, creating a new directory named chdk.  This example downloads a stable release.  You can change the release number or replace branches/xxx with trunk if you want the latest unstable code.

$ cd $HOME
$ svn co https://tools.assembla.com/svn/chdk/branches/release-1_2 chdk
$ cd chdk

2. In this newly created chdk directory (and not the subdirectory chdk/CHDK), add a new file named localbuildconf.inc that specifies your camera and its firmware level.  The file should look something like this:

# local configuration
PLATFORM=a710
PLATFORMSUB=100a

3. Make sure /opt/local/bin is in your search path ($PATH).  The way to do this depends on your shell.  One example is

$ export PATH=/opt/local/bin:$PATH

Compile the source Edit

Compile the CHDK firmware.

$ make fir

If everything went well, the final result looks like this:

$ **** Firmware creation completed successfully

That's it!  You've just built CHDK.  The new firmware is in the bin directory.

If you copy both DISKBOOT.BIN and PS.FIR to you camera card then you're ready for either type of camera boot method.  If you'd modified any of the modules,  you'll also need to update the CHDK/MODULES directory on the camera card from the CHDK/MODULES directory in the build tree.

I've tried to make this a complete cookbook, but for greater understanding you may find it profitable to also read the Linux installation instructions.

These directions for building CHDK on Macintosh were current as of end of 2016.  Please help keep them up to date by noting any changes you find.

Also on Fandom

Random Wiki