[static] rework qt4 building to work correctly with static build.