4
4
unless (eval "use Module::Build::Compat 0.02; 1" ) {
5
5
print "This module requires Module::Build to install itself.\n";
7
7
require ExtUtils::MakeMaker;
8
8
my $yn = ExtUtils::MakeMaker::prompt
9
9
(' Install Module::Build now from CPAN?', 'y');
12
12
die " *** Cannot install without Module::Build. Exiting ...\n";
19
19
# Save this 'cause CPAN will chdir all over the place.
22
22
CPAN::Shell->install('Module::Build::Compat');
23
23
CPAN::Shell->expand("Module", "Module::Build::Compat")->uptodate
24
24
or die "Couldn't install Module::Build, giving up.\n";
26
26
chdir $cwd or die "Cannot chdir() back to $cwd: $!";
28
28
eval "use Module::Build::Compat 0.02; 1" or die $@;
30
30
Module::Build::Compat->run_build_pl(args => \@ARGV);
32
35
Module::Build::Compat->write_makefile(build_class => 'Module::Build');