Basic instructions for building Kicad and wxMac for OS X. (I originally posted this to the Fritzing Google Code wiki but wanted to keep it handy)
Introduction:
Kicad is a great, open source (GPL) electronic design suite that we have started investigating for use in Fritzing. Unfortunately, there are no pre-built binaries for OS X available, and few instructions for building it from source. The method I used is given below.
Details:
Kicad uses the wxMac version of the wxWidgets GUI library, so you’ll need to have wxMac installed first. Since we would like our build of Kicad to run on both Intel and PowerPC Macs, we need to build Kicad and wxMac as universal binaries.
Prerequisites:
You will need the following things to build Kicad for OS X:
- Kicad source from the Kicad site (I used the latest version from SVN snapshot - 20071122-r468 at the time of this writing)
- wxMac source from the wxWidgets download page (I used the older version 2.6.4 because newer versions of wxMac are not confirmed to work with Kicad)
- the XCode developers tools - available for download from Apple or on your OS X install disc
Building wxMac:
These are very rough instructions that will (hopefully) be fleshed-out later. Apologies.
- extract the wxMac source archive to its own directory (ex. `/src/wxmac/`)
- create a sub-directory for the build (`mkdir /src/wxmac/osx-build`)
- change into the build directory (`cd /src/wxmac/osx-build`)
- auto-configure the wxMac build with the appropriate options (`../configure –disable-shared –enable-monolithic –with-opengl –enable-universal_binary`)
- run the wxMac build (`make`)
Point existing system references (if any) to your new build of wxMac:
OS X from 10.4 on ships with version 2.5 of wxMac installed, but this version does not support Kicad. Before building Kicad, you will need to replace existing system references to wxMac with a reference to the instance you just built. This is a messy method and could definitely be improved, but at least it seems to work.
- check for an existing reference to the wx-config utility in your path (`ls /usr/bin/wx-config`)
- if wx-config is not already in your path, skip the next step
- move the existing wx-config out of the way (`sudo mv /usr/bin/wx-config /usr/bin/wx-config-backup`)
- and replace it with a symlink to the newly-built version (`sudo ln -s /src/wxmac/osx-build/wx-config /usr/bin/wx-config`)
Build Kicad:
- extract the Kicad source archive to its own directory (ex. `/src/kicad/`)
- change into the build directory (`cd /src/kicad`)
- open the `libs.macosx` configuration file in your favorite text editor
- change the line in `libs.macosx` which reads “UNIVERSAL=0″ to read “UNIVERSAL=1″
- change the line in `libs.macosx` which reads “DEBUG=1″ to read “DEBUG=0″
- save `libs.macosx`
- run the Kicad build (`make -f makefile.macosx`)