Commit | Line | Data |
---|---|---|
6b09c160 YST |
1 | package ExtUtils::CBuilder::Platform::Unix; |
2 | ||
3 | use strict; | |
4 | use ExtUtils::CBuilder::Base; | |
5 | ||
6 | use vars qw($VERSION @ISA); | |
7 | $VERSION = '0.01'; | |
8 | @ISA = qw(ExtUtils::CBuilder::Base); | |
9 | ||
10 | sub 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 | ||
29 | 1; |