Subject: | [Fwd: Overrides to allow Objective-C] |
Date: | Sun, 26 Apr 2009 14:42:45 -0700 |
To: | via RT <bug-ExtUtils-MakeMaker [...] rt.cpan.org> |
From: | Michael G Schwern <schwern [...] pobox.com> |
Show quoted text
-------- Original Message --------
Subject: Overrides to allow Objective-C
Date: Sat, 4 Apr 2009 11:25:22 -0400
From: Sherm Pendley <sherm.pendley@gmail.com>
To: makemaker@perl.org
Attached is my Makefile.PL, with a few MY::* methods to allow the use of
Objective-C.
sherm--
--
Being faith-based doesn't trump reality.
-- Bruce Sterling
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'Mac::BridgeSupport',
VERSION_FROM => 'lib/Mac/BridgeSupport.pm',
ABSTRACT_FROM => 'lib/Mac/BridgeSupport.pm',
AUTHOR => 'Sherm Pendley <sherm@sherm.pendley@gmail.com>',
LIBS => ['-lobjc'],
INC => '-I.',
XS => { 'BridgeSupport.xs' => 'BridgeSupport.m' },
OBJECT => '$(O_FILES)',
);
# 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;
}
}