Only export symbols from public API when building a shared library

Title says all :-)