Debian Codegraph @

Makefile.PL

raw symbols SCIP
1 #! perl -w
2
3 use strict ;
4 require 5.008 ;
5
6 use lib '.';
7 use private::MakeUtil;
8 use ExtUtils::MakeMaker 5.16 ;
9
10 my $WALL= '';
11 $WALL = ' -Wall -Wno-comment '
12 if $Config{'cc'} =~ /gcc/ ;
13 my $USE_PPPORT_H = ($ENV{PERL_CORE}) ? '' : '-DUSE_PPPORT_H';
14
15
16 my $BUILD_BZIP2 = getBoolean('BUILD_BZIP2');
17 my $BZIP2_LIB = defined($ENV{BZIP2_LIB}) ? $ENV{BZIP2_LIB} : 'bzip2-src';
18 my $BZIP2_INCLUDE = defined($ENV{BZIP2_INCLUDE}) ? $ENV{BZIP2_INCLUDE} : '.';
19
20 #ParseCONFIG() ;
21
22 WriteMakefile(
23 NAME => 'Compress::Raw::Bzip2',
24 VERSION_FROM => 'lib/Compress/Raw/Bzip2.pm',
25 INC => "-I$BZIP2_INCLUDE" ,
26 DEFINE => "$WALL -DBZ_NO_STDIO $USE_PPPORT_H" ,
27 XS => { 'Bzip2.xs' => 'Bzip2.c'},
28 clean => { FILES => '*.c bzip2.h bzlib.h bzlib_private.h constants.h constants.xs' },
29 depend => { manifypods => 'READMEmd' },
30 postamble => { name => 'Bzip2'},
31 dist => { COMPRESS => 'gzip',
32 TARFLAGS => '-chvf',
33 SUFFIX => 'gz',
34 DIST_DEFAULT => 'MyTrebleCheck tardist',
35 },
36
37 (
38 $BUILD_BZIP2
39 ? bzip2_files($BZIP2_LIB)
40 : (LIBS => [ "-L$BZIP2_LIB -lbz2 " ])
41 ),
42
43 ABSTRACT_FROM => 'lib/Compress/Raw/Bzip2.pm',
44 AUTHOR => 'Paul Marquess <[email protected]>',
45
46 INSTALLDIRS => ($] > 5.010 && $] < 5.011 ? 'perl' : 'site'),
47
48 ( eval { ExtUtils::MakeMaker->VERSION(6.46) }
49 ? ( META_MERGE => {
50
51 "meta-spec" => { version => 2 },
52
53 no_index => {
54 directory => [ 't', 'private' ],
55 },
56
57 resources => {
58
59 bugtracker => {
60 web => 'https://github.com/pmqs/Compress-Raw-Bzip2/issues'
61 },
62
63 homepage => 'https://github.com/pmqs/Compress-Raw-Bzip2',
64
65 repository => {
66 type => 'git',
67 url => 'git://github.com/pmqs/Compress-Raw-Bzip2.git',
68 web => 'https://github.com/pmqs/Compress-Raw-Bzip2',
69 },
70 },
71 }
72 )
73 : ()
74 ),
75
76 ((ExtUtils::MakeMaker->VERSION() gt '6.30') ?
77 ('LICENSE' => 'perl') : ()),
78
79 ) ;
80
81 my @names = qw(
82 BZ_RUN
83 BZ_FLUSH
84 BZ_FINISH
85
86 BZ_OK
87 BZ_RUN_OK
88 BZ_FLUSH_OK
89 BZ_FINISH_OK
90 BZ_STREAM_END
91 BZ_SEQUENCE_ERROR
92 BZ_PARAM_ERROR
93 BZ_MEM_ERROR
94 BZ_DATA_ERROR
95 BZ_DATA_ERROR_MAGIC
96 BZ_IO_ERROR
97 BZ_UNEXPECTED_EOF
98 BZ_OUTBUFF_FULL
99 BZ_CONFIG_ERROR
100 );
101
102 if (eval {require ExtUtils::Constant; 1}) {
103 # Check the constants above all appear in @EXPORT in Bzip2.pm
104 my %names = map { $_, 1} @names ; #, 'BZ_VERSION';
105 open F, "<lib/Compress/Raw/Bzip2.pm" or die "Cannot open Bzip2.pm: $!\n";
106 while (<F>)
107 {
108 last if /^\s*\@EXPORT\s+=\s+qw\(/ ;
109 }
110
111 while (<F>)
112 {
113 last if /^\s*\)/ ;
114 /(\S+)/ ;
115 delete $names{$1} if defined $1 ;
116 }
117 close F ;
118
119 if ( keys %names )
120 {
121 my $missing = join ("\n\t", sort keys %names) ;
122 die "The following names are missing from \@EXPORT in Bzip2.pm\n" .
123 "\t$missing\n" ;
124 }
125
126 #push @names, {name => 'BZ_VERSION', type => 'PV' };
127
128 ExtUtils::Constant::WriteConstants(
129 NAME => 'Bzip2',
130 NAMES => \@names,
131 C_FILE => 'constants.h',
132 XS_FILE => 'constants.xs',
133
134 );
135 }
136 else {
137 foreach my $name (qw( constants.h constants.xs ))
138 {
139 my $from = catfile('fallback', $name);
140 copy ($from, $name)
141 or die "Can't copy $from to $name: $!";
142 }
143 }
144
145
146 sub bzip2_files
147 {
148 my $dir = shift ;
149
150 my @c_files = qw(
151 blocksort.c
152 huffman.c
153 crctable.c
154 randtable.c
155 compress.c
156 decompress.c
157 bzlib.c
158 );
159
160 my @h_files = qw( bzlib.h bzlib_private.h );
161
162 foreach my $file (@c_files, @h_files)
163 { copy(catfile($dir, $file), '.') }
164
165
166 @h_files = map { catfile($dir, $_) } @h_files ;
167 my @o_files = map { "$_\$(OBJ_EXT)" } 'Bzip2', @c_files;
168 push @c_files, 'Bzip2.c' ;
169
170 return (
171 'C' => [ @c_files ] ,
172 'OBJECT' => q[ $(O_FILES) ],
173 ) ;
174 }
175
176 sub getBoolean
177 {
178 my $name = shift ;
179
180 # default is TRUE
181 return 1
182 if ! defined $ENV{$name};
183
184 return ($ENV{$name} =~ /^yes|on|true|1$/i) ? 1 : 0;
185 }