Skip to content

Commit

Permalink
GH-320 Reorder potential library paths for macOS Monterey compatibility.
Browse files Browse the repository at this point in the history
Running 'perl Makefile.PL' may fail with:
   WARNING: .../perl is loading libcrypto in an unsafe way

See #329
and https://openradar.appspot.com/FB9725981 (linked by GH-329) for
more information.

To summarise why this commit helps in this case:

  The failure is triggered when the prospective library directory exists but
  does not contain the desired library file. That is, $prefix/lib64 does not
  trigger the failure because the directory pointed by OPENSSL_PREFIX does not
  contain lib64 subdirectory.
  • Loading branch information
h-vn committed Dec 29, 2021
1 parent 9804a17 commit b9660c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ sub ssleay_get_build_opts {
}
}

for ($prefix, "$prefix/lib64", "$prefix/lib", "$prefix/out32dll") {
# Note: the order matters for macOS Monterey.
for ("$prefix/lib64", "$prefix/lib", "$prefix/out32dll", $prefix) {
push @{$opts->{lib_paths}}, $_ if -d $_;
}

Expand Down

0 comments on commit b9660c8

Please sign in to comment.