Better platform detection in Rake compile and build tasks.