@@ -57,8 +57,9 @@ CFLAGS-watchOS=-mwatchos-version-min=2.0
57
57
CFLAGS-watchos.armv7k = -fembed-bitcode
58
58
PYTHON_CONFIGURE-watchOS=ac_cv_func_sigaltstack =no
59
59
60
- # override machine for arm64
61
- MACHINE-arm64 =aarch64
60
+ # override machine types for arm64
61
+ MACHINE_DETAILED-arm64 =aarch64
62
+ MACHINE_SIMPLE-arm64 =arm
62
63
63
64
all : $(foreach os,$(OS ) ,$(os ) )
64
65
@@ -160,16 +161,22 @@ $(PYTHON_DIR-host)/dist/bin/python$(PYTHON_VER): $(PYTHON_DIR-host)/Makefile
160
161
# - $2 - OS
161
162
define build-target
162
163
ARCH-$1= $$(subst .,,$$(suffix $1) )
163
- ifdef MACHINE -$$(ARCH-$1)
164
- MACHINE -$1 = $$(MACHINE -$$(ARCH-$1 ) )
164
+ ifdef MACHINE_DETAILED -$$(ARCH-$1)
165
+ MACHINE_DETAILED -$1 = $$(MACHINE_DETAILED -$$(ARCH-$1 ) )
165
166
else
166
- MACHINE-$1 = $$(ARCH-$1 )
167
+ MACHINE_DETAILED-$1 = $$(ARCH-$1 )
168
+ endif
169
+ ifdef MACHINE_SIMPLE-$$(ARCH-$1)
170
+ MACHINE_SIMPLE-$1 = $$(MACHINE_SIMPLE-$$(ARCH-$1 ) )
171
+ else
172
+ MACHINE_SIMPLE-$1 = $$(ARCH-$1 )
167
173
endif
168
174
SDK-$1= $$(basename $1)
169
175
170
176
SDK_ROOT-$1= $$(shell xcrun --sdk $$(SDK-$1 ) --show-sdk-path)
171
- CC-$1= xcrun --sdk $$(SDK-$1 ) clang\
172
- -arch $$(ARCH-$1 ) --sysroot=$$(SDK_ROOT-$1 ) $$(CFLAGS-$2 ) $$(CFLAGS-$1 )
177
+ CC-$1= xcrun --sdk $$(SDK-$1 ) clang\
178
+ -arch $$(ARCH-$1 ) --sysroot=$$(SDK_ROOT-$1 ) $$(CFLAGS-$2 ) $$(CFLAGS-$1 )
179
+ LDFLAGS-$1= -arch $$(ARCH-$1 ) -isysroot=$$(SDK_ROOT-$1 )
173
180
174
181
OPENSSL_DIR-$1= build/$2/openssl-$(OPENSSL_VERSION ) -$1
175
182
BZIP2_DIR-$1= build/$2/bzip2-$(BZIP2_VERSION ) -$1
@@ -230,7 +237,9 @@ $$(XZ_DIR-$1)/Makefile: downloads/xz-$(XZ_VERSION).tgz
230
237
# Configure the build
231
238
cd $$(XZ_DIR-$1 ) && ./configure \
232
239
CC="$$(CC-$1 ) " \
233
- --host=$$(MACHINE-$1 ) -apple-ios --build=x86_64-apple-darwin$(shell uname -r) \
240
+ LDFLAGS="$$(LDFLAGS-$1 ) " \
241
+ --disable-shared --enable-static \
242
+ --host=$$(MACHINE_SIMPLE-$1 ) -apple-darwin \
234
243
--prefix=$(PROJECT_DIR ) /build/$2/xz
235
244
236
245
# Build XZ
@@ -250,14 +259,14 @@ $$(PYTHON_DIR-$1)/Makefile: downloads/Python-$(PYTHON_VERSION).tgz $(PYTHON_HOST
250
259
# Configure target Python
251
260
cd $$(PYTHON_DIR-$1 ) && PATH=$(PROJECT_DIR ) /$(PYTHON_DIR-host ) /dist/bin:$(PATH ) ./configure \
252
261
CC="$$(CC-$1 ) " LD="$$(CC-$1 ) " \
253
- --host=$$(MACHINE -$1 ) -apple-ios --build=x86_64-apple-darwin$(shell uname -r) \
262
+ --host=$$(MACHINE_DETAILED -$1 ) -apple-ios --build=x86_64-apple-darwin$(shell uname -r) \
254
263
--prefix=$(PROJECT_DIR ) /$$(PYTHON_DIR-$1 ) /dist \
255
264
--without-pymalloc --without-doc-strings --disable-ipv6 --without-ensurepip \
256
265
ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no \
257
266
$$(PYTHON_CONFIGURE-$2 )
258
267
259
268
# Build Python
260
- $$(PYTHON_DIR-$1 ) /dist/lib/libpython$(PYTHON_VER ) .a: $$(PYTHON_DIR-$1 ) /Makefile build/$2/OpenSSL.framework build/$2/bzip2/lib/libbz2.a
269
+ $$(PYTHON_DIR-$1 ) /dist/lib/libpython$(PYTHON_VER ) .a: $$(PYTHON_DIR-$1 ) /Makefile build/$2/OpenSSL.framework build/$2/bzip2/lib/libbz2.a build/$2/xz/lib/liblzma.a
261
270
# Build target Python
262
271
cd $$(PYTHON_DIR-$1 ) && PATH=$(PROJECT_DIR ) /$(PYTHON_DIR-host ) /dist/bin:$(PATH ) make all install
263
272
@@ -267,7 +276,7 @@ build/$2/$$(pyconfig.h-$1): $$(PYTHON_DIR-$1)/dist/include/python$(PYTHON_VER)/p
267
276
# Dump vars (for test)
268
277
vars-$1:
269
278
@echo "ARCH-$1: $$(ARCH-$1 ) "
270
- @echo "MACHINE -$1: $$(MACHINE -$1 ) "
279
+ @echo "MACHINE_DETAILED -$1: $$(MACHINE_DETAILED -$1 ) "
271
280
@echo "SDK-$1: $$(SDK-$1 ) "
272
281
@echo "SDK_ROOT-$1: $$(SDK_ROOT-$1 ) "
273
282
@echo "CC-$1: $$(CC-$1 ) "
0 commit comments