This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Tests for rpeep optimisations in e45d8982ae
[perl5.git] / ext / SDBM_File / Makefile.PL
1 use ExtUtils::MakeMaker;
2 use Config;
3
4 # The existence of the ./sdbm/Makefile.PL file causes MakeMaker
5 # to automatically include Makefile code for the targets
6 #       config, all, clean, realclean and sdbm/Makefile
7 # which perform the corresponding actions in the subdirectory.
8
9 # Work around: Darwin ppc64 bug ignores archive contents when building bundles
10
11 $define = ($^O eq 'MSWin32') ? '-DMSDOS' : '';
12 if ($^O eq 'MSWin32') { $myextlib = 'sdbm\\libsdbm$(LIB_EXT)'; }
13 elsif ($^O eq 'darwin' && $Config{'ldflags'} =~/-arch ppc64/) {
14                         $myextlib = '-all_load sdbm/libsdbm$(LIB_EXT)'; }
15 else                  { $myextlib = 'sdbm/libsdbm$(LIB_EXT)';  }
16
17 WriteMakefile(
18               NAME      => 'SDBM_File',
19               MYEXTLIB => $myextlib,
20               XSPROTOARG => '-noprototypes',            # XXX remove later?
21               VERSION_FROM => 'SDBM_File.pm',
22               DEFINE => $define,
23               PERL_MALLOC_OK => 1,
24              );
25
26 # We don't want the default subdir rule, as it creates a race condition with the
27 # rule we add below.
28 sub MY::subdir_x {
29     return '';
30 }
31
32 sub MY::postamble {
33   if ($^O =~ /MSWin32/ && !defined($ENV{SYSTEMROOT})) {
34         if ($Config{'make'} =~ /dmake/i) {
35             # dmake-specific
36             return <<'EOT';
37 $(MYEXTLIB): sdbm/Makefile
38 @[
39         cd sdbm
40         $(MAKE) all
41         cd ..
42 ]
43 EOT
44         } elsif ($Config{'make'} =~ /nmake/i) {
45             #
46             return <<'EOT';
47 $(MYEXTLIB): sdbm/Makefile
48         cd sdbm
49         $(MAKE) all
50         cd ..
51 EOT
52         } 
53 } elsif ($^O ne 'VMS') {
54     '
55 $(MYEXTLIB): sdbm/Makefile
56         cd sdbm && $(MAKE) all
57 ';
58   }
59   else {
60     '   
61 $(MYEXTLIB) : [.sdbm]descrip.mms
62         set def [.sdbm]
63     $(MMS) all
64     set def [-]
65 ';  
66   }
67 }