summaryrefslogtreecommitdiff
path: root/inc/bootstrap.pl
blob: 2011fc7cb94d22bbe61c551c2481686873d6d315 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# bootstrap.pl
# bootstrap modules in inc/ for use during configuration with
# either Build.PL or Makefile.PL

my @exit_warn;

END {
  warn "\nThese additional prerequisites must be installed:\n  requires:\n"
    if @exit_warn;
  while( my $h = shift @exit_warn ) {
    my ($mod, $min) = @$h;
    warn "    ! $mod (we need version $min)\n";
  }
}

BEGIN {
  if ( ! eval "use Perl::OSType 1 (); 1" ) {
    print "*** BOOTSTRAPPING Perl::OSType ***\n";
    push @exit_warn, [ 'Perl::OSType', '1.00' ];
    delete $INC{'Perl/OSType.pm'};
    local @INC = @INC;
    push @INC, 'inc';
    eval "require Perl::OSType; 1"
      or die "BOOSTRAP FAIL: $@";
  }
  if ( ! eval "use version 0.87 (); 1" ) {
    print "*** BOOTSTRAPPING version ***\n";
    push @exit_warn, [ 'version', '0.87' ];
    delete $INC{'version.pm'};
    local @INC = @INC;
    push @INC, 'inc';
    eval "require MBVersion; 1"
      or die "BOOSTRAP FAIL: $@";
  }
  if ( ! eval "use Module::Metadata 1.000002 (); 1" ) {
    print "*** BOOTSTRAPPING Module::Metadata ***\n";
    push @exit_warn, [ 'Module::Metadata', '1.000002' ];
    delete $INC{'Module/Metadata.pm'};
    local @INC = @INC;
    push @INC, 'inc';
    eval "require Module::Metadata; 1"
      or die "BOOSTRAP FAIL: $@";
  }
}

1;