Changes for SmartOS 

its not quite working yet. It compiles fine now, but I get SIGSEGV in libjvm.so on execution. 

Maybe it will help as a starting point for someone.