@@ -86,7 +86,7 @@ pushd Python-${PYTHON_VERSION}
86
86
# configure doesn't support cross-compiling on Apple. Teach it.
87
87
patch -p1 << "EOF "
88
88
diff --git a/configure b/configure
89
- index 2d379feb4b..3eb8dbe9ea 100755
89
+ index 1252335472..6665645839 100755
90
90
--- a/configure
91
91
+++ b/configure
92
92
@@ -3301,6 +3301,15 @@ then
@@ -125,7 +125,31 @@ index 2d379feb4b..3eb8dbe9ea 100755
125
125
*-*-vxworks*)
126
126
_host_cpu=$host_cpu
127
127
;;
128
- @@ -5968,7 +5996,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>confdefs.h
128
+ @@ -3359,7 +3381,22 @@ if test "$cross_compiling" = yes; then
129
+ MACHDEP="unknown"
130
+ as_fn_error $? "cross build not supported for $host" "$LINENO" 5
131
+ esac
132
+ - _PYTHON_HOST_PLATFORM="$MACHDEP${_host_cpu:+-$_host_cpu}"
133
+ +
134
+ + case "$host" in
135
+ + # The _PYTHON_HOST_PLATFORM environment variable is used to
136
+ + # override the platform name in distutils and sysconfig when
137
+ + # cross-compiling. On Apple, the platform name expansion logic
138
+ + # is non-trivial, including renaming MACHDEP=darwin to macosx
139
+ + # and including the deployment target (or current OS version if
140
+ + # not set). Our hack here is not generic, but gets the job done
141
+ + # for python-build-standalone's cross-compile use cases.
142
+ + aarch64-apple-darwin*)
143
+ + _PYTHON_HOST_PLATFORM="macosx-${MACOSX_DEPLOYMENT_TARGET}-arm64"
144
+ + ;;
145
+ + *)
146
+ + _PYTHON_HOST_PLATFORM="$MACHDEP${_host_cpu:+-$_host_cpu}"
147
+ + esac
148
+ +
149
+ fi
150
+
151
+ # Some systems cannot stand _XOPEN_SOURCE being defined at all; they
152
+ @@ -5968,7 +6005,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>confdefs.h
129
153
BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(LDVERSION)'
130
154
RUNSHARED=SHLIB_PATH=`pwd`${SHLIB_PATH:+:${SHLIB_PATH}}
131
155
;;
@@ -134,7 +158,7 @@ index 2d379feb4b..3eb8dbe9ea 100755
134
158
LDLIBRARY='libpython$(LDVERSION).dylib'
135
159
BLDLIBRARY='-L. -lpython$(LDVERSION)'
136
160
RUNSHARED=DYLD_LIBRARY_PATH=`pwd`${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}
137
- @@ -6205,16 +6233 ,6 @@ esac
161
+ @@ -6205,16 +6242 ,6 @@ esac
138
162
fi
139
163
fi
140
164
@@ -151,7 +175,7 @@ index 2d379feb4b..3eb8dbe9ea 100755
151
175
case $MACHDEP in
152
176
hp*|HP*)
153
177
# install -d does not work on HP-UX
154
- @@ -9541,6 +9559 ,11 @@ then
178
+ @@ -9541,6 +9568 ,11 @@ then
155
179
BLDSHARED="$LDSHARED"
156
180
fi
157
181
;;
0 commit comments