build: extend documentation building mechanism

Allow to select specific documentation components, and reliably check for
component dependencies.

In particular, check for perl presence on the system.
