<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package ExtUtils::CBuilder::Platform::Unix;

use warnings;
use strict;
use ExtUtils::CBuilder::Base;

our $VERSION = '0.280240'; # VERSION
our @ISA = qw(ExtUtils::CBuilder::Base);

sub link_executable {
  my $self = shift;

  # On some platforms (which ones??) $Config{cc} seems to be a better
  # bet for linking executables than $Config{ld}.  Cygwin is a notable
  # exception.
  local $self-&gt;{config}{ld} =
    $self-&gt;{config}{cc} . " " . $self-&gt;{config}{ldflags};
  return $self-&gt;SUPER::link_executable(@_);
}

sub link {
  my $self = shift;
  my $cf = $self-&gt;{config};

  # Some platforms (notably Mac OS X 10.3, but some others too) expect
  # the syntax "FOO=BAR /bin/command arg arg" to work in %Config
  # (notably $Config{ld}).  It usually works in system(SCALAR), but we
  # use system(LIST). We fix it up here with 'env'.

  local $cf-&gt;{ld} = $cf-&gt;{ld};
  if (ref $cf-&gt;{ld}) {
    unshift @{$cf-&gt;{ld}}, 'env' if $cf-&gt;{ld}[0] =~ /^\s*\w+=/;
  } else {
    $cf-&gt;{ld} =~ s/^(\s*\w+=)/env $1/;
  }

  return $self-&gt;SUPER::link(@_);
}

1;
</pre></body></html>