This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade to Devel::PPPort 3.06_01
[perl5.git] / ext / DB_File / Makefile.PL
CommitLineData
07200f1b
PM
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
PM
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" : ""),
412e9c57
PM
25 'depend' => {'version$(OBJ_EXT)' => 'version.c'},
26 'clean' => {FILES => 'constants.h constants.xs'},
07200f1b
PM
27 );
28
29my @names = qw(
30 BTREEMAGIC
31 BTREEVERSION
32 DB_LOCK
33 DB_SHMEM
34 DB_TXN
35 HASHMAGIC
36 HASHVERSION
37 MAX_PAGE_NUMBER
38 MAX_PAGE_OFFSET
39 MAX_REC_NUMBER
40 RET_ERROR
41 RET_SPECIAL
42 RET_SUCCESS
43 R_CURSOR
44 R_DUP
45 R_FIRST
46 R_FIXEDLEN
47 R_IAFTER
48 R_IBEFORE
49 R_LAST
50 R_NEXT
51 R_NOKEY
52 R_NOOVERWRITE
53 R_PREV
54 R_RECNOSYNC
55 R_SETCURSOR
56 R_SNAPSHOT
57 __R_UNUSED
88108326 58 );
8e07c86e 59
07200f1b
PM
60 # Check the constants above all appear in @EXPORT in DB_File.pm
61 my %names = map { $_, 1} @names;
62 open F, "<DB_File.pm" or die "Cannot open DB_File.pm: $!\n";
63 while (<F>)
64 {
65 last if /^\s*\@EXPORT\s+=\s+qw\(/ ;
66 }
67
68 while (<F>)
69 {
70 last if /^\s*\)/ ;
71 /(\S+)/ ;
72 delete $names{$1} if defined $1 ;
73 }
74 close F ;
039d031f 75
07200f1b
PM
76 if ( keys %names )
77 {
78 my $missing = join ("\n\t", sort keys %names) ;
79 die "The following names are missing from \@EXPORT in DB_File.pm\n" .
80 "\t$missing\n" ;
81 }
82
039d031f 83
07200f1b
PM
84 WriteConstants( NAME => 'DB_File',
85 NAMES => \@names,
86 C_FILE => 'constants.h',
87 XS_FILE => 'constants.xs',
88 );