From 30c0f6a675bd586c50820838f0814817b1b5ae92 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 2 Aug 2025 15:22:14 +0200 Subject: [PATCH] Fix readlink problem in configure build under macOS < 12 Don't use "readlink -f" as readlink doesn't support this option in macOS 11 and earlier. Just construct the full path ourselves instead. Closes #25675. --- configure | 10 ++++++---- configure.in | 10 ++++++---- docs/changes.txt | 1 + 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/configure b/configure index ff442b5c9f..7744c050b0 100755 --- a/configure +++ b/configure @@ -34271,15 +34271,17 @@ rm -f core conftest.err conftest.$ac_objext \ DYLIB_RPATH_POSTLINK="${HOST_PREFIX}install_name_tool -id \$@ \$@" cat <change-install-names #!/bin/sh +set -e +libdir=\$(cd lib ; pwd -P) libnames=\$(cd lib ; ls -1 libwx*${WX_RELEASE}.dylib) changes='' for dep in \${libnames} ; do - target=\$(readlink -f \${4}/\${dep}) - changes="\${changes} -change \${target} \${3}/\${dep}" + target=\$(readlink \${4}/\${dep}) + changes="\${changes} -change \${libdir}\${target} \${3}/\${dep}" done for i in \${libnames} ; do - lib=\$(readlink -f \${1}/\${i}) - ${HOST_PREFIX}install_name_tool \${changes} -id \${3}/\${i} \${lib} + lib=\$(readlink \${1}/\${i}) + ${HOST_PREFIX}install_name_tool \${changes} -id \${3}/\${i} \${libdir}/\${lib} done if test -f "\${2}/wxrc-${WX_RELEASE}" ; then diff --git a/configure.in b/configure.in index 9e119382a8..1b4e2b385e 100644 --- a/configure.in +++ b/configure.in @@ -4142,15 +4142,17 @@ if test "$wxUSE_SHARED" = "yes"; then DYLIB_RPATH_POSTLINK="${HOST_PREFIX}install_name_tool -id \$@ \$@" cat <change-install-names #!/bin/sh +set -e +libdir=\$(cd lib ; pwd -P) libnames=\$(cd lib ; ls -1 libwx*${WX_RELEASE}.dylib) changes='' for dep in \${libnames} ; do - target=\$(readlink -f \${4}/\${dep}) - changes="\${changes} -change \${target} \${3}/\${dep}" + target=\$(readlink \${4}/\${dep}) + changes="\${changes} -change \${libdir}\${target} \${3}/\${dep}" done for i in \${libnames} ; do - lib=\$(readlink -f \${1}/\${i}) - ${HOST_PREFIX}install_name_tool \${changes} -id \${3}/\${i} \${lib} + lib=\$(readlink \${1}/\${i}) + ${HOST_PREFIX}install_name_tool \${changes} -id \${3}/\${i} \${libdir}/\${lib} done if test -f "\${2}/wxrc-${WX_RELEASE}" ; then diff --git a/docs/changes.txt b/docs/changes.txt index cfd2dea11e..53658185c4 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -285,6 +285,7 @@ wxOSX: - Fix crash on startup when using Farsi as system language (#25561). - Do not activate "Close" button on Cmd-C (nobugshere, #25346). - Fix memory leak in wxColour::Set() (#25569). +- Fix regression with configure build under macOS < 12 (#25675). 3.2.8.1: (released 2025-05-25)