Scons newer version have depricated things and those will be removed in future

This set of patches updates Scons scripts to support newer version of scons and also adds more flags to C++ build.