diff options
author | Charles Lane <lane@DUPHY4.Physics.Drexel.Edu> | 2001-11-09 10:07:19 -0500 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-11-10 01:32:52 +0000 |
commit | 20ebe338e52c42d70e939ff310f7d9eecf5301f4 (patch) | |
tree | de9fb1562b7e5800d4c89ea34c0eab00a9163afc /lib/ExtUtils | |
parent | 4b647fb0fbdf8961608035051911f2c5e7a00c2b (diff) | |
download | perl-20ebe338e52c42d70e939ff310f7d9eecf5301f4.tar.gz |
[Patch Perl@12892] a *real* Embed test for VMS
Message-Id: <011109150622.16fb0@DUPHY4.Physics.Drexel.Edu>
p4raw-id: //depot/perl@12921
Diffstat (limited to 'lib/ExtUtils')
-rw-r--r-- | lib/ExtUtils/Embed.t | 70 |
1 files changed, 47 insertions, 23 deletions
diff --git a/lib/ExtUtils/Embed.t b/lib/ExtUtils/Embed.t index 9accc7a278..3c996b7dad 100644 --- a/lib/ExtUtils/Embed.t +++ b/lib/ExtUtils/Embed.t @@ -8,10 +8,6 @@ use Config; use ExtUtils::Embed; use File::Spec; -if ($^O eq 'VMS') { - print "1..0 # not on VMS\n"; - exit 0; -} open(my $fh,">embed_test.c") || die "Cannot open embed_test.c:$!"; print $fh <DATA>; close($fh); @@ -21,17 +17,39 @@ print "1..9\n"; my $cc = $Config{'cc'}; my $cl = ($^O eq 'MSWin32' && $cc eq 'cl'); my $exe = 'embed_test' . $Config{'exe_ext'}; +my $obj = 'embed_test' . $Config{'obj_ext'} if $^O eq 'VMS'; my $inc = File::Spec->catdir($INC[0],".."); my $lib = File::Spec->catdir($INC[0],".."); my @cmd; -if ($cl) { +my (@cmd2) if $^O eq 'VMS'; + +if ($^O eq 'VMS') { + push(@cmd,$cc,"/Obj=$obj"); + my (@incs) = ($inc); + my $crazy = ccopts(); + if ($crazy =~ s#/inc[^=/]*=([\w\$\_\-\.\[\]\:]+)##i) { + push(@incs,$1); + } + if ($crazy =~ s/-I([a-zA-Z0-9\$\_\-\.\[\]\:]*)//) { + push(@incs,$1); + } + $crazy =~ s#/Obj[^=/]*=[\w\$\_\-\.\[\]\:]+##i; + push(@cmd,"/Include=(".join(',',@incs).")"); + push(@cmd,$crazy); + push(@cmd,"embed_test.c"); + + push(@cmd2,$Config{'ld'}, $Config{'ldflags'}, "/exe=$exe"); + push(@cmd2,"$obj,[-]perlshr.opt/opt,[-]perlshr_attr.opt/opt"); + +} else { + if ($cl) { push(@cmd,$cc,"-Fe$exe"); -} -else { + } + else { push(@cmd,$cc,'-o' => $exe); -} -push(@cmd,"-I$inc",ccopts(),'embed_test.c'); -if ($^O eq 'MSWin32') { + } + push(@cmd,"-I$inc",ccopts(),'embed_test.c'); + if ($^O eq 'MSWin32') { $inc = File::Spec->catdir($inc,'win32'); push(@cmd,"-I$inc"); $inc = File::Spec->catdir($inc,'include'); @@ -42,35 +60,41 @@ if ($^O eq 'MSWin32') { else { push(@cmd,"-L$lib",File::Spec->catfile($lib,$Config{'libperl'}),$Config{'libc'}); } -} -else { + } + else { push(@cmd,"-L$lib",'-lperl'); -} -{ + } + { local $SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /No library found for -lperl/ }; push(@cmd,ldopts()); -} + } -if ($^O eq 'aix') { # AIX needs an explicit symbol export list. + if ($^O eq 'aix') { # AIX needs an explicit symbol export list. my ($perl_exp) = grep { -f } qw(perl.exp ../perl.exp); die "where is perl.exp?\n" unless defined $perl_exp; for (@cmd) { s!-bE:(\S+)!-bE:$perl_exp!; } + } } - -print "# @cmd"; # where is the newline coming from? ldopts()? -print "not " if system(join(' ',@cmd)); -print "ok 1\n"; +my $status; +print "# @cmd\n"; # where is the newline coming from? ldopts()? +$status = system(join(' ',@cmd)); +if ($^O eq 'VMS' && !$status) { + print "# @cmd2\n"; + $status = system(join(' ',@cmd2)); +} +print (($status? 'not ': '')."ok 1\n"); my $embed_test = File::Spec->catfile(File::Spec->curdir, "embed_test"); +$embed_test = "run/nodebug $exe" if $^O eq 'VMS'; -print "not " if system($embed_test); -print "ok 9\n"; - +$status = system($embed_test); +print (($status? 'not ':'')."ok 9\n"); unlink($exe,"embed_test.c"); +unlink($obj,"embed_test.map","embed_test.lis") if $^O eq 'VMS' # gcc -g -I.. -L../ -o perl_test perl_test.c -lperl `../perl -I../lib -MExtUtils::Embed -I../ -e ccopts -e ldopts` |