From 467298a34215401cdcbb1dded51bc2aba5f1f41c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Thu, 11 Jun 2015 22:32:06 +0000 Subject: Module-Build-0.4214 --- inc/bootstrap.pl | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 inc/bootstrap.pl (limited to 'inc/bootstrap.pl') 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; + -- cgit v1.2.1