Make gtk-doc easier to use from build systems other than automake
Submitted by Jussi Pakkanen
Currently gtk-doc seems to share some functionality between core gtk-doc binaries and the automake module snippet that drives it. Tracing what commands Make invokes reveals stuff like copying files between source and build trees, copying version.entities to html dirs and so on.
Trying to replicate what it does is difficult, especially since sometimes you need to copy xml and definition files from the source tree to build tree, because gtkdoc seems to do different things based on where said files reside. (Sometimes it does not read them from source tree but does from the build tree.) Some commands also seem to have a requirement that they are executed in a specific directory.
It would make things easier if this complexity could be pushed into gtk-doc binaries so it is there only once and all build systems can just invoke it.
As an example, suppose the project root is at /proj, the header files to scan are in /proj/src, documentation files (proj-docs.sgml and the like) are in /proj/doc and the build tree is at /proj/build.
To generate docs, one should be able to run just one command like this (note that cwd can be anything). I'm using absolute paths, but relative ones should work just the same.
gtkdocv2 --docdir=/proj/doc --outdir=/proj/build/doc --scandir=/proj/src --output-format=html --main-file=proj-docs.sgml [other conf flags here]
The main program should then take care of calling all the subcommands in the proper way.