1use 5.010000; 2use ExtUtils::MakeMaker; 3# See lib/ExtUtils/MakeMaker.pm for details of how to influence 4# the contents of the Makefile that is written. 5WriteMakefile( 6 NAME => 'Digest::FNV', 7 VERSION_FROM => 'lib/Digest/FNV.pm', # finds $VERSION 8 PREREQ_PM => {}, # e.g., Module::Name => 1.1 9 ($] >= 5.005 ? ## Add these new keywords supported since 5.005 10 (ABSTRACT_FROM => 'lib/Digest/FNV.pm', # retrieve abstract from module 11 AUTHOR => 'Jeffrey Webster <jwebster@localdomain>') : ()), 12 LIBS => [''], # e.g., '-lm' 13 DEFINE => '', # e.g., '-DHAVE_SOMETHING' 14 INC => '-I.', # e.g., '-I. -I/usr/include/other' 15 # Un-comment this if you add C files to link with later: 16 # OBJECT => '$(O_FILES)', # link all the C files too 17 'MYEXTLIB' => 'fnvlib/libfnv$(LIB_EXT)' 18); 19if (eval {require ExtUtils::Constant; 1}) { 20 # If you edit these definitions to change the constants used by this module, 21 # you will need to use the generated const-c.inc and const-xs.inc 22 # files to replace their "fallback" counterparts before distributing your 23 # changes. 24 my @names = (qw(FNV0_32 FNV0_32_INIT FNV0_64 FNV0_64_INIT FNV1A_64_INIT 25 FNV1_32 FNV1_32A_INIT FNV1_32_INIT FNV1_64 FNV1_64_INIT 26 FNV1a_32 FNV1a_64 FNV_NONE)); 27 ExtUtils::Constant::WriteConstants( 28 NAME => 'Digest::FNV', 29 NAMES => \@names, 30 DEFAULT_TYPE => 'IV', 31 C_FILE => 'const-c.inc', 32 XS_FILE => 'const-xs.inc', 33 ); 34 35} 36else { 37 use File::Copy; 38 use File::Spec; 39 foreach my $file ('const-c.inc', 'const-xs.inc') { 40 my $fallback = File::Spec->catfile('fallback', $file); 41 copy ($fallback, $file) or die "Can't copy $fallback to $file: $!"; 42 } 43} 44 45sub MY::postamble { 46' 47$(MYEXTLIB): fnvlib/Makefile 48 cd fnvlib && $(MAKE) $(PASSTHRU) 49'; 50} 51