Silence new warning grep in void context warning in various modules and test files...
[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" : ""),
f1aa208b 25 ((ExtUtils::MakeMaker->VERSION() gt '6.30')
26 ? ('LICENSE' => 'perl')
27 : ()
28 ),
29 (
30 $] >= 5.005
31 ? (ABSTRACT_FROM => 'DB_File.pm',
32 AUTHOR => 'Paul Marquess <pmqs@cpan.org>')
33 : ()
34 ),
35
412e9c57 36 'depend' => {'version$(OBJ_EXT)' => 'version.c'},
37 'clean' => {FILES => 'constants.h constants.xs'},
07200f1b 38 );
39
40my @names = qw(
41 BTREEMAGIC
42 BTREEVERSION
43 DB_LOCK
44 DB_SHMEM
45 DB_TXN
46 HASHMAGIC
47 HASHVERSION
48 MAX_PAGE_NUMBER
49 MAX_PAGE_OFFSET
50 MAX_REC_NUMBER
51 RET_ERROR
52 RET_SPECIAL
53 RET_SUCCESS
54 R_CURSOR
55 R_DUP
56 R_FIRST
57 R_FIXEDLEN
58 R_IAFTER
59 R_IBEFORE
60 R_LAST
61 R_NEXT
62 R_NOKEY
63 R_NOOVERWRITE
64 R_PREV
65 R_RECNOSYNC
66 R_SETCURSOR
67 R_SNAPSHOT
68 __R_UNUSED
88108326 69 );
8e07c86e 70
07200f1b 71 # Check the constants above all appear in @EXPORT in DB_File.pm
72 my %names = map { $_, 1} @names;
73 open F, "<DB_File.pm" or die "Cannot open DB_File.pm: $!\n";
74 while (<F>)
75 {
76 last if /^\s*\@EXPORT\s+=\s+qw\(/ ;
77 }
78
79 while (<F>)
80 {
81 last if /^\s*\)/ ;
82 /(\S+)/ ;
83 delete $names{$1} if defined $1 ;
84 }
85 close F ;
039d031f 86
07200f1b 87 if ( keys %names )
88 {
89 my $missing = join ("\n\t", sort keys %names) ;
90 die "The following names are missing from \@EXPORT in DB_File.pm\n" .
91 "\t$missing\n" ;
92 }
93
039d031f 94
07200f1b 95 WriteConstants( NAME => 'DB_File',
96 NAMES => \@names,
97 C_FILE => 'constants.h',
98 XS_FILE => 'constants.xs',
99 );