Mac OS 10.6 (Snow Leopard)
These instructions cover building Freeems on Snow Leopard. I don’t have a machine running original Leopard right now, so 10.6 is all you’re going to get. In theory, this should all work on 10.5, but YMMV.
Download and install Xcode
http://developer.apple.com/technologies/xcode.html
You’ll have to register for Apple developer network. Note that you need the newest Xcode they have available. The version on your CD probably has an outdated/screwed up autoconf.
Download and install fink
http://www.finkproject.org/download/srcdist.php
You’ll have to do a source install, since they don’t yet have a package for 10.6
During the fink install it will ask you about unstable, you need to answer YES.
If you miss this or forget to do it, you’ll have to run
fink configure and enable it.
and then "you'll need to run a 'fink selfupdate' to pull in the packages, otherwise it will complain that the package doesn't exist" - Thanks
Once fink is installed and you have the unstable repo enabled, run the selfupdate like they request.
Also, don’t forget to add the fink init to your ~/.profile. They have instructions for this on the site and it reminds you after installing, but let this be an additional reminder.
Now, open a terminal and type
fink install m681x-binutils
It will run for a few minutes and throw an error about stat64.
(Note: You have to let it try the first time so that it will download everything so we can make the edits. I emailed the author of the package about fixing the snow leopard issues, but have not heard back from him yet, so this is currently the only way to do it.)
Now, you have to edit the fink info file for m681x-binutils.
Open a terminal and type:
(You could also use Textedit, but you’d have to run it from the prompt anyway so you can run it as root)
/sw/fink/10.4/unstable/main/finkinfo/devel
sudo vi m681x-binutils.info
Unless you’ve installed another console text editor, you’ll have to make the changes with vi. Here’s quick guide for the uninitiated:
http://www.cs.colostate.edu/helpdocs/vi.html
Edit the ../configure line and add –disable-werror before –target
Now, you can run
fink install m681x-binutils
again to download and build the binutils.
Wait about 5 minutes or so for binutils to do it’s business. Once it’s done, you can go ahead and install the rest of the toolchain:
fink install m681x-gcc m681x-newlib m681x-gdb
Congratulations, you now have a functioning toolchain.
Building freeems
Download the newest freeems source distribution from
http://sourceforge.net/project/showfile ... _id=258422
Fire up terminal and cd to the directory where you downloaded the source file.
Extract it using tar, replace the filename with the exact name of your version:
tar xfvpj freeems-0.0.19-Doxygenated.tar.bz2
Once it’s extracted, cd into src inside the extracted directory
cd fredcooke-freeems-vanilla-f68b80facf5427b0b7e75ca953f9b0ac1c76869b/src
Now, back to vi for a minute to edit the Makefile
vi Makefile
Type:
/--print-gc and press
Enter
Vi will find the line that we need to edit. Change the LINKOPTSGC from this:
LINKOPTSGC = -Wl,--gc-sections,--print-gc-sections,-defsym,vectors_addr=0xF710,-m,m68hc12elfb,-T,hc9s12xdp512elfb.x
To this:
LINKOPTSGC = -Wl,--gc-sections,-defsym,vectors_addr=0xF710,-m,m68hc12elfb,-T,hc9s12xdp512elfb.x
Removing the –print-gc-sections and the comma following it.
Save the file and quit vi
Cross your figners and type “
makeâ€
You should be met with a smiling happy face and a “Thanks for building FreeEMSâ€