ported build system from cppkit.