-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile.PL
77 lines (67 loc) · 1.83 KB
/
Makefile.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
use strict;
use utf8;
use Config;
use FindBin;
use ExtUtils::MakeMaker;
my $source_dir = $FindBin::Bin ."/third_party/modest/include";
my $port = "posix";
my $modest_source = "third_party/modest/source";
my $libs = [];
if ($^O =~ /MSWin/i) {
$port = 'windows_nt';
} else {
$libs = ["-lpthread", "-lm"];
}
my $defines = "";
if ($^O =~ /openbsd|netbsd|freebsd/i) {
# Simulates mutex using semaphore
# Because MyHTML call phtread_mutex_unlock without before call phtread_mutex_lock
# And it crashes on OpenBSD
warn("Detected *BSD - switch from mutex to semaphore\n");
$defines = " -DMyCORE_USE_SEMAPHORE_INSTEAD_OF_MUTEX ";
}
my $sources = [
"DOM.o",
"utils.o",
"modest_modest.o",
"modest_mycore.o",
"modest_mycss.o",
"modest_myencoding.o",
"modest_myfont.o",
"modest_myhtml.o",
"modest_myport.o",
"modest_myurl.o"
];
WriteMakefile(
dist => {
PREOP => 'pod2text lib/HTML5/DOM.pod > README',
COMPRESS => 'gzip -9v',
SUFFIX => '.gz',
},
AUTHOR => 'Kirill Zhumarin <[email protected]>',
ABSTRACT => 'Super fast html5 DOM library with css selectors (based on Modest/MyHTML)',
VERSION_FROM => 'lib/HTML5/DOM.pm',
NAME => 'HTML5::DOM',
LICENSE => 'MIT',
LINKTYPE => 'dynamic',
LIBS => $libs,
DEFINE => $defines,
CCFLAGS => " -std=c99 ".$Config{ccflags},
INC => "-I$source_dir",
OBJECT => join(" ",@$sources),
test => {TESTS => 't/*.t t/*/*.t'},
(eval { ExtUtils::MakeMaker->VERSION(6.48) } ? (MIN_PERL_VERSION => 5.006) : ()),
(eval { ExtUtils::MakeMaker->VERSION(6.46) } ? (META_MERGE => {
'meta-spec' => { version => 2 },
resources => {
repository => {
type => 'git',
url => 'https://github.com/Azq2/perl-html5-dom.git',
web => 'https://github.com/Azq2/perl-html5-dom'
},
bugtracker => {
'web' => 'https://github.com/Azq2/perl-html5-dom/issues'
}
}}) : ()
),
);