Skip to content

hints/darwin.sh: skip ldflags in lddlflags #23227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: blead
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 7 additions & 28 deletions hints/darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -277,24 +277,25 @@ add_macosx_version_min () {
# But starting from perl 5.8.1/Darwin 7 the default is the two-level.
case "$osvers" in # Note: osvers is the kernel version, not the 10.x
1.[0-3].*) # OS X 10.0.x
lddlflags="${ldflags} -bundle -undefined suppress"
lddlflags="-bundle -undefined suppress"
;;
1.*) # OS X 10.1
ldflags="${ldflags} -flat_namespace"
lddlflags="${ldflags} -bundle -undefined suppress"
lddlflags="-bundle -undefined suppress"
;;
[2-6].*) # OS X 10.1.x - 10.2.x (though [2-4] never existed publicly)
ldflags="${ldflags} -flat_namespace"
lddlflags="${ldflags} -bundle -undefined suppress"
lddlflags="-bundle -undefined suppress"
;;
[7-8].*) # OS X 10.3.x - 10.4.x
lddlflags="${ldflags} -bundle -undefined dynamic_lookup"
lddlflags="-bundle -undefined dynamic_lookup"
case "$ld" in
*MACOSX_DEPLOYMENT_TARGET*) ;;
*) ld="env MACOSX_DEPLOYMENT_TARGET=10.3 ${ld}" ;;
esac
;;
*) # OS X 10.5.x - current
lddlflags="-bundle -undefined dynamic_lookup"
# The MACOSX_DEPLOYMENT_TARGET is not needed,
# but the -mmacosx-version-min option is always used.

Expand All @@ -304,6 +305,7 @@ case "$osvers" in # Note: osvers is the kernel version, not the 10.x
[1-9][0-9].*)
add_macosx_version_min ccflags $MACOSX_DEPLOYMENT_TARGET
add_macosx_version_min ldflags $MACOSX_DEPLOYMENT_TARGET
add_macosx_version_min lddlflags $MACOSX_DEPLOYMENT_TARGET
;;
'')
# Empty MACOSX_DEPLOYMENT_TARGET is okay.
Expand All @@ -313,35 +315,13 @@ case "$osvers" in # Note: osvers is the kernel version, not the 10.x

*** Unexpected MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET
***
*** Please either set it to a valid macOS version number (e.g., 10.15) or to empty.
*** Please either set it to a valid macOS version number (e.g., 10.15 or 11.0) or to empty.

EOM
exit 1
;;
esac

# Keep the prodvers leading whitespace (Configure magic).
# Cannot use $osvers here since that is the kernel version.
# sw_vers output what we want
# "ProductVersion: 10.10.5" "10.10"
# "ProductVersion: 10.11" "10.11"
prodvers=`sw_vers|awk '/^ProductVersion:/{print $2}'|awk -F. '{print $1"."$2}'`
case "$prodvers" in
[1-9][0-9].*)
add_macosx_version_min ccflags $prodvers
add_macosx_version_min ldflags $prodvers
;;
*)
cat <<EOM >&4

*** Unexpected product version $prodvers.
***
*** Try running sw_vers and see what its ProductVersion says.

EOM
exit 1
esac

darwin_major=$(echo $osvers|awk -F. '{print $1}')

# macOS 10.12 (darwin 16.0.0) deprecated syscall().
Expand All @@ -357,7 +337,6 @@ EOM
esac
fi

lddlflags="${ldflags} -bundle -undefined dynamic_lookup"
;;
esac

Expand Down
Loading