-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile.PL
78 lines (66 loc) · 2.17 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 5.006001;
use ExtUtils::MakeMaker;
use lib qw( ./lib );
$ENV{PERL_TEXT_CSV} = 'Text::CSV_PP';
eval q| require Text::CSV |;
if ($@) {
print "Loading lib/Text/CSV.pm failed. No B module?\n";
print "perl says : $@";
print "Set the environmental variable 'PERL_DL_NONLAZY' with 0.\n";
print "No Makefile created.\n";
exit 0;
}
my $version = Text::CSV->VERSION;
my $req_xs_ver = Text::CSV->require_xs_version;
my $has_xs = 0;
my $message;
eval q| require Text::CSV_XS |;
$has_xs = 1 unless ($@);
my %xs_prereq;
if ($has_xs) {
my $xs_version = Text::CSV_XS->VERSION;
if ($xs_version >= $req_xs_ver) {
$message = "You have Text::CSV_XS (v.$xs_version), so Text::CSV can work very fast!!";
}
else {
%xs_prereq = ('Text::CSV_XS' => $req_xs_ver);
$message = "Your Text::CSV_XS version is $xs_version. If you install v.$req_xs_ver,\n"
. "Text::CSV will work faster.";
}
}
else {
$message = "If you install Text::CSV_XS v.$req_xs_ver, it makes Text::CSV faster.";
}
print <<EOF;
Welcome to Text::CSV (v.$version)
=============================
$message
EOF
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
'NAME' => 'Text::CSV',
'MIN_PERL_VERSION' => '5.006001',
'VERSION_FROM' => 'lib/Text/CSV.pm', # finds $VERSION
'ABSTRACT_FROM' => 'lib/Text/CSV.pm', # retrieve abstract from module
'AUTHOR' => 'Makamaka Hannyaharamitu, E<lt>makamaka[at]cpan.orgE<gt>',
'PREREQ_PM' => {
"IO::Handle" => 0,
"Test::More" => '0.92',
"Test::Harness" => 0,
%xs_prereq,
},
( $ExtUtils::MakeMaker::VERSION >= 6.3002 ? ('LICENSE' => 'perl', ) : () ),
( $ExtUtils::MakeMaker::VERSION >= 6.46 ? (
'META_MERGE' => {
recommends => {
'Text::CSV_XS' => Text::CSV->require_xs_version,
},
resources => {
repository => 'https://github.com/makamaka/Text-CSV',
bugtracker => 'https://github.com/makamaka/Text-CSV/issues',
license => 'http://dev.perl.org/licenses/',
},
} ) : ()
),
);