-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.PL
65 lines (50 loc) · 1.47 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
use inc::Module::Install;
use File::Spec;
# check OS and version
die 'OS unsupported' unless ($^O eq 'darwin');
name 'Cocoa-Skype';
all_from 'lib/Cocoa/Skype.pm';
requires 'File::ShareDir';
test_requires 'Test::More' => '0.88';
use_ppport '3.19';
if ($ENV{DEBUG}) {
cc_append_to_ccflags '-g', '-DDEBUG';
}
cc_append_to_ccflags sprintf '-I%s',
File::Spec->rel2abs(File::Spec->catfile('share', 'Skype.framework', 'Versions', 'A', 'Headers'));
makemaker_args->{dynamic_lib} = {
OTHERLDFLAGS => '-framework Foundation',
};
install_share;
{
# http://www.mail-archive.com/makemaker@perl.org/msg02823.html
# Add some required machinery to support .m files
package MY;
sub c_o {
my $inherited = shift->SUPER::c_o(@_);
$inherited .= <<'EOMESS';
.m$(OBJ_EXT):
$(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.m
EOMESS
$inherited;
}
sub xs_c {
my $inherited = shift->SUPER::xs_c(@_);
$inherited .= <<'EOMESS';
.xs.m:
$(XSUBPPRUN) $(XSPROTOARG) $(XSUBPPARGS) $(XSUBPP_EXTRA_ARGS) $*.xs > $*.xsm && $(MV) $*.xsm $*.m
EOMESS
$inherited;
}
sub init_dirscan {
my $self = shift;
$self->SUPER::init_dirscan;
foreach my $name ($self->lsdir($self->curdir)) {
next unless $name =~ /\.m$/;
push @{$self->{'C'}}, $name;
$name =~ s/\.m$/$self->{'OBJ_EXT'}/;
push @{$self->{'O_FILES'}}, $name;
}
}
}
WriteAll;