This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
PERL_SRC already has brackets on VMS.
[perl5.git] / ext / DynaLoader / Makefile.PL
CommitLineData
28161c97 1use strict;
42793c05
TB
2use ExtUtils::MakeMaker;
3
28161c97
NC
4my $is_mswin = $^O eq 'MSWin32';
5my $is_netware = $^O eq 'NetWare';
6my $is_vms = $^O eq 'VMS';
7
42793c05 8WriteMakefile(
d2cedf73 9 NAME => 'DynaLoader',
4ad3186e 10 LINKTYPE => 'static',
ec29429e 11 DEFINE => '-DLIBC="$(LIBC)"',
4ad3186e 12 SKIP => [qw(dynamic dynamic_lib dynamic_bs)],
13 XSPROTOARG => '-noprototypes', # XXX remove later?
bfab39a2 14 VERSION_FROM => 'DynaLoader_pm.PL',
9426adcd
IZ
15 PL_FILES => {'DynaLoader_pm.PL'=>'DynaLoader.pm',
16 'XSLoader_pm.PL'=>'XSLoader.pm'},
17 PM => {'DynaLoader.pm' => '$(INST_LIBDIR)/DynaLoader.pm',
18 'XSLoader.pm' => '$(INST_LIBDIR)/XSLoader.pm'},
25785bc1 19 depend => {'DynaLoader$(OBJ_EXT)' => 'dlutils.c'},
f91101c9
GS
20 clean => {FILES => 'DynaLoader.c DynaLoader.xs DynaLoader.pm ' .
21 'XSLoader.pm'},
42793c05
TB
22);
23
42793c05 24sub MY::postamble {
28161c97
NC
25 my $test_xs;
26
27 if ($is_mswin || $is_netware || $is_vms) {
28 $test_xs = '';
29 } else {
30 $test_xs = <<'EOT';
42793c05
TB
31
32# Perform very simple tests just to check for major gaffs.
33# We can\'t do much more for platforms we are not executing on.
34test-xs:
35 for i in dl_*xs; \
005c1a0e 36 do $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSUBPPARGS) $$i > /dev/null; \
42793c05 37 done
28161c97
NC
38EOT
39 }
40
41 return '
42DynaLoader.xs: $(DLSRC)
43 $(RM_F) $@
44 $(CP) $? $@
45' . $test_xs;
42793c05
TB
46}
47
908fcb8b 48sub MY::static {
28161c97
NC
49 my $object;
50 if ($is_mswin || $is_netware) {
51 $object = '$(PERL_SRC)\\$(OBJECT)';
52 } elsif ($is_vms) {
b49e011f 53 $object = '$(PERL_SRC)$(OBJECT)';
28161c97
NC
54 } else {
55 $object = '$(PERL_SRC)/$(OBJECT)';
56 }
57
58
59 return "
60$object : \$(FIRST_MAKEFILE) \$(OBJECT)
61 \$(RM_RF) $object
62 \$(CP) \$(OBJECT) $object
5836a66f 63
28161c97
NC
64static :: $object
65";
908fcb8b 66}