1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22use ExtUtils::MakeMaker;
23use Config;
24
25# The existence of the ./sdbm/Makefile.PL file causes MakeMaker
26# to automatically include Makefile code for the targets
27#	config, all, clean, realclean and sdbm/Makefile
28# which perform the corresponding actions in the subdirectory.
29
30$define = ($^O eq 'MSWin32') ? '-DMSDOS' : '';
31if ($^O eq 'MSWin32') { $myextlib = 'sdbm\\libsdbm$(LIB_EXT)'; }
32else                  { $myextlib = 'sdbm/libsdbm$(LIB_EXT)';  }
33
34WriteMakefile(
35              NAME	=> 'SDBM_File',
36              MYEXTLIB => $myextlib,
37              MAN3PODS 	=> {}, 	# Pods will be built by installman.
38              XSPROTOARG => '-noprototypes', 		# XXX remove later?
39              VERSION_FROM => 'SDBM_File.pm',
40              DEFINE => $define,
41	      PERL_MALLOC_OK => 1,
42             );
43
44sub MY::postamble {
45  if ($^O =~ /MSWin32/ && Win32::IsWin95()) {
46	if ($Config{'make'} =~ /dmake/i) {
47	    # dmake-specific
48	    return <<'EOT';
49$(MYEXTLIB): sdbm/Makefile
50@[
51	cd sdbm
52	$(MAKE) all
53	cd ..
54]
55EOT
56	} elsif ($Config{'make'} =~ /nmake/i) {
57	    #
58	    return <<'EOT';
59$(MYEXTLIB): sdbm/Makefile
60	cd sdbm
61	$(MAKE) all
62	cd ..
63EOT
64	}
65} elsif ($^O ne 'VMS') {
66    '
67$(MYEXTLIB): sdbm/Makefile
68	cd sdbm && $(MAKE) all
69';
70  }
71  else {
72    '
73$(MYEXTLIB) : [.sdbm]descrip.mms
74	set def [.sdbm]
75    $(MMS) all
76    set def [-]
77';
78  }
79}
80