diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-06-11 22:32:06 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-06-11 22:32:06 +0000 |
commit | 467298a34215401cdcbb1dded51bc2aba5f1f41c (patch) | |
tree | 1923f32fbc9cf8f0b4ab291d1eb9fad5ab872d68 /inc/bootstrap.pl | |
download | Module-Build-tarball-master.tar.gz |
Module-Build-0.4214HEADModule-Build-0.4214master
Diffstat (limited to 'inc/bootstrap.pl')
-rw-r--r-- | inc/bootstrap.pl | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/inc/bootstrap.pl b/inc/bootstrap.pl new file mode 100644 index 0000000..2011fc7 --- /dev/null +++ b/inc/bootstrap.pl @@ -0,0 +1,47 @@ +# bootstrap.pl +# bootstrap modules in inc/ for use during configuration with +# either Build.PL or Makefile.PL + +my @exit_warn; + +END { + warn "\nThese additional prerequisites must be installed:\n requires:\n" + if @exit_warn; + while( my $h = shift @exit_warn ) { + my ($mod, $min) = @$h; + warn " ! $mod (we need version $min)\n"; + } +} + +BEGIN { + if ( ! eval "use Perl::OSType 1 (); 1" ) { + print "*** BOOTSTRAPPING Perl::OSType ***\n"; + push @exit_warn, [ 'Perl::OSType', '1.00' ]; + delete $INC{'Perl/OSType.pm'}; + local @INC = @INC; + push @INC, 'inc'; + eval "require Perl::OSType; 1" + or die "BOOSTRAP FAIL: $@"; + } + if ( ! eval "use version 0.87 (); 1" ) { + print "*** BOOTSTRAPPING version ***\n"; + push @exit_warn, [ 'version', '0.87' ]; + delete $INC{'version.pm'}; + local @INC = @INC; + push @INC, 'inc'; + eval "require MBVersion; 1" + or die "BOOSTRAP FAIL: $@"; + } + if ( ! eval "use Module::Metadata 1.000002 (); 1" ) { + print "*** BOOTSTRAPPING Module::Metadata ***\n"; + push @exit_warn, [ 'Module::Metadata', '1.000002' ]; + delete $INC{'Module/Metadata.pm'}; + local @INC = @INC; + push @INC, 'inc'; + eval "require Module::Metadata; 1" + or die "BOOSTRAP FAIL: $@"; + } +} + +1; + |