use strict;
use vars qw($VERSION);
-$VERSION = '0.03';
+$VERSION = '0.2808_01';
use File::Spec;
use IO::File;
(
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()) },
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
+ # 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 = '';
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;
# 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: $!";
}
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';
@ $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
=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.
=head1 SEE ALSO
-Module::Build(3), ExtUtils::MakeMaker(3)
+L<Module::Build>(3), L<ExtUtils::MakeMaker>(3)
=cut