This article relates to compilation on the latest Fedora (21) but can also apply to other Distros…
The Distro-supplied version of Audacity is typically functionality-challenged, and does not allow working with some of the more up-to-date audio formats, due to US Patent law concerns..
The necessary functionality can be achieved by compiling it yourself, and this is where the fun starts, as (in)compatibility issues with various versions of ffmpeg arise..
With version 2.0.5, these could be relatively easily fixed by referencing the headers in ffmpeg-compat, but the latest released version (2.0.6) fails with this, as well as with the latest distro-supplied version of ffmpeg..
One workaround mentioned is to configure with
--disable-dynamic-loading, but this tends to restrict certain functionality as well..
I finally found an effective patch for Audacity, in the following Forum thread: http://forum.audacityteam.org/viewtopic.php?f=19&t=82134
The patch file attachment can be found if you scroll down (FFmpeg.patch) and thanks are due to Hains for producing this..
After this patch is applied, Audacity 2.0.6 compiled cleanly on my system with ffmpeg 2.4.5, and now accepts m4a and other formats..
Robert Gadsdon. December 24, 2014.