3 use vars qw($bootstrapping);
6 if (grep { /^--bootstrap(?:=(.*))?$/ } @ARGV) {
8 my @args = (defined $1 ? ($1) : ());
10 $ENV{PERL_MM_USE_DEFAULT} = 1;
17 local::lib->import(@args);
19 push(@ARGV,$ENV{PERL_MM_OPT});
21 system($^X, '-MExtUtils::MakeMaker 6.31', '-e1');
24 system($^X, '-MCPAN 1.80', '-e1');
26 my $cpan_command = '';
28 system($^X, '-MCPAN', '-e',
30 unless (-w $CPAN::Config->{keep_source_where}) {
31 $ENV{PERL_MM_USE_DEFAULT} = 0;
32 my $save = $CPAN::Config->{urllist};
33 delete @{$CPAN::Config}{keys %$CPAN::Config};
34 $CPAN::Config->{urllist} = $save;
39 # XXX - remove the force on EUMM once its test suite survive PERL_MM_OPT
41 if ($eumm) { # non-zero exit
42 $cpan_command .= 'force("install","ExtUtils::MakeMaker"); ';
45 $cpan_command .= 'install("CPAN"); ';
47 if(length $cpan_command) {
48 system($^X, '-MCPAN', '-e', $cpan_command);
51 system($^X, '-MCPAN', '-e', 'CPAN::Config->load; CPAN::Config->commit;');
56 use inc::Module::Install;
59 all_from 'lib/local/lib.pm';
61 requires 'ExtUtils::MakeMaker' => '6.31'; # version INSTALL_BASE was added
62 requires 'ExtUtils::CBuilder'; # this and ParseXS are needed for MB C_support
63 requires 'ExtUtils::ParseXS';
64 requires 'Module::Build' => '0.28'; # lib -> lib/perl5 change
65 requires 'CPAN' => '1.80'; # sudo support
68 # https://rt.cpan.org/Public/Bug/Display.html?id=23735
69 # for why CPAN now sets the CPANPLUS env var.
70 # trouble is this means we can't auto_install(_now) CPAN itself
71 # without this beautiful hack
73 my $no_cpanplus_env = !exists $ENV{PERL5_CPANPLUS_IS_RUNNING};
75 delete $ENV{PERL5_CPANPLUS_IS_RUNNING} if $no_cpanplus_env;