-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.PL
122 lines (111 loc) · 3.35 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/usr/bin/perl
# Copyright (c) 2011-2013 H.Merijn Brand
require 5.008004;
use strict;
use ExtUtils::MakeMaker;
use Config;
my $gnokii_lib = "";
my $gnokii_inc = "";
if (exists $ENV{GNOKII_DIR} && -d $ENV{GNOKII_DIR}) {
my $gdir = $ENV{GNOKII_DIR};
$gnokii_lib = join " " => map { "-L$gdir$_" } "", "common/.libs";
$gnokii_inc = "-I$gdir/include -I$gdir/gnokii";
}
else {
my $ext = $Config{dlext};
grep { -x "$_/libgnokii.$Config{dlext}" ||
-x "$_/libgnokii.a"
} split m/\s+/ => $Config{libpth} or
die "libgnokii not found. Unpack and compile, and set \$GNOKII_DIR\n";
}
WriteMakefile (
NAME => "GSM::Gnokii",
DISTNAME => "GSM-Gnokii",
ABSTRACT => "API to libgnokii",
AUTHOR => "H.Merijn Brand <h.merijn\@xs4all.nl>",
LICENSE => "perl",
MIN_PERL_VERSION => "5.008004",
VERSION_FROM => "lib/GSM/Gnokii.pm",
PREREQ_PM => { "DynaLoader" => 0,
"Config" => 0,
"Test::More" => 0,
"Test::Harness" => 0,
"Data::Peek" => 0.32,
"JSON" => 0,
},
LIBS => [ "$gnokii_lib -lgnokii" ],
TYPEMAPS => [ "perlobject.map" ],
DEFINE => "",
INC => $gnokii_inc,
macro => { GCC_WALL => (join " " => qw(
-Wall -Wextra -Wbad-function-cast -Wcomment -Wcomments
-Wformat -Wdisabled-optimization -Wmissing-prototypes
-Werror-implicit-function-declaration -Wmissing-noreturn
-Wmissing-format-attribute -Wno-cast-qual -Wunused-value
-Wno-sign-compare -Wpointer-arith -Wreturn-type -Wshadow
-Wswitch-default -Wuninitialized -Wunreachable-code
-Wundef -Wunused
)), # add -Wunused-but-set-variable for gcc-4.6
"#OPTIMIZE" => "-O2 \$(GCC_WALL)",
TARFLAGS => "--format=ustar -c -v -f",
},
);
1;
package MY;
sub postamble
{
my $valgrind = join " ", qw(
PERL_DESTRUCT_LEVEL=2 PERL_DL_NONLAZY=1
valgrind
--suppressions=sandbox/perl.supp
--leak-check=yes
--leak-resolution=high
--show-reachable=yes
--num-callers=50
--log-fd=3
$(FULLPERLRUN) "-MExtUtils::Command::MM" "-e"
"test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')"
$(TEST_FILES) 3>valgrind.log
);
my $min_vsn = ($] >= 5.010 && -d "xt" && -d "tmp" && ($ENV{AUTOMATED_TESTING} || 0) != 1)
? join "\n" =>
'test ::',
' -@env TEST_FILES="xt/*.t" make -e test_dynamic',
''
: "";
join "\n" =>
'cover test_cover:',
' ccache -C',
' -@rm -f *.gc??',
' cover -test',
'',
'leakcheck:',
" $valgrind",
' -@tail -14 valgrind.log',
'',
'leaktest:',
q{ sandbox/leaktest $(FULLPERLRUN) "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES)},
'',
'leaktrace:',
q{ sandbox/leaktrace $(FULLPERLRUN) "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES)},
'',
'spellcheck:',
' pod-spell-check --aspell',
'',
'checkmeta: spellcheck',
' perl sandbox/genPPPort_h.pl',
' perl sandbox/genMETA.pl -c',
'',
'fixmeta: distmeta',
' perl sandbox/genMETA.pl',
'',
'tgzdist: checkmeta fixmeta $(DISTVNAME).tar.gz distcheck',
' -@mv -f $(DISTVNAME).tar.gz $(DISTVNAME).tgz',
' -@cpants_lint.pl $(DISTVNAME).tgz',
' -@rm -f Debian_CPANTS.txt',
'',
'test_speed: pure_all',
' PERL_DL_NONLAZY=1 $(FULLPERLRUN) -I"$(INST_LIB)" -I"$(INST_ARCHLIB)" examples/speed.pl',
'',
$min_vsn;
} # postamble