Skip to content

Commit 1f30e27

Browse files
ryandesignkhwilliamson
authored andcommitted
Resolve any symlinks to cwd in dylib install name
When the perl executable is installed by the installperl script, its function `fix_dep_names` uses the perl function `getcwd` to determine the current directory and uses it to change the path by which libperl.dylib is referenced from the perl executable. `getcwd` resolves symlinks. At build time, the install name was set using a path constructed using the shell command `pwd` which returns the current directory without resolving symlinks. This mismatch causes the executable to be installed with the wrong path reference to the library in the case where the user has created a symlink to the source directory and `cd`'d to that symlink rather than to the real source directory. This was discovered while building perl in MacPorts 2.11.2 which does exactly that. See https://trac.macports.org/ticket/72715 Fix by using `pwd -P` instead which does resolve symlinks.
1 parent 604d1d0 commit 1f30e27

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Makefile.SH

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ true)
6464
${revision}.${patchlevel}.${subversion}"
6565
case "$osvers" in
6666
1[5-9]*|[2-9]*)
67-
shrpldflags="$shrpldflags -install_name `pwd`/\$@ -Xlinker -headerpad_max_install_names"
67+
shrpldflags="$shrpldflags -install_name `pwd -P`/\$@ -Xlinker -headerpad_max_install_names"
6868
exeldflags="-Xlinker -headerpad_max_install_names"
6969
;;
7070
*)

0 commit comments

Comments
 (0)