Regen perlmodlib. (TODO: why does Pod::t::basic get listed?)
[p5sagit/p5-mst-13.2.git] / ext / DB_File / Makefile.PL
CommitLineData
07200f1b 1use strict;
2use warnings;
3
88108326 4use ExtUtils::MakeMaker 5.16 ;
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" : ""),
25 'depend' => {"version$(OBJ_EXT)" => 'version.c'},
26 );
27
28my @names = qw(
29 BTREEMAGIC
30 BTREEVERSION
31 DB_LOCK
32 DB_SHMEM
33 DB_TXN
34 HASHMAGIC
35 HASHVERSION
36 MAX_PAGE_NUMBER
37 MAX_PAGE_OFFSET
38 MAX_REC_NUMBER
39 RET_ERROR
40 RET_SPECIAL
41 RET_SUCCESS
42 R_CURSOR
43 R_DUP
44 R_FIRST
45 R_FIXEDLEN
46 R_IAFTER
47 R_IBEFORE
48 R_LAST
49 R_NEXT
50 R_NOKEY
51 R_NOOVERWRITE
52 R_PREV
53 R_RECNOSYNC
54 R_SETCURSOR
55 R_SNAPSHOT
56 __R_UNUSED
88108326 57 );
8e07c86e 58
07200f1b 59 # Check the constants above all appear in @EXPORT in DB_File.pm
60 my %names = map { $_, 1} @names;
61 open F, "<DB_File.pm" or die "Cannot open DB_File.pm: $!\n";
62 while (<F>)
63 {
64 last if /^\s*\@EXPORT\s+=\s+qw\(/ ;
65 }
66
67 while (<F>)
68 {
69 last if /^\s*\)/ ;
70 /(\S+)/ ;
71 delete $names{$1} if defined $1 ;
72 }
73 close F ;
039d031f 74
07200f1b 75 if ( keys %names )
76 {
77 my $missing = join ("\n\t", sort keys %names) ;
78 die "The following names are missing from \@EXPORT in DB_File.pm\n" .
79 "\t$missing\n" ;
80 }
81
039d031f 82
07200f1b 83 WriteConstants( NAME => 'DB_File',
84 NAMES => \@names,
85 C_FILE => 'constants.h',
86 XS_FILE => 'constants.xs',
87 );