Fix up .gitignore files some more
[p5sagit/p5-mst-13.2.git] / ext / DB_File / Makefile.PL
CommitLineData
07200f1b 1use strict;
2use warnings;
3
b59936da 4use ExtUtils::MakeMaker ;
07200f1b 5use ExtUtils::Constant qw(WriteConstants);
88108326 6use Config ;
7
8# OS2 is a special case, so check for it now.
9my $OS2 = "-DOS2" if $Config{'osname'} eq 'os2' ;
8e07c86e 10
1f70e1ea 11my $LIB = "-ldb" ;
12# so is win32
13$LIB = "-llibdb" if $^O eq 'MSWin32' ;
14
8e07c86e 15WriteMakefile(
88108326 16 NAME => 'DB_File',
1f70e1ea 17 LIBS => ["-L/usr/local/lib $LIB"],
69158f75 18 MAN3PODS => {}, # Pods will be built by installman.
88108326 19 #INC => '-I/usr/local/include',
c07a80fd 20 VERSION_FROM => 'DB_File.pm',
039d031f 21 OBJECT => 'version$(OBJ_EXT) DB_File$(OBJ_EXT)',
88108326 22 XSPROTOARG => '-noprototypes',
6570f784 23 DEFINE => $OS2 || "",
07200f1b 24 INC => ($^O eq "MacOS" ? "-i ::::db:include" : ""),
a5d81eb5 25 XS_VERSION => eval MM->parse_version('DB_File.pm'),
f1aa208b 26 ((ExtUtils::MakeMaker->VERSION() gt '6.30')
27 ? ('LICENSE' => 'perl')
28 : ()
29 ),
30 (
31 $] >= 5.005
32 ? (ABSTRACT_FROM => 'DB_File.pm',
33 AUTHOR => 'Paul Marquess <pmqs@cpan.org>')
34 : ()
35 ),
36
412e9c57 37 'depend' => {'version$(OBJ_EXT)' => 'version.c'},
38 'clean' => {FILES => 'constants.h constants.xs'},
07200f1b 39 );
40
41my @names = qw(
42 BTREEMAGIC
43 BTREEVERSION
44 DB_LOCK
45 DB_SHMEM
46 DB_TXN
47 HASHMAGIC
48 HASHVERSION
49 MAX_PAGE_NUMBER
50 MAX_PAGE_OFFSET
51 MAX_REC_NUMBER
52 RET_ERROR
53 RET_SPECIAL
54 RET_SUCCESS
55 R_CURSOR
56 R_DUP
57 R_FIRST
58 R_FIXEDLEN
59 R_IAFTER
60 R_IBEFORE
61 R_LAST
62 R_NEXT
63 R_NOKEY
64 R_NOOVERWRITE
65 R_PREV
66 R_RECNOSYNC
67 R_SETCURSOR
68 R_SNAPSHOT
69 __R_UNUSED
88108326 70 );
8e07c86e 71
07200f1b 72 # Check the constants above all appear in @EXPORT in DB_File.pm
73 my %names = map { $_, 1} @names;
74 open F, "<DB_File.pm" or die "Cannot open DB_File.pm: $!\n";
75 while (<F>)
76 {
77 last if /^\s*\@EXPORT\s+=\s+qw\(/ ;
78 }
79
80 while (<F>)
81 {
82 last if /^\s*\)/ ;
83 /(\S+)/ ;
84 delete $names{$1} if defined $1 ;
85 }
86 close F ;
039d031f 87
07200f1b 88 if ( keys %names )
89 {
90 my $missing = join ("\n\t", sort keys %names) ;
91 die "The following names are missing from \@EXPORT in DB_File.pm\n" .
92 "\t$missing\n" ;
93 }
94
039d031f 95
07200f1b 96 WriteConstants( NAME => 'DB_File',
97 NAMES => \@names,
98 C_FILE => 'constants.h',
99 XS_FILE => 'constants.xs',
100 );