Building PortAudio under OS X 10.7 Lion

The current SVN snapshot can be built under Lion but it has some quirks you have to fix first:

1. Edit include/pa_mac_core.h and uncomment the #inclusion of AudioToolbox.h (around line 49).

2. Run ./configure with your options.

3. Edit the Makefile and remove ‘-wError’ from the CFLAGS line.

Now you can type make and everything should build. (Don’t forget to strip PPC code from the generated fat lib (man lipo) if you’re planning to submit to the Mac App Store!)

Disabling ARC on a per file basis

ARC is fine as long as you don’t do fancy stuff. Luckily you can disable ARC on a per file basis so that most of your code can benefit from ARC and the more complex stuff can be manually handled by you.

To disable ARC for a file (or a group) select your project in Xcode 4, go to the “build phases” tab and select the files you want to disable ARC for. Add then the -fno-objc-arc compiler flag to these files.

ARC will be now disabled for the chosen files and you can retain/(auto)release as you desire :)