+ set_parallel($max_parallel);
+}
+
+sub set_parallel {
+ my $max=shift;
+
+ $opt_parallel=1;
+
+ if (exists $ENV{DEB_BUILD_OPTIONS}) {
+ # Get number of processes from parallel=n tag limiting it
+ # with $max if needed
+ foreach my $opt (split(/\s+/, $ENV{DEB_BUILD_OPTIONS})) {
+ if ($opt =~ /^parallel=(-?\d+)$/) {
+ $opt_parallel = $1;
+ if ($max > 0 && $opt_parallel > $max) {
+ $opt_parallel = $max;
+ }
+ }
+ }
+ }
+}
+
+sub buildsystems_list {
+ my $step=shift;
+
+ my @buildsystems = load_all_buildsystems();
+ my $auto = autoselect_buildsystem($step, grep { ! $_->{thirdparty} } @buildsystems);
+ my $specified;
+
+ # List build systems (including auto and specified status)
+ foreach my $inst (@buildsystems) {
+ if (! defined $specified && defined $opt_buildsys && $opt_buildsys eq $inst->NAME()) {
+ $specified = $inst;
+ }
+ printf("%-20s %s", $inst->NAME(), $inst->DESCRIPTION());
+ print " [3rd party]" if $inst->{thirdparty};
+ print "\n";
+ }
+ print "\n";
+ print "Auto-selected: ", $auto->NAME(), "\n" if defined $auto;
+ print "Specified: ", $specified->NAME(), "\n" if defined $specified;
+ print "No system auto-selected or specified\n"
+ if ! defined $auto && ! defined $specified;