Somewhat more drastic changes for OSX cross-compiling.