source: trunk/essentials/dev-lang/perl/ext/DB_File/Makefile.PL@ 3368

Last change on this file since 3368 was 3181, checked in by bird, 19 years ago

perl 5.8.8

File size: 1.8 KB
Line 
1use strict;
2use warnings;
3
4use ExtUtils::MakeMaker ;
5use ExtUtils::Constant qw(WriteConstants);
6use Config ;
7
8# OS2 is a special case, so check for it now.
9my $OS2 = "-DOS2" if $Config{'osname'} eq 'os2' ;
10
11my $LIB = "-ldb" ;
12# so is win32
13$LIB = "-llibdb" if $^O eq 'MSWin32' ;
14
15WriteMakefile(
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 'clean' => {FILES => 'constants.h constants.xs'},
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
58 );
59
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 ;
75
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
83
84 WriteConstants( NAME => 'DB_File',
85 NAMES => \@names,
86 C_FILE => 'constants.h',
87 XS_FILE => 'constants.xs',
88 );
Note: See TracBrowser for help on using the repository browser.