fix osmesa build on Mac OS X
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
Attached are changes that allow a build on Mac OS X using mesa, osmesa (turn Carbon off). These changes should be cleaned up or corrected before committing.