Added ability to compile both static and dym lib.