Chris Allegretta | 874969b | 2008-08-30 20:33:32 +0000 | [diff] [blame] | 1 | #!/usr/bin/perl |
| 2 | use strict; |
| 3 | |
| 4 | sub combinations { |
| 5 | return [] unless @_; |
| 6 | my $first = shift; |
| 7 | my @rest = combinations(@_); |
| 8 | return @rest, map { [$first, @$_] } @rest; |
| 9 | } |
| 10 | |
Chris Allegretta | 82a4110 | 2014-05-29 18:30:23 +0000 | [diff] [blame] | 11 | my @allargs=("--enable-debug", "--disable-wrapping", "--disable-justify", "--disable-extra", "--enable-tiny", "--disable-utf8", "--disable-multibuffer", "--disable-nanorc", "--with-slang"); |
Chris Allegretta | 874969b | 2008-08-30 20:33:32 +0000 | [diff] [blame] | 12 | my @combos = combinations(@allargs); |
| 13 | |
| 14 | my $i = 0; |
| 15 | foreach my $name (@combos) { |
| 16 | my @args = @$name; |
| 17 | my $pct = $i / $#combos * 100; |
| 18 | printf "Trying with options: @args, %d%% done...\n", $pct; |
Chris Allegretta | ad37e67 | 2009-07-12 03:36:58 +0000 | [diff] [blame] | 19 | my $cmd = "./configure @args && make clean all"; |
| 20 | system("($cmd) >/dev/null 2>&1"); |
Chris Allegretta | 97ba02d | 2009-02-17 03:05:17 +0000 | [diff] [blame] | 21 | if ($? != 0) { |
Chris Allegretta | 874969b | 2008-08-30 20:33:32 +0000 | [diff] [blame] | 22 | print "Build failed for args: @args\n"; |
Chris Allegretta | ad37e67 | 2009-07-12 03:36:58 +0000 | [diff] [blame] | 23 | print "To reproduce, run:\n $cmd\n"; |
Chris Allegretta | 874969b | 2008-08-30 20:33:32 +0000 | [diff] [blame] | 24 | exit(1); |
| 25 | } |
| 26 | $i++; |
| 27 | } |
| 28 | |
| 29 | print "All options completed successfully!\n"; |