X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2FDB_File%2FMakefile.PL;h=93f3895da29712bbd1ffb39618c64eb33f9267dd;hb=5e137bc214f9c21ed33df8110b67005fb915c4e7;hp=cac6578bb3080a81d53d8cb2b1fa5b44c78a1f9a;hpb=6570f7848406340d371b9f81689299e3b739279f;p=p5sagit%2Fp5-mst-13.2.git diff --git a/ext/DB_File/Makefile.PL b/ext/DB_File/Makefile.PL index cac6578..93f3895 100644 --- a/ext/DB_File/Makefile.PL +++ b/ext/DB_File/Makefile.PL @@ -1,4 +1,8 @@ -use ExtUtils::MakeMaker 5.16 ; +use strict; +use warnings; + +use ExtUtils::MakeMaker ; +use ExtUtils::Constant qw(WriteConstants); use Config ; # OS2 is a special case, so check for it now. @@ -17,12 +21,80 @@ WriteMakefile( OBJECT => 'version$(OBJ_EXT) DB_File$(OBJ_EXT)', XSPROTOARG => '-noprototypes', DEFINE => $OS2 || "", + INC => ($^O eq "MacOS" ? "-i ::::db:include" : ""), + XS_VERSION => eval MM->parse_version('DB_File.pm'), + ((ExtUtils::MakeMaker->VERSION() gt '6.30') + ? ('LICENSE' => 'perl') + : () + ), + ( + $] >= 5.005 + ? (ABSTRACT_FROM => 'DB_File.pm', + AUTHOR => 'Paul Marquess ') + : () + ), + + 'depend' => {'version$(OBJ_EXT)' => 'version.c'}, + 'clean' => {FILES => 'constants.h constants.xs'}, ); -sub MY::postamble { - ' -version$(OBJ_EXT): version.c +my @names = qw( + BTREEMAGIC + BTREEVERSION + DB_LOCK + DB_SHMEM + DB_TXN + HASHMAGIC + HASHVERSION + MAX_PAGE_NUMBER + MAX_PAGE_OFFSET + MAX_REC_NUMBER + RET_ERROR + RET_SPECIAL + RET_SUCCESS + R_CURSOR + R_DUP + R_FIRST + R_FIXEDLEN + R_IAFTER + R_IBEFORE + R_LAST + R_NEXT + R_NOKEY + R_NOOVERWRITE + R_PREV + R_RECNOSYNC + R_SETCURSOR + R_SNAPSHOT + __R_UNUSED + ); + + # Check the constants above all appear in @EXPORT in DB_File.pm + my %names = map { $_, 1} @names; + open F, ") + { + last if /^\s*\@EXPORT\s+=\s+qw\(/ ; + } + + while () + { + last if /^\s*\)/ ; + /(\S+)/ ; + delete $names{$1} if defined $1 ; + } + close F ; -' ; -} + if ( keys %names ) + { + my $missing = join ("\n\t", sort keys %names) ; + die "The following names are missing from \@EXPORT in DB_File.pm\n" . + "\t$missing\n" ; + } + + WriteConstants( NAME => 'DB_File', + NAMES => \@names, + C_FILE => 'constants.h', + XS_FILE => 'constants.xs', + );