Added initial attempt at discovering dependencies to allow us to configure build.

Change-Id: I3cc73ec765697211206a2ffb1851da754d1b79d3
Updated example.

Change-Id: Ia3f095f94e3fcf5603c5b3ff21d0e54b374fd206