This is a two pronged commit. Firstly we need to handle older versions
of git which lack support for recursively updating git submodules. In
order to handle this we try three separate git commands until one
succeeds and print warning/error messages as appropriate.
Secondly we should really update git submodules when 'make' is invoked.
Currently we only do this from the root makefile, though if we care enough
we can do it elsewhere in our build tree too. This means we no longer have
to run configure every time a submodule is updated just to get git submodule
update to execute.
Further discussion suggested that, even if mdoc 2.0 works, it hasn't gotten
widespread testing (as it's been a 4.0 app for months), so it would be
preferable to keep it as a 4.0 app.
However, it still needs to be built under 2.0 so that a --with-profile4=no
build can...build...without errors.
Thus, the compromise: build mdoc twice, once for each profile. This will
ensure that *some* version of mdoc is around when mcs/docs is built.
Unfortunately we can't place mdoc into $(per_profile_dirs), as these are
built before $(net_2_0_dirs) (and thus before monodoc, which needs to be
built before mdoc). Thus the compromise of listing mdoc in *both*
$(net_2_0_dirs) and $(net_4_0_dirs), allowing build dependencies to be met.
Further discussion suggested that, even if mdoc 2.0 works, it hasn't gotten
widespread testing (as it's been a 4.0 app for months), so it would be
preferable to keep it as a 4.0 app.
However, it still needs to be built under 2.0 so that a --with-profile4=no
build can...build...without errors.
Thus, the compromise: build mdoc twice, once for each profile. This will
ensure that *some* version of mdoc is around when mcs/docs is built.
The problem is build sanity: it's possible to disable the 4.0 profile
(--with-profile4=no) while not disabling documentation building
(--with-mcs-docs=yes is the default). The result would be a 4.0-less
build, and thus no mdoc, and thus no mdoc to assemble the documentation,
and thus a build break as we attempted to use an app during the build
which didn't exist.
Oops.
mdoc doesn't need to be a 4.0 app anyway...