Skip to content

Commit

Permalink
Don't use rpath for macOS <= 10.4
Browse files Browse the repository at this point in the history
Mac OS X 10.4 and earlier do not support -rpath. Fixes issue Perl-Toolchain-Gang#410 by
including patch given in

macports/macports-ports#13529
  • Loading branch information
hakonhagland committed Dec 29, 2021
1 parent 8993fab commit 06fe284
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/ExtUtils/MM_Unix.pm
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ BEGIN {
grep( $^O eq $_, qw(bsdos interix dragonfly) )
);
$Is{Android} = $^O =~ /android/;
if ( $^O eq 'darwin' && $^X eq '/usr/bin/perl' ) {
if ( $^O eq 'darwin' ) {
my @osvers = split /\./, $Config{osvers};
$Is{ApplCor} = ( $osvers[0] >= 18 );
if ( $^X eq '/usr/bin/perl' ) {
$Is{ApplCor} = ( $osvers[0] >= 18 );
}
$Is{AppleRPath} = ( $osvers[0] >= 9 );
}
}

Expand Down Expand Up @@ -1054,7 +1057,7 @@ sub xs_make_dynamic_lib {
if ( $Is{IRIX} ) {
$ldrun = qq{-rpath "$self->{LD_RUN_PATH}"};
}
elsif ( $^O eq 'darwin' ) {
elsif ( $^O eq 'darwin' && $Is{AppleRPath} ) {
# both clang and gcc support -Wl,-rpath, but only clang supports
# -rpath so by using -Wl,-rpath we avoid having to check for the
# type of compiler
Expand Down

0 comments on commit 06fe284

Please sign in to comment.