Shared library & SONAME support

Courtesy of GreatEmerald!