blob: 9c121ccd19b88b1c5492fcdc5a5b5bbec1b7244b [file] [log] [blame]
Chris Allegretta874969b2008-08-30 20:33:32 +00001#!/usr/bin/perl
2use strict;
3
4sub combinations {
5 return [] unless @_;
6 my $first = shift;
7 my @rest = combinations(@_);
8 return @rest, map { [$first, @$_] } @rest;
9}
10
Chris Allegretta82a41102014-05-29 18:30:23 +000011my @allargs=("--enable-debug", "--disable-wrapping", "--disable-justify", "--disable-extra", "--enable-tiny", "--disable-utf8", "--disable-multibuffer", "--disable-nanorc", "--with-slang");
Chris Allegretta874969b2008-08-30 20:33:32 +000012my @combos = combinations(@allargs);
13
14my $i = 0;
15foreach my $name (@combos) {
16 my @args = @$name;
17 my $pct = $i / $#combos * 100;
18 printf "Trying with options: @args, %d%% done...\n", $pct;
Chris Allegrettaad37e672009-07-12 03:36:58 +000019 my $cmd = "./configure @args && make clean all";
20 system("($cmd) >/dev/null 2>&1");
Chris Allegretta97ba02d2009-02-17 03:05:17 +000021 if ($? != 0) {
Chris Allegretta874969b2008-08-30 20:33:32 +000022 print "Build failed for args: @args\n";
Chris Allegrettaad37e672009-07-12 03:36:58 +000023 print "To reproduce, run:\n $cmd\n";
Chris Allegretta874969b2008-08-30 20:33:32 +000024 exit(1);
25 }
26 $i++;
27}
28
29print "All options completed successfully!\n";