Fix build on OSX, which doesn't allow linking shared modules.