This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Get PerlIO building on Win32
[perl5.git] / ext / SDBM_File / Makefile.PL
1 use ExtUtils::MakeMaker;
2 use Config;\r
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 $define = ($^O eq 'MSWin32') ? '-DMSDOS' : '';
10 if ($^O eq 'MSWin32') { $myextlib = 'sdbm\\libsdbm$(LIB_EXT)'; }
11 else                  { $myextlib = 'sdbm/libsdbm$(LIB_EXT)';  }
12
13 WriteMakefile(
14               NAME      => 'SDBM_File',
15               MYEXTLIB => $myextlib,
16               MAN3PODS  => {},  # Pods will be built by installman.
17               XSPROTOARG => '-noprototypes',            # XXX remove later?
18               VERSION_FROM => 'SDBM_File.pm',
19               DEFINE => $define,
20               PERL_MALLOC_OK => 1,
21              );
22
23 sub MY::postamble {
24   if ($^O =~ /MSWin32/ && Win32::IsWin95()) {
25         if ($Config{'make'} =~ /dmake/i) {\r
26             # dmake-specific\r
27             return <<EOT;\r
28 $(MYEXTLIB): sdbm/Makefile
29 @[
30         cd sdbm
31         $(MAKE) all
32         cd ..
33 ]
34 EOT\r
35         } elsif ($Config{'make'} =~ /nmake/i) {\r
36             #\r
37             return <<'EOT';\r
38 $(MYEXTLIB): sdbm/Makefile\r
39         cd sdbm\r
40         $(MAKE) all\r
41         cd ..\r
42 EOT\r
43         } \r
44   } elsif ($^O ne 'VMS') {\r
45     '
46 $(MYEXTLIB): sdbm/Makefile
47         cd sdbm && $(MAKE) all
48 ';
49   }
50   else {
51     '   
52 $(MYEXTLIB) : [.sdbm]descrip.mms
53         set def [.sdbm]
54     $(MMS) all
55     set def [-]
56 ';  
57   }
58 }