2.4.2 Building SDCC on Mac OS X

Next: 2.4.3 Cross compiling SDCC Up: 2.4 Building SDCC Previous: 2.4.1 Building SDCC on Contents Index

## 2.4.2 Building SDCC on Mac OS X

Follow the instruction for Linux.
On Mac OS X 10.2.x it was reported, that the default gcc (version 3.1 20020420 (prerelease)) fails to compile SDCC. Fortunately there's also gcc 2.9.x installed, which works fine. This compiler can be selected by running 'configure' with:

  ./configure CC=gcc2 CXX=g++2

Universal (ppc and i386) binaries can be produced on Mac OS X 10.4.x with Xcode. Run 'configure' with:

  ./configure \

  LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" \

  CXXFLAGS = "-O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" \

  CFLAGS = "-O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"