1 unless (eval "use Module::Build::Compat 0.02; 1" ) {
2 print "This module requires Module::Build to install itself.\n";
4 require ExtUtils::MakeMaker;
5 my $yn = ExtUtils::MakeMaker::prompt
6 (' Install Module::Build from CPAN?', 'y');
13 # Save this 'cause CPAN will chdir all over the place.
15 my $makefile = File::Spec->rel2abs($0);
17 CPAN::Shell->install('Module::Build::Compat');
19 chdir $cwd or die "Cannot chdir() back to $cwd: $!";
20 exec $^X, $makefile, @ARGV; # Redo now that we have Module::Build
22 warn " *** Cannot install without Module::Build. Exiting ...\n";
26 Module::Build::Compat->run_build_pl(args => \@ARGV);
27 Module::Build::Compat->write_makefile();