root/wiki-toolkit-plugin-json/trunk/Makefile.PL

Revision 460, 0.9 KB (checked in by dom, 4 years ago)

move to subdir

Line 
1    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 = ExtUtils::MakeMaker::prompt
6        ('  Install Module::Build now from CPAN?', 'y');
7     
8      unless ($yn =~ /^y/i) {
9        warn " *** Cannot install without Module::Build.  Exiting ...\n";
10        exit 1;
11      }
12
13      require Cwd;
14      require File::Spec;
15      require CPAN;
16     
17      # Save this 'cause CPAN will chdir all over the place.
18      my $cwd = Cwd::cwd();
19      my $makefile = File::Spec->rel2abs($0);
20     
21      CPAN::Shell->install('Module::Build::Compat');
22     
23      chdir $cwd or die "Cannot chdir() back to $cwd: $!";
24      exec $^X, $makefile, @ARGV;  # Redo now that we have Module::Build
25    }
26    Module::Build::Compat->run_build_pl(args => \@ARGV);
27    Module::Build::Compat->write_makefile();
Note: See TracBrowser for help on using the browser.