Move Module::Pluggable into ext/ as the next version has actions in its
[p5sagit/p5-mst-13.2.git] / lib / Module / Build / Compat.pm
index aea1960..d1bc725 100644 (file)
@@ -2,7 +2,7 @@ package Module::Build::Compat;
 
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.03';
+$VERSION = '0.2808_01';
 
 use File::Spec;
 use IO::File;
@@ -42,6 +42,13 @@ sub create_makefile_pl {
 
   print {$fh} "# Note: this file was auto-generated by ", __PACKAGE__, " version $VERSION\n";
 
+  # Minimum perl version should be specified as "require 5.XXXXXX" in 
+  # Makefile.PL
+  my $requires = $build->requires;
+  if ( my $minimum_perl = $requires->{perl} ) {
+    print {$fh} "require $minimum_perl;\n";
+  }
+
   # If a *bundled* custom subclass is being used, make sure we add its
   # directory to @INC.
   my $subclass_load = '';
@@ -206,11 +213,11 @@ sub fake_makefile {
     warn "Unknown 'build_class', defaulting to 'Module::Build'\n";
     $args{build_class} = 'Module::Build';
   }
+  my $class = $args{build_class};
 
-  my $perl = $args{build_class}->find_perl_interpreter;
-  my $os_type = $args{build_class}->os_type;
-  my $noop = ($os_type eq 'Windows' ? 'rem>nul' :
-             $os_type eq 'VMS'     ? 'Continue' :
+  my $perl = $class->find_perl_interpreter;
+  my $noop = ($class->is_windowsish ? 'rem>nul'  :
+             $class->is_vmsish     ? 'Continue' :
              'true');
   my $Build = 'Build --makefile_env_macros 1';
 
@@ -226,7 +233,7 @@ force_do_it :
        @ $noop
 EOF
 
-  foreach my $action ($args{build_class}->known_actions) {
+  foreach my $action ($class->known_actions) {
     next if $action =~ /^(all|realclean|force_do_it)$/;  # Don't double-define
     $maketext .= <<"EOF";
 $action : force_do_it