Stab at Linux compatibility

Haven't properly set up my editor on Linux yet, so this is my attempt at
copying all the checks that were needed to build on Linux. (Obviously
missing a fair bit of functionality!)