-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathBuild.PL
78 lines (72 loc) · 1.85 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
use strict;
use warnings;
use File::Spec;
use Module::Build;
use Alien::TinyCCx;
#### --( Make the builder )-- ####
my $build = Module::Build->subclass(code => q{
sub link_c {
my ($self, $spec) = @_;
if ($spec->{module_name} eq 'C::Blocks') {
return $self->SUPER::link_c($spec, @_);
}
else {
# Don't link C source file objects to anything but the main lib
local $self->{properties}->{objects} = [];
return $self->SUPER::link_c($spec, @_);
}
}
})->new(
module_name => 'C::Blocks',
license => 'perl',
dist_author => q{David Mertens <[email protected]>},
configure_requires => {
'Alien::TinyCCx' => '0.12',
# meta_merge was added in v 0.28:
'Module::Build' => 0.28,
},
build_requires => {
'Test::More' => 0.88,
# For configuration, path to tcc, etc
'Alien::TinyCCx' => '0.12',
# For PerlAPI
'Capture::Tiny' => 0,
'ExtUtils::CBuilder' => 0,
'ExtUtils::Config' => 0,
'ExtUtils::Embed' => 0,
'ExtUtils::ParseXS' => 3.0,
'File::Spec' => 0,
'File::Basename' => 0,
'File::Temp' => 0,
'File::Spec' => 0,
'Test::Warn' => 0,
},
requires => {
'Alien::TinyCCx' => '0.12',
'File::ShareDir' => 0,
'File::Spec' => 0,
},
c_source => 'src',
needs_compiler => 1,
dynamic_config => 1,
include_dirs => [Alien::TinyCCx->libtcc_include_path, '.', 'src'],
extra_linker_flags => [Alien::TinyCCx->MB_linker_flags],
meta_merge => {
resources => {
repository => "http://github.com/run4flat/C-Blocks",
bugtracker => "http://github.com/run4flat/C-Blocks/issues",
},
no_index => {
file => [ 'README.pod' ],
},
},
share_dir => 'share',
add_to_cleanup => [
'names.txt',
File::Spec->catfile(qw(share perl.h.cache)),
],
);
$build->create_build_script;
# Explicit cleanup of these, just in case, to avoid unnecessary confusion
unlink('names.txt');
unlink File::Spec->catfile(qw(share perl.h.cache));