Add flavor support, support for shared library and various improvements to the port itself. Co-authored by Michael Osipov (maintainer) PR: 270989 Reviewed by: Michael Osipov (maintainer)