Some ugly split for shared/static builds.