3 use vars qw($bootstrapping);
6 if (my ($x) = grep { /^--bootstrap(?:=.*)?$/ } @ARGV) {
7 @ARGV = grep { !/^--bootstrap(?:=.*)?$/ } @ARGV;
9 $x =~ /^--bootstrap(?:=(.*))?$/;
10 my @args = (defined $1 ? ($1) : ());
12 $ENV{PERL_MM_USE_DEFAULT} = 1;
19 local::lib->import(@args);
21 push(@ARGV,$ENV{PERL_MM_OPT});
22 push(@ARGV, map { "-I$_" } split(':',$ENV{PERL5LIB}));
24 system($^X, '-MExtUtils::MakeMaker 6.31', '-e1');
27 system($^X, '-MCPAN 1.80', '-e1');
29 my $cpan_command = '';
31 system($^X, '-MCPAN', '-e',
33 unless (-w $CPAN::Config->{keep_source_where}) {
34 my $save = $CPAN::Config->{urllist};
35 delete @{$CPAN::Config}{keys %$CPAN::Config};
36 $CPAN::Config->{urllist} = $save;
37 my $orig = ExtUtils::MakeMaker->can("prompt");
39 *ExtUtils::MakeMaker::prompt = sub {
40 if (!$done && $_[0] =~ /manual configuration/) {
50 # XXX - remove the force on EUMM once its test suite survive PERL_MM_OPT
52 if ($eumm) { # non-zero exit
53 $cpan_command .= 'force("install","ExtUtils::MakeMaker"); ';
56 $cpan_command .= 'force("install","CPAN"); ';
58 if(length $cpan_command) {
59 system($^X, '-MCPAN', '-e', $cpan_command);
62 system($^X, '-MCPAN', '-e', 'CPAN::Config->load; CPAN::Config->commit;');
67 use inc::Module::Install;
70 all_from 'lib/local/lib.pm';
72 requires 'ExtUtils::MakeMaker' => '6.31'; # version INSTALL_BASE was added
73 requires 'ExtUtils::CBuilder'; # this and ParseXS are needed for MB C_support
74 requires 'ExtUtils::ParseXS';
75 requires 'Module::Build' => '0.28'; # lib -> lib/perl5 change
76 requires 'CPAN' => '1.80'; # sudo support
79 # https://rt.cpan.org/Public/Bug/Display.html?id=23735
80 # for why CPAN now sets the CPANPLUS env var.
81 # trouble is this means we can't auto_install(_now) CPAN itself
82 # without this beautiful hack
84 my $no_cpanplus_env = !exists $ENV{PERL5_CPANPLUS_IS_RUNNING};
86 delete $ENV{PERL5_CPANPLUS_IS_RUNNING} if $no_cpanplus_env;