update to support static/dynamic libarary