diff --git a/Modules/makesetup b/Modules/makesetup index 586e26dd5891b0..bd33c8fb2804c7 100755 --- a/Modules/makesetup +++ b/Modules/makesetup @@ -282,7 +282,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' | # there's actually only one obj, so just set it to the lib for lib in $libs do - objs="target/\$(CARGO_TARGET_DIR)/$lib" + objs="target/\$(if \$(CARGO_TARGET),\$(CARGO_TARGET)/\$(CARGO_TARGET_DIR),\$(CARGO_TARGET_DIR))/$lib" done libs= # depends on the headers through cpython-sys diff --git a/configure b/configure index 8af7ee0e042e81..98175608ffa45a 100755 --- a/configure +++ b/configure @@ -16110,6 +16110,15 @@ else aarch64-apple-ios-simulator) CARGO_TARGET="aarch64-apple-ios-sim" ;; + *-apple-darwin*) + cargo_host="$host" + case "$cargo_host" in + arm64-apple-*) + cargo_host="aarch64${cargo_host#arm64}" + ;; + esac + CARGO_TARGET="${cargo_host%%-apple-darwin*}-apple-darwin" + ;; *) CARGO_TARGET="$host" ;; @@ -36175,4 +36184,3 @@ if test "$ac_cv_header_stdatomic_h" != "yes"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Your compiler or platform does have a working C11 stdatomic.h. A future version of Python may require stdatomic.h." >&5 printf "%s\n" "$as_me: Your compiler or platform does have a working C11 stdatomic.h. A future version of Python may require stdatomic.h." >&6;} fi - diff --git a/configure.ac b/configure.ac index a3cc99c8add8c3..91633ebbf342ae 100644 --- a/configure.ac +++ b/configure.ac @@ -4333,6 +4333,15 @@ else aarch64-apple-ios-simulator) CARGO_TARGET="aarch64-apple-ios-sim" ;; + *-apple-darwin*) + cargo_host="$host" + case "$cargo_host" in + arm64-apple-*) + cargo_host="aarch64${cargo_host#arm64}" + ;; + esac + CARGO_TARGET="${cargo_host%%-apple-darwin*}-apple-darwin" + ;; *) CARGO_TARGET="$host" ;;