Install POD files into "lib\pods" rather than "lib\pod" on Win32
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / CBuilder / Platform / VMS.pm
1 package ExtUtils::CBuilder::Platform::VMS;
2
3 use strict;
4 use ExtUtils::CBuilder::Base;
5
6 use vars qw($VERSION @ISA);
7 $VERSION = '0.12';
8 @ISA = qw(ExtUtils::CBuilder::Base);
9
10 sub need_prelink { 0 }
11
12 sub arg_include_dirs {
13   my ($self, @dirs) = @_;
14
15   # VMS can only have one include list, add the one from config.
16   if ($self->{config}{ccflags} =~ s{/inc[^=]+(?:=)+(?:\()?([^\/\)]*)} {}i) {
17     unshift @dirs, $1;
18   }
19   return unless @dirs;
20
21   return ('/include=(' . join(',', @dirs) . ')');
22 }
23
24 sub _do_link {
25   my ($self, $type, %args) = @_;
26   
27   my $objects = delete $args{objects};
28   $objects = [$objects] unless ref $objects;
29   
30   # VMS has two option files, the external symbol, and to pull in PerlShr
31   if ($args{lddl}) {
32     my @temp_files =
33       $self->prelink(%args, dl_name => $args{module_name});
34
35     $objects->[-1] .= ',';
36
37     # If creating a loadable library, the link option file is needed.
38     push @$objects, 'sys$disk:[]' . $temp_files[0] . '/opt,';
39
40     # VMS always needs the option file for the Perl shared image.
41     push @$objects, $self->perl_inc() . 'PerlShr.Opt/opt';
42   }
43
44   return $self->SUPER::_do_link($type, %args, objects => $objects);
45 }
46
47 sub arg_nolink { return; }
48
49 sub arg_object_file {
50   my ($self, $file) = @_;
51   return "/obj=$file";
52 }
53
54 sub arg_exec_file {
55   my ($self, $file) = @_;
56   return ("/exe=$file");
57 }
58
59 sub arg_share_object_file {
60   my ($self, $file) = @_;
61   return ("$self->{config}{lddlflags}=$file");
62 }
63
64
65 sub lib_file {
66   my ($self, $dl_file) = @_;
67   $dl_file =~ s/\.[^.]+$//;
68   $dl_file =~ tr/"//d;
69   $dl_file = $dl_file .= '.' . $self->{config}{dlext};
70
71   # Need to create with the same name as DynaLoader will load with.
72   if (defined &DynaLoader::mod2fname) {
73     my ($dev,$dir,$file) = File::Spec->splitpath($dl_file);
74     $file = DynaLoader::mod2fname([$file]);
75     $dl_file = File::Spec->catpath($dev,$dir,$file);
76   }
77   return $dl_file;
78 }
79
80 1;