1 package ExtUtils::CBuilder::Platform::VMS;
4 use ExtUtils::CBuilder::Base;
6 use vars qw($VERSION @ISA);
8 @ISA = qw(ExtUtils::CBuilder::Base);
10 sub need_prelink { 0 }
12 sub arg_include_dirs {
13 my ($self, @dirs) = @_;
15 # VMS can only have one include list, add the one from config.
16 if ($self->{config}{ccflags} =~ s{/inc[^=]+(?:=)+(?:\()?([^\/\)]*)} {}i) {
21 return ('/include=(' . join(',', @dirs) . ')');
25 my ($self, $type, %args) = @_;
27 my $objects = delete $args{objects};
28 $objects = [$objects] unless ref $objects;
30 # VMS has two option files, the external symbol, and to pull in PerlShr
33 $self->prelink(%args, dl_name => $args{module_name});
35 $objects->[-1] .= ',';
37 # If creating a loadable library, the link option file is needed.
38 push @$objects, 'sys$disk:[]' . $temp_files[0] . '/opt,';
40 # VMS always needs the option file for the Perl shared image.
41 push @$objects, $self->perl_inc() . 'PerlShr.Opt/opt';
44 return $self->SUPER::_do_link($type, %args, objects => $objects);
47 sub arg_nolink { return; }
50 my ($self, $file) = @_;
55 my ($self, $file) = @_;
56 return ("/exe=$file");
59 sub arg_share_object_file {
60 my ($self, $file) = @_;
61 return ("$self->{config}{lddlflags}=$file");
66 my ($self, $dl_file) = @_;
67 $dl_file =~ s/\.[^.]+$//;
69 $dl_file = $dl_file .= '.' . $self->{config}{dlext};
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);