CHDK Wiki
m (added category Development)
(Update instructions to match the current software situation as of Summer 2013.)
(12 intermediate revisions by 8 users not shown)
Line 1: Line 1:
  +
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.  <span style="font-size:13px;line-height:21px;">Command examples below are all typed in a Terminal window.</span>
These directions assume you're running OS X 10.5.4 and have the OS X Developer Tools installed. The OS X Dev Tools can be downloaded from http://developer.apple.com after registering for a free account.
 
   
  +
1. Install [https://developer.apple.com/xcode/ 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.
Building CHDK requires the ARM GCC toolchain. Follow the directions here - http://www.mikrocontroller.net/articles/ARM_GCC_toolchain_for_Linux_and_Mac_OS_X
 
   
  +
2. Install [http://www.macports.org/install.php MacPorts], a package manager for installing open source software on Macs.  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 [https://trac.macports.org/wiki/Migration reinstall it].
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.
 
   
  +
3. Use MacPorts to install the Gnu cross-compiler with thumb interwork multilib support:
  +
$ sudo port install arm-elf-gcc +interwork
  +
<span style="font-size:13px;line-height:21px;">4. 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.</span>
  +
$ cd /opt/local/bin
  +
$ ln -s arm-elf-gcc-4.6.1 arm-elf-gcc
  +
5. 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
  +
<span style="font-size:13px;line-height:21px;">6. 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:</span>
  +
# local configuration
  +
PLATFORM=a710
  +
PLATFORMSUB=100a
  +
7. 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
  +
  +
8. Compile the CHDK firmware.
  +
$ make fir
  +
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 [http://chdk.wikia.com/wiki/Compiling_CHDK_under_Linux Linux] installation instructions.
  +
  +
<span style="line-height:21px;font-size:13px;">These directions for building CHDK on Macintosh were current as of summer 2013.  P</span><span style="line-height:21px;font-size:13px;">lease help keep them up to date by noting any changes you find.</span>
 
[[Category:Development]]
 
[[Category:Development]]

Revision as of 20:40, 17 August 2013

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.  Command examples below are all typed in a Terminal window.

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. Install MacPorts, a package manager for installing open source software on Macs.  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.

3. Use MacPorts to install the Gnu cross-compiler with thumb interwork multilib support:

$ sudo port install arm-elf-gcc +interwork

4. 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

5. 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

6. 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

7. 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

8. Compile the CHDK firmware.

$ make fir

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 summer 2013.  Please help keep them up to date by noting any changes you find.