This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Merge the implementations of 2 sets of POSIX functions.
[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 sub MY::postamble {
27   if ($^O =~ /MSWin32/ && !defined($ENV{SYSTEMROOT})) {
28         if ($Config{'make'} =~ /dmake/i) {
29             # dmake-specific
30             return <<'EOT';
31 $(MYEXTLIB): sdbm/Makefile
32 @[
33         cd sdbm
34         $(MAKE) all
35         cd ..
36 ]
37 EOT
38         } elsif ($Config{'make'} =~ /nmake/i) {
39             #
40             return <<'EOT';
41 $(MYEXTLIB): sdbm/Makefile
42         cd sdbm
43         $(MAKE) all
44         cd ..
45 EOT
46         } 
47 } elsif ($^O ne 'VMS') {
48     '
49 $(MYEXTLIB): sdbm/Makefile
50         cd sdbm && $(MAKE) all
51 ';
52   }
53   else {
54     '   
55 $(MYEXTLIB) : [.sdbm]descrip.mms
56         set def [.sdbm]
57     $(MMS) all
58     set def [-]
59 ';  
60   }
61 }