diff options
author | Nicholas Clark <nick@ccl4.org> | 2009-09-16 10:23:56 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2009-09-16 10:23:56 +0100 |
commit | 28161c97e726a0cbc7d3e30460aa0bf491d83b97 (patch) | |
tree | 4a1834171af3648289805d882e515de708820539 /ext/DynaLoader | |
parent | 9139c7231c70a9388d718abc41e91edaf43422ec (diff) | |
download | perl-28161c97e726a0cbc7d3e30460aa0bf491d83b97.tar.gz |
Start to make DynaLoader's Makefile.PL platform agnostic.
Diffstat (limited to 'ext/DynaLoader')
-rw-r--r-- | ext/DynaLoader/Makefile.PL | 46 |
1 files changed, 35 insertions, 11 deletions
diff --git a/ext/DynaLoader/Makefile.PL b/ext/DynaLoader/Makefile.PL index 2a9aa7b340..a58e95288c 100644 --- a/ext/DynaLoader/Makefile.PL +++ b/ext/DynaLoader/Makefile.PL @@ -1,5 +1,10 @@ +use strict; use ExtUtils::MakeMaker; +my $is_mswin = $^O eq 'MSWin32'; +my $is_netware = $^O eq 'NetWare'; +my $is_vms = $^O eq 'VMS'; + WriteMakefile( NAME => 'DynaLoader', LINKTYPE => 'static', @@ -17,10 +22,12 @@ WriteMakefile( ); sub MY::postamble { - ' -DynaLoader.xs: $(DLSRC) - $(RM_F) $@ - $(CP) $? $@ + my $test_xs; + + if ($is_mswin || $is_netware || $is_vms) { + $test_xs = ''; + } else { + $test_xs = <<'EOT'; # Perform very simple tests just to check for major gaffs. # We can\'t do much more for platforms we are not executing on. @@ -28,15 +35,32 @@ test-xs: for i in dl_*xs; \ do $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSUBPPARGS) $$i > /dev/null; \ done -'; +EOT + } + + return ' +DynaLoader.xs: $(DLSRC) + $(RM_F) $@ + $(CP) $? $@ +' . $test_xs; } sub MY::static { - ' -$(PERL_SRC)/$(OBJECT) : $(FIRST_MAKEFILE) $(OBJECT) - $(RM_RF) $(PERL_SRC)/$(OBJECT) - $(CP) $(OBJECT) $(PERL_SRC)/$(OBJECT) + my $object; + if ($is_mswin || $is_netware) { + $object = '$(PERL_SRC)\\$(OBJECT)'; + } elsif ($is_vms) { + $object = '[$(PERL_SRC)].$(OBJECT)'; + } else { + $object = '$(PERL_SRC)/$(OBJECT)'; + } + + + return " +$object : \$(FIRST_MAKEFILE) \$(OBJECT) + \$(RM_RF) $object + \$(CP) \$(OBJECT) $object -static :: $(PERL_SRC)/$(OBJECT) -'; +static :: $object +"; } |