This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
version-0.73 (was Re: Change 31920: Don't use ~0 as a version
[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               MAN3PODS  => {},  # Pods will be built by installman.
21               XSPROTOARG => '-noprototypes',            # XXX remove later?
22               VERSION_FROM => 'SDBM_File.pm',
23               DEFINE => $define,
24               PERL_MALLOC_OK => 1,
25              );
26
27 sub MY::postamble {
28   if ($^O =~ /MSWin32/ && !defined($ENV{SYSTEMROOT})) {
29         if ($Config{'make'} =~ /dmake/i) {
30             # dmake-specific
31             return <<'EOT';
32 $(MYEXTLIB): sdbm/Makefile
33 @[
34         cd sdbm
35         $(MAKE) all
36         cd ..
37 ]
38 EOT
39         } elsif ($Config{'make'} =~ /nmake/i) {
40             #
41             return <<'EOT';
42 $(MYEXTLIB): sdbm/Makefile
43         cd sdbm
44         $(MAKE) all
45         cd ..
46 EOT
47         } 
48 } elsif ($^O ne 'VMS') {
49     '
50 $(MYEXTLIB): sdbm/Makefile
51         cd sdbm && $(MAKE) all
52 ';
53   }
54   else {
55     '   
56 $(MYEXTLIB) : [.sdbm]descrip.mms
57         set def [.sdbm]
58     $(MMS) all
59     set def [-]
60 ';  
61   }
62 }