Commit | Line | Data |
---|---|---|
42793c05 | 1 | use ExtUtils::MakeMaker; |
00b02797 | 2 | use Config; |
42793c05 | 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 | ||
4ad10cd1 | 9 | # Work around: Darwin ppc64 bug ignores archive contents when building bundles |
10 | ||
3e3baf6d | 11 | $define = ($^O eq 'MSWin32') ? '-DMSDOS' : ''; |
17f28c40 | 12 | if ($^O eq 'MSWin32') { $myextlib = 'sdbm\\libsdbm$(LIB_EXT)'; } |
4ad10cd1 | 13 | elsif ($^O eq 'darwin' && $Config{'ldflags'} =~/-arch ppc64/) { |
14 | $myextlib = '-all_load sdbm/libsdbm$(LIB_EXT)'; } | |
17f28c40 | 15 | else { $myextlib = 'sdbm/libsdbm$(LIB_EXT)'; } |
137443ea | 16 | |
42793c05 | 17 | WriteMakefile( |
bf99883d | 18 | NAME => 'SDBM_File', |
19 | MYEXTLIB => $myextlib, | |
bf99883d | 20 | XSPROTOARG => '-noprototypes', # XXX remove later? |
21 | VERSION_FROM => 'SDBM_File.pm', | |
22 | DEFINE => $define, | |
ee13e175 | 23 | PERL_MALLOC_OK => 1, |
bf99883d | 24 | ); |
42793c05 | 25 | |
26 | sub MY::postamble { | |
cf2f24a4 | 27 | if ($^O =~ /MSWin32/ && !defined($ENV{SYSTEMROOT})) { |
00b02797 | 28 | if ($Config{'make'} =~ /dmake/i) { |
29 | # dmake-specific | |
94bf5962 | 30 | return <<'EOT'; |
7a958ec3 | 31 | $(MYEXTLIB): sdbm/Makefile |
32 | @[ | |
33 | cd sdbm | |
34 | $(MAKE) all | |
35 | cd .. | |
36 | ] | |
00b02797 | 37 | EOT |
38 | } elsif ($Config{'make'} =~ /nmake/i) { | |
39 | # | |
94bf5962 | 40 | return <<'EOT'; |
00b02797 | 41 | $(MYEXTLIB): sdbm/Makefile |
42 | cd sdbm | |
43 | $(MAKE) all | |
44 | cd .. | |
45 | EOT | |
46 | } | |
47 | } elsif ($^O ne 'VMS') { | |
42793c05 | 48 | ' |
49 | $(MYEXTLIB): sdbm/Makefile | |
137443ea | 50 | cd sdbm && $(MAKE) all |
42793c05 | 51 | '; |
7a958ec3 | 52 | } |
53 | else { | |
54 | ' | |
17f28c40 | 55 | $(MYEXTLIB) : [.sdbm]descrip.mms |
bf99883d | 56 | set def [.sdbm] |
57 | $(MMS) all | |
58 | set def [-] | |
59 | '; | |
60 | } | |
42793c05 | 61 | } |