Improve dependencies.
Merge pull request #2495 from waywardmonkeys/improve-scons-dependencies

Improve dependencies.