8 use ExtUtils::MakeMaker 5.16 ;
11 $WALL = ' -Wall -Wno-comment ' if $Config{'cc'} =~ /gcc/ ;
12 my $USE_PPPORT_H = ($ENV{PERL_CORE}) ? '' : '-DUSE_PPPORT_H';
15 my $BUILD_BZIP2 = defined($ENV{BUILD_BZIP2}) ? $ENV{BUILD_BZIP2} : 1;
16 my $BZIP2_LIB = defined($ENV{BZIP2_LIB}) ? $ENV{BZIP2_LIB} : 'bzip2-src';
17 my $BZIP2_INCLUDE = defined($ENV{BZIP2_INCLUDE}) ? $ENV{BZIP2_INCLUDE} : '.';
21 UpDowngrade(getPerlFiles('MANIFEST'))
22 unless $ENV{PERL_CORE};
25 NAME => 'Compress::Raw::Bzip2',
26 VERSION_FROM => 'lib/Compress/Raw/Bzip2.pm',
27 INC => "-I$BZIP2_INCLUDE" ,
28 DEFINE => "$WALL -DBZ_NO_STDIO $USE_PPPORT_H" ,
29 XS => { 'Bzip2.xs' => 'Bzip2.c'},
30 'clean' => { FILES => '*.c bzip2.h bzlib.h bzlib_private.h constants.h constants.xs' },
31 #'depend' => { 'Makefile' => 'config.in' },
32 'dist' => { COMPRESS => 'gzip',
35 DIST_DEFAULT => 'MyTrebleCheck tardist',
40 ? bzip2_files($BZIP2_LIB)
41 : (LIBS => [ "-L$BZIP2_LIB -lbz2 " ])
46 ? (ABSTRACT_FROM => 'lib/Compress/Raw/Bzip2.pm',
47 AUTHOR => 'Paul Marquess <pmqs@cpan.org>')
51 INSTALLDIRS => ($] > 5.010 && $] < 5.011 ? 'perl' : 'site'),
53 ( eval { ExtUtils::MakeMaker->VERSION(6.46) }
56 "meta-spec" => { version => 2 },
59 directory => [ 't', 'private' ],
65 web => 'https://github.com/pmqs/Compress-Raw-Bzip2/issues'
68 homepage => 'https://github.com/pmqs/Compress-Raw-Bzip2',
72 url => 'git://github.com/pmqs/Compress-Raw-Bzip2.git',
73 web => 'https://github.com/pmqs/Compress-Raw-Bzip2',
81 ((ExtUtils::MakeMaker->VERSION() gt '6.30') ?
82 ('LICENSE' => 'perl') : ()),
107 if (eval {require ExtUtils::Constant; 1}) {
108 # Check the constants above all appear in @EXPORT in Bzip2.pm
109 my %names = map { $_, 1} @names ; #, 'BZ_VERSION';
110 open F, "<lib/Compress/Raw/Bzip2.pm" or die "Cannot open Bzip2.pm: $!\n";
113 last if /^\s*\@EXPORT\s+=\s+qw\(/ ;
120 delete $names{$1} if defined $1 ;
126 my $missing = join ("\n\t", sort keys %names) ;
127 die "The following names are missing from \@EXPORT in Bzip2.pm\n" .
131 #push @names, {name => 'BZ_VERSION', type => 'PV' };
133 ExtUtils::Constant::WriteConstants(
136 C_FILE => 'constants.h',
137 XS_FILE => 'constants.xs',
142 foreach my $name (qw( constants.h constants.xs ))
144 my $from = catfile('fallback', $name);
146 or die "Can't copy $from to $name: $!";
165 my @h_files = qw( bzlib.h bzlib_private.h );
167 foreach my $file (@c_files, @h_files)
168 { copy(catfile($dir, $file), '.') }
171 @h_files = map { catfile($dir, $_) } @h_files ;
172 my @o_files = map { "$_\$(OBJ_EXT)" } 'Bzip2', @c_files;
173 push @c_files, 'Bzip2.c' ;
176 #'H' => [ @h_files ],
177 'C' => [ @c_files ] ,
178 #'OBJECT' => qq[ @o_files ],
179 'OBJECT' => q[ $(O_FILES) ],