1 |
dpavlin |
95 |
unless ( eval "use Module::Build::Compat 0.02; 1" ) { |
2 |
|
|
print "This module requires Module::Build to install itself.\n"; |
3 |
|
|
|
4 |
|
|
require ExtUtils::MakeMaker; |
5 |
|
|
my $yn = |
6 |
|
|
ExtUtils::MakeMaker::prompt( ' Install Module::Build now from CPAN?', 'y' ); |
7 |
|
|
|
8 |
|
|
unless ( $yn =~ /^y/i ) { |
9 |
|
|
die " *** Cannot install without Module::Build. Exiting ...\n"; |
10 |
|
|
} |
11 |
|
|
|
12 |
|
|
require Cwd; |
13 |
|
|
require File::Spec; |
14 |
|
|
require CPAN; |
15 |
|
|
|
16 |
|
|
# Save this 'cause CPAN will chdir all over the place. |
17 |
|
|
my $cwd = Cwd::cwd(); |
18 |
|
|
my $makefile = File::Spec->rel2abs($0); |
19 |
|
|
|
20 |
|
|
CPAN::Shell->install('Module::Build::Compat') |
21 |
|
|
or die " *** Cannot install without Module::Build. Exiting ...\n"; |
22 |
|
|
|
23 |
|
|
chdir $cwd or die "Cannot chdir() back to $cwd: $!"; |
24 |
|
|
} |
25 |
|
|
eval "use Module::Build::Compat 0.02; 1" or die $@; |
26 |
|
|
use lib '_build/lib'; |
27 |
|
|
Module::Build::Compat->run_build_pl( args => \@ARGV ); |
28 |
|
|
require Module::Build; |
29 |
|
|
Module::Build::Compat->write_makefile( build_class => 'Module::Build' ); |