The attached patch gets Module::Build working on VMS. Its dead simple and resolves three issues:
- You can't safely put switches after $Config{startperl} - The comfortable VMS equivalent to ./Build is @Build which means Build.PL should generate Build.com - VMS likes to drop cases unless specially quoted. "@Build test" will pass "TEST" rather than "test". So we make argv->action translation case-insensitive as opposed to requiring special command line quoting. And that's it. All tests pass. One fix, two overrides. After a hard week of fighting with MakeMaker its always a pleasure to glide through Module::Build. I encourage vmsperl module authors to RUN, do not walk, to their editors and convert their modules from MakeMaker to Module::Build. -- And if you don't know Which To Do Of all the things in front of you, Then what you'll have when you are through Is just a mess without a clue. Of all the best that can come true If you know What and Which and Who.
diff -ru Module-Build-0.17/lib/Module/Build/Base.pm Module-Build-0.17.vms/lib/Module/Build/Base.pm --- Module-Build-0.17/lib/Module/Build/Base.pm 2003-03-29 13:30:05.000000000 -0800 +++ Module-Build-0.17.vms/lib/Module/Build/Base.pm 2003-03-29 19:18:08.000000000 -0800 @@ -479,7 +479,9 @@ my $quoted_INC = join ', ', map "'$_'", @myINC; print $fh <<EOF; -$self->{config}{startperl} -w +$self->{config}{startperl} + +BEGIN { \$^W = 1 } BEGIN { chdir('$base_dir') or die 'Cannot chdir to $base_dir: '.\$!; diff -ru Module-Build-0.17/lib/Module/Build/Platform/VMS.pm Module-Build-0.17.vms/lib/Module/Build/Platform/VMS.pm --- Module-Build-0.17/lib/Module/Build/Platform/VMS.pm 2001-11-11 12:50:32.000000000 -0800 +++ Module-Build-0.17.vms/lib/Module/Build/Platform/VMS.pm 2003-03-29 19:19:54.000000000 -0800 @@ -7,10 +7,6 @@ @ISA = qw(Module::Build::Base); -1; -__END__ - - =head1 NAME Module::Build::Platform::VMS - Builder class for VMS platforms @@ -20,9 +16,48 @@ The sole purpose of this module is to inherit from C<Module::Build::Base>. Please see the L<Module::Build> for the docs. +=head2 Methods + +=over 4 + +=item new + +Change $self->{build_script} to 'Build.com' so @Build works. + +=cut + +sub new { + my $class = shift; + my $self = $class->SUPER::new(@_); + + $self->{properties}{build_script} = 'Build.com'; + + return $self; +} + + +=item cull_args + +'@Build foo' on VMS will not preserve the case of 'foo'. Rather than forcing +people to write '@Build "foo"' we'll dispatch case-insensitively. + +=cut + +sub cull_args { + my $self = shift; + my($action, $args) = $self->SUPER::cull_args(@_); + my @possible_actions = grep { lc $_ eq lc $action } $self->known_actions; + + die "Ambiguous action '$action'. Could be one of @possible_actions" + if @possible_actions > 1; + + return ($possible_actions[0], $args); +} + + =head1 AUTHOR -Ken Williams, [EMAIL PROTECTED] +Michael G Schwern <[EMAIL PROTECTED]> =head1 SEE ALSO