When I tried to use config-list.mk, the build for every triple except
the build machine's failed for m2. This is because, unlike other
languages, m2 builds target objects during all-gcc. The build will
therefore fail unless you have access to an appropriate binutils
(or an equivalent). That's quite a big ask for over 100 targets. :)
This patch therefore makes m2 an optional inclusion.
Doing that wasn't entirely straightforward though. The current
configure line includes "--enable-languages=all,...", which means
that the "..." can only force languages to be added that otherwise
wouldn't have been. (I.e. the only effect of the "..." is to
override configure autodetection.)
The choice of all,ada and:
# Make sure you have a recent enough gcc (with ada support) in your path so
# that --enable-werror-always will work.
make it clear that lack of GNAT should be a build failure rather than
silently ignored. This predates the D frontend, which requires GDC
in the same way that Ada requires GNAT. I don't know of a reason
why D should be treated differently.
The patch therefore expands the "all" into a specific list of
languages.
That in turn meant that Fortran had to be handled specially,
since bpf and mmix don't support Fortran.
Perhaps there's an argument that m2 shouldn't build target objects
during all-gcc, but (a) it works for practical usage and (b) the
patch is an easy workaround. I'd be happy for the patch to be
reverted if the build system changes.
contrib/
* config-list.mk (OPT_IN_LANGUAGES): New variable.
($(LIST)): Replace --enable-languages=all with a specifc list.
Disable fortran on bpf and mmix. Enable the languages in
OPT_IN_LANGUAGES.