Regen perlmodlib. (TODO: why does Pod::t::basic get listed?)
[p5sagit/p5-mst-13.2.git] / ext / DB_File / Makefile.PL
1 use strict;
2 use warnings;
3
4 use ExtUtils::MakeMaker 5.16 ;
5 use ExtUtils::Constant qw(WriteConstants);
6 use Config ;
7
8 # OS2 is a special case, so check for it now.
9 my $OS2 = "-DOS2" if $Config{'osname'} eq 'os2' ;
10
11 my $LIB = "-ldb" ;
12 # so is win32
13 $LIB = "-llibdb" if $^O eq 'MSWin32' ;
14
15 WriteMakefile(
16         NAME            => 'DB_File',
17         LIBS            => ["-L/usr/local/lib $LIB"],
18         MAN3PODS        => {},         # Pods will be built by installman.
19         #INC            => '-I/usr/local/include',
20         VERSION_FROM    => 'DB_File.pm',
21         OBJECT          => 'version$(OBJ_EXT) DB_File$(OBJ_EXT)',
22         XSPROTOARG      => '-noprototypes',
23         DEFINE          => $OS2 || "",
24         INC             => ($^O eq "MacOS" ? "-i ::::db:include" : ""),
25         'depend'        => {"version$(OBJ_EXT)" => 'version.c'},
26         );
27
28 my @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
57         );
58
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 ;
74
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     
82
83     WriteConstants( NAME => 'DB_File',
84                     NAMES => \@names,
85                     C_FILE  => 'constants.h',
86                     XS_FILE  => 'constants.xs',
87                   );