This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: [PATCH] ExtUtils-{ParseXS,CBuilder} into bleadperl (was: Re: [Module::Build]...
[perl5.git] / lib / ExtUtils / CBuilder / Platform / Unix.pm
CommitLineData
6b09c160
YST
1package ExtUtils::CBuilder::Platform::Unix;
2
3use strict;
4use ExtUtils::CBuilder::Base;
5
6use vars qw($VERSION @ISA);
7$VERSION = '0.01';
8@ISA = qw(ExtUtils::CBuilder::Base);
9
10sub link {
11 my $self = shift;
12 my $cf = $self->{config};
13
14 # Some platforms (notably Mac OS X 10.3, but some others too) expect
15 # the syntax "FOO=BAR /bin/command arg arg" to work in %Config
16 # (notably $Config{ld}). It usually works in system(SCALAR), but we
17 # use system(LIST). We fix it up here with 'env'.
18
19 local $cf->{ld} = $cf->{ld};
20 if (ref $cf->{ld}) {
21 unshift @{$cf->{ld}}, 'env' if $cf->{ld}[0] =~ /^\s*\w+=/;
22 } else {
23 $cf->{ld} =~ s/^(\s*\w+=)/env $1/;
24 }
25
26 return $self->SUPER::link(@_);
27}
28
291;