Various fixes. Tested with OpenSuse 12.3 (amd64).

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@57033 954f8c5b-7b00-dc11-b283-0030488c597c