Upgrade to Module::Build 0.2806
[p5sagit/p5-mst-13.2.git] / lib / Module / Build / Compat.pm
index 25ce823..aea1960 100644 (file)
@@ -15,7 +15,7 @@ my %makefile_to_build =
   (
    TEST_VERBOSE => 'verbose',
    VERBINST     => 'verbose',
-   INC     => sub { map {('--extra_compiler_flags', "-I$_")} Module::Build->split_like_shell(shift) },
+   INC     => sub { map {('--extra_compiler_flags', $_)} Module::Build->split_like_shell(shift) },
    POLLUTE => sub { ('--extra_compiler_flags', '-DPERL_POLLUTE') },
    INSTALLDIRS => sub {local $_ = shift; 'installdirs=' . (/^perl$/ ? 'core' : $_) },
    LIB => sub { ('--install_path', 'lib='.shift()) },
@@ -42,24 +42,25 @@ sub create_makefile_pl {
 
   print {$fh} "# Note: this file was auto-generated by ", __PACKAGE__, " version $VERSION\n";
 
-  # If a custom subclass is being used, make sure we add its directory to @INC
+  # If a *bundled* custom subclass is being used, make sure we add its
+  # directory to @INC.
   my $subclass_load = '';
   if (ref($build) ne "Module::Build") {
     my $subclass_dir = $package->subclass_dir($build);
-    
+
     if (File::Spec->file_name_is_absolute($subclass_dir)) {
       my $base_dir = $build->base_dir;
 
       if ($build->dir_contains($base_dir, $subclass_dir)) {
        $subclass_dir = File::Spec->abs2rel($subclass_dir, $base_dir);
-      } else {
-       $build->log_warn("Warning: builder subclass " . ref($build) . 
-                        " doesn't seem to have been loaded from within $base_dir");
+        $subclass_load = "use lib '$subclass_dir';";
       }
+
+    } else {
+      $subclass_load = "use lib '$subclass_dir';";
     }
-    $subclass_load = "use lib '$subclass_dir';";
   }
-  
+
   if ($type eq 'small') {
     printf {$fh} <<'EOF', $subclass_load, ref($build), ref($build);
     use Module::Build::Compat 0.02;
@@ -90,8 +91,9 @@ EOF
       # Save this 'cause CPAN will chdir all over the place.
       my $cwd = Cwd::cwd();
       
-      # There seems to be no way to determine if this install was successful
       CPAN::Shell->install('Module::Build::Compat');
+      CPAN::Shell->expand("Module", "Module::Build::Compat")->uptodate
+       or die "Couldn't install Module::Build, giving up.\n";
       
       chdir $cwd or die "Cannot chdir() back to $cwd: $!";
     }
@@ -432,12 +434,12 @@ versions of tools like CPAN and CPANPLUS.
 
 =head1 AUTHOR
 
-Ken Williams <ken@cpan.org>
+Ken Williams <kwilliams@cpan.org>
 
 
 =head1 COPYRIGHT
 
-Copyright (c) 2001-2005 Ken Williams.  All rights reserved.
+Copyright (c) 2001-2006 Ken Williams.  All rights reserved.
 
 This library is free software; you can redistribute it and/or
 modify it under the same terms as Perl itself.
@@ -445,7 +447,7 @@ modify it under the same terms as Perl itself.
 
 =head1 SEE ALSO
 
-Module::Build(3), ExtUtils::MakeMaker(3)
+L<Module::Build>(3), L<ExtUtils::MakeMaker>(3)
 
 
 =cut