Added possibility to build as static

Not full support. Works fine when use system libs only!
Merge remote-tracking branch 'upstream/light_version' into light_version