Some changes to allow for builds on Mac OS X with X11.