forked from sanko/digest-xxhash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuild.PL
54 lines (49 loc) · 1.67 KB
/
Build.PL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
use strict;
use Module::Build;
# Annoyingly with 'c_source' Module::Build can *only* add entire directory
# *trees* recursively. This (no longer) works for xxHash, because their checkout
# now contains a subdirectory with test programs, including multiple definitions
# of main(), and the naive Module::Build approach attempts to link all object
# files into one shared library, which isn't going to work in that case.
# So we have to hack it. Grrr.
my $class = Module::Build->subclass (
class => 'My::Builder',
code => <<'EOC',
sub process_support_files {
my $self = shift;
my $p = $self->{properties};
push @{$p->{objects}}, $self->compile_c('ext/xxHash/xxhash.c');
return $self->SUPER::process_support_files(@_);
}
EOC
);
my $build = $class->new(
module_name => 'Digest::xxHash',
license => 'bsd',
create_readme => 1,
configure_requires => {
'Module::Build' => '0.4229' # xs
},
build_requires => {
'ExtUtils::CBuilder' => 0,
'Test::More' => 0
},
requires => {
'Math::Int64' => '0.53' # 32bit perl without int64 :\
},
needs_compiler => 1,
#extra_compiler_flags => ['-Wall -W -Wundef -Wno-implicit-function-declaration'],
#extra_linker_flags => [ ],
include_dirs => ['.', 'ext/xxHash'],
c_source => ['ext/perl_math_int64'],
xs_files => {
'./xxHash.xs' => 'lib/Digest/xxHash.xs'
},
meta_merge => {
resources => {
bugtracker => 'https://github.com/sanko/digest-xxhash/issues',
repository => 'https://github.com/sanko/digest-xxhash'
}
}
);
$build->create_build_script;