I am attempting to replace a home-grown build system with boost.build. I have just a couple days of experience with boost.build, so I am very new.

One of the features of the previous system was that it would auto-select the version of gcc to use on a machine by using the first version that showed up on a list. (Most of the build machines have mutliple versions of gcc installed.) So, the build system would have a list such as:

gcc-4.3
gcc-4.1
gcc-3.4

The build system would first attempt to use gcc-4.3, if it was not available on the machine, it would try 4.1, etc... I would like to get similar functionality from boost.build. My naive approach was to create a site-config.jam file with something along the lines of:

using gcc : 4.3 : gcc-4.3 ;
using gcc : 4.2 : gcc-4.2 ;
using gcc : 4.1 : gcc-4.1 ;

This seemed to result in the system trying to build the project 3 times, once for each gcc version. Also, the 'list' of gcc versions needs to be specified on a per-project basis. I.e. for some projects, gcc-3.x is the 'best' compiler, because gcc 4.x will not work.

So in summary: Is there a way to specify something along the lines of:

if gcc-4.3 exists, use it
else if gcc-4.2 exists, use it,
else if gcc-4.1 exists, use it, etc.....