autotools: refactor argument handling

Split out a tiny bit of common code used in collecting and expanding
autogenargs, makeargs and makeinstallargs.

There is a strict refactoring -- no functionality changes here.

The 'common code' will grow with the next commit, increasing the benefit
of having it factored out.

https://bugzilla.gnome.org/show_bug.cgi?id=720839
autotools: collect args from elements as well

The autotools modtype has support for specifying autogenargs, makeargs
and makeinstallargs as attributes on the <autotools/> tag.

Add support for specifying additional arguments via the elements
<autogenargs/>, <makeargs/> and <makeinstallargs/>.  The additional
arguments are concatenated to the list.

This is intended to be used with <conditional> to provide a way to
customise the arguments based on the condition set.

https://bugzilla.gnome.org/show_bug.cgi?id=720839
add 'conditions' to the config file

This is a set() that holds the condition flags for this run.

It is pre-seeded with some flags according to what platform you're
running on (by way of inspecting sys.platform)

It is intended that people should update the conditions in their
jhbuildrc files like so:

  conditions.add('condition')

or

  conditions.discard('condition')

But they can also be replaced outright, as long as it remains a set.

Future commits will introduce behaviour that depends on this setting.

https://bugzilla.gnome.org/show_bug.cgi?id=720839
Add --conditions= commandline argument

This can be used like --conditions=+doc,-wayland in order to modify the
condition set from the commandline.

The user's jhbuildrc is capable of inspecting conditions set from the
commandline by way of checking

    if 'flag' in conditions:
        ...

but the arguments on the commandline always override what is written in
jhbuildrc.  This is done by applying the modifiers twice -- once before
parsing the config and then again, after.

https://bugzilla.gnome.org/show_bug.cgi?id=720839
Handle <if> tags in moduleset files

If we encounter an <if> tag, consult the conditions set in the config
in order to decide if we should include its content or not.  If the
condition is met, the child elements are added to the parent of the
<if/> tag as if the condition tag were not there at all.  If the
condition is not met, the entire content is simply dropped.

We do the processing as a transformation on the DOM as a whole,
immediately after parsing the moduleset XML, before doing any additional
processing.  This allows <if> to be used for anything and it means we
don't need to deal with it separately from each place.

Although the tool itself will accept <if> anywhere we use the schemas to
restrict its use to the purposes of conditionalising dependencies
(including suggests) and {autogen,make,makeinstall}args.

https://bugzilla.gnome.org/show_bug.cgi?id=720839
Document the addition of conditions

Document the changes to the moduleset format, the commandline arguments
and jhbuildrc.