diff options
Diffstat (limited to 'lib/ExtUtils')
-rw-r--r-- | lib/ExtUtils/MakeMaker.pm | 16 | ||||
-rwxr-xr-x | lib/ExtUtils/xsubpp | 27 |
2 files changed, 30 insertions, 13 deletions
diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm index f619108341..e09b438e75 100644 --- a/lib/ExtUtils/MakeMaker.pm +++ b/lib/ExtUtils/MakeMaker.pm @@ -304,7 +304,10 @@ sub check_hints { $hint=(reverse sort @goodhints)[0]; # execute the hintsfile: - eval `cat hints/$hint.pl`; + open HINTS, "hints/$hint.pl"; + @goodhints = <HINTS>; + close HINTS; + eval join('',@goodhints); } # Setup dummy package: @@ -672,8 +675,8 @@ Exporter::import('ExtUtils::MakeMaker', @Other_Att_Keys{qw(EXTRALIBS BSLOADLIBS LDLOADLIBS)} = (1) x 3; if ($Is_VMS = $Config{'osname'} eq 'VMS') { - require File::VMSspec; - import File::VMSspec 'vmsify'; + require VMS::Filespec; + import VMS::Filespec 'vmsify'; } @@ -752,7 +755,8 @@ sub init_main { } $att{INST_EXE} = "./blib" unless $att{INST_EXE}; $att{MAP_TARGET} = "perl" unless $att{MAP_TARGET}; - $att{LIBPERL_A} = 'libperl.a' unless $att{LIBPERL_A}; + $att{LIBPERL_A} = $Is_VMS ? 'libperl.olb' : 'libperl.a' + unless $att{LIBPERL_A}; } # make a few simple checks @@ -981,7 +985,7 @@ sub find_perl{ foreach $dir (@$dirs){ next unless defined $dir; # $att{PERL_SRC} may be undefined foreach $name (@$names){ - print "checking $dir/$name" if ($trace >= 2); + print "Checking $dir/$name " if ($trace >= 2); if ($Is_VMS) { $name .= ".exe" unless -x "$dir/$name"; } @@ -1986,7 +1990,7 @@ sub extliblist{ if (@fullname=<${thispth}/lib${thislib}.${so}.[0-9]*>){ $fullname=$fullname[-1]; #ATTN: 10 looses against 9! } elsif (-f ($fullname="$thispth/lib$thislib.$so") - && (($Config{'dlsrc'} ne "dl_dld") || ($thislib eq "m"))){ + && (($Config{'dlsrc'} ne "dl_dld.xs") || ($thislib eq "m"))){ } elsif (-f ($fullname="$thispth/lib${thislib}_s.a") && ($thislib .= "_s") ){ # we must explicitly ask for _s version } elsif (-f ($fullname="$thispth/lib$thislib.a")){ diff --git a/lib/ExtUtils/xsubpp b/lib/ExtUtils/xsubpp index bc0852303f..21bbc4edee 100755 --- a/lib/ExtUtils/xsubpp +++ b/lib/ExtUtils/xsubpp @@ -68,6 +68,8 @@ SWITCH: while ($ARGV[0] =~ s/^-//) { } @ARGV == 1 or die $usage; chop($pwd = `pwd`); +# Check for error message from VMS +if ($pwd =~ /unrecognized command verb/) { $Is_VMS = 1; $pwd = $ENV{DEFAULT} } ($dir, $filename) = @ARGV[0] =~ m#(.*)/(.*)# or ($dir, $filename) = @ARGV[0] =~ m#(.*[>\]])(.*)# or ($dir, $filename) = ('.', $ARGV[0]); @@ -77,7 +79,9 @@ $typemap = shift @ARGV; foreach $typemap (@tm) { die "Can't find $typemap in $pwd\n" unless -r $typemap; } -unshift @tm, qw(../../../typemap ../../typemap ../typemap typemap); +unshift @tm, qw(../../../../lib/ExtUtils/typemap ../../../lib/ExtUtils/typemap + ../../lib/ExtUtils/typemap ../../../typemap ../../typemap + ../typemap typemap); foreach $typemap (@tm) { open(TYPEMAP, $typemap) || next; $mode = Typemap; @@ -321,11 +325,17 @@ EOF $_ = shift(@line); last if /^\s*NOT_IMPLEMENTED_YET/; last if /^\s*(PPCODE|CODE|OUTPUT|CLEANUP|CASE)\s*:/; - # Catch common error. Much more error checking required here. - blurt("Error: no tab in $pname argument declaration '$_'\n") - unless (m/\S+\s*\t\s*\S+/); ($var_type, $var_name, $var_init) = /\s*([^\t]+)\s*([^\s=]+)\s*(=.*)?/; + # Catch common errors. More error checking required here. + blurt("Error: no tab in $pname argument declaration '$_'\n") + unless (m/\S+\s*\t\s*\S+/); + # catch C style argument declaration (this could be made alowable syntax) + warn("Warning: ignored semicolon in $pname argument declaration '$_'\n") + if ($var_name =~ s/;//g); # eg SV *<tab>name; + # catch many errors similar to: SV<tab>* name + blurt("Error: invalid $pname argument name '$var_name' (type '$var_type')\n") + unless ($var_name =~ m/^&?\w+$/); if ($var_name =~ /^&/) { $var_name =~ s/^&//; $var_addr{$var_name} = 1; @@ -523,7 +533,7 @@ sub generate_init { local($ntype); local($tk); - blurt("$type not in typemap"), return unless defined($type_kind{$type}); + blurt("'$type' not in typemap"), return unless defined($type_kind{$type}); ($ntype = $type) =~ s/\s*\*/Ptr/g; $subtype = $ntype; $subtype =~ s/Ptr$//; @@ -563,7 +573,7 @@ sub generate_output { if ($type =~ /^array\(([^,]*),(.*)\)/) { print "\tsv_setpvn($arg, (char *)$var, $2 * sizeof($1)), XFree((char *)$var);\n"; } else { - blurt("$type not in typemap"), return + blurt("'$type' not in typemap"), return unless defined($type_kind{$type}); ($ntype = $type) =~ s/\s*\*/Ptr/g; $ntype =~ s/\(\)//g; @@ -613,4 +623,7 @@ sub map_type { } } -exit $errors; +# If this is VMS, the exit status has meaning to the shell, so we +# use a predictable value (SS$_Abort) rather than an arbitrary +# number. +exit $Is_VMS ? 44 : $errors; |