Skip to content

Commit 9b42512

Browse files
hakonhaglandbingos
authored andcommitted
Don't use rpath for macOS <= 10.4
Mac OS X 10.4 and earlier do not support -rpath. Fixes issue #410 by including patch given in macports/macports-ports#13529
1 parent df34e2a commit 9b42512

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/ExtUtils/MM_Unix.pm

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@ BEGIN {
3838
grep( $^O eq $_, qw(bsdos interix dragonfly) )
3939
);
4040
$Is{Android} = $^O =~ /android/;
41-
if ( $^O eq 'darwin' && $^X eq '/usr/bin/perl' ) {
41+
if ( $^O eq 'darwin' ) {
4242
my @osvers = split /\./, $Config{osvers};
43-
$Is{ApplCor} = ( $osvers[0] >= 18 );
43+
if ( $^X eq '/usr/bin/perl' ) {
44+
$Is{ApplCor} = ( $osvers[0] >= 18 );
45+
}
46+
$Is{AppleRPath} = ( $osvers[0] >= 9 );
4447
}
4548
}
4649

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

0 commit comments

Comments
 (0)