Add Darwin support.
Fixup dynamic library on Darwin.