forked from mschilli/log4perl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.PL
92 lines (81 loc) · 2.94 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
# That's the minimum.
use 5.00503;
# If we're not 5.6.0, there's some corrections we need to make: Use
# 'use vars' instead of 'our' variables, get rid of 'use warnings'
# and other stuff. The eg/5005it.pl script takes care of it.
if($] < 5.006) {
require "eg/5005it.pl";
print <<EOT;
########################################################
# Hm, you're still using perl 5.005. Although I don't #
# condone that, I'll let it slip this time: #
# Changing distribution to be backwards compatible ... #
EOT
mk5005("t", "lib");
print <<EOT;
# Done. But do me a favour and upgrade soon. #
########################################################
EOT
}
# Check for Time::HiRes;
eval { require Time::HiRes; };
if($@) {
print "Warning: Time::HiRes not installed, but that's ok, " .
"%r will use full seconds\n";
}
my $meta_merge = {
META_MERGE => {
resources => {
repository => 'http://github.com/mschilli/log4perl',
MailingList => 'mailto:log4perl-devel@lists.sourceforge.net',
},
}
};
WriteMakefile(
'NAME' => 'Log::Log4perl',
'VERSION_FROM' => 'lib/Log/Log4perl.pm', # finds $VERSION
'PREREQ_PM' => { Test::More => 0.45,
File::Spec => 0.82,
}, # e.g., Module::Name => 1.1
($] >= 5.005 ? ## Add these new keywords supported since 5.005
(ABSTRACT_FROM => 'lib/Log/Log4perl.pm', # retrieve abstract from module
AUTHOR => 'Mike Schilli <m@perlmeister.com>') : ()),
'LIBS' => [''], # e.g., '-lm'
'DEFINE' => '', # e.g., '-DHAVE_SOMETHING'
# Insert -I. if you add *.h files later:
'INC' => '', # e.g., '-I/usr/include/other'
# Un-comment this if you add C files to link with later:
# 'OBJECT' => '$(O_FILES)', # link all the C files too
'clean' => {FILES => "*.tar.gz *.ppd pod2htm*"},
EXE_FILES => ["eg/l4p-tmpl"],
$ExtUtils::MakeMaker::VERSION >= 6.50 ? (%$meta_merge) : (),
get_man3pods(),
);
##########################################
sub get_man3pods {
##########################################
# Only done for versions < 5.8.0
return () if $] >= 5.008;
print <<EOT;
##################################################
# Detected buggy MakeMaker version, creating man #
# pages manually #
##################################################
EOT
require File::Find;
my @pms = ();
File::Find::find(sub {
push @pms, $File::Find::name if /\.pm$/
}, "lib");
return('MAN3PODS', {
map { my @comps = split /\//, $_;
shift @comps;
my $csep = join '::', @comps;
$csep =~ s/\.pm$//;
($_, "\$(INST_MAN3DIR)/$csep.\$(MAN3EXT)");
} @pms
});
}