Support for d_libname_unique ported from blead