Add shared library support for dmd