25
25
# Current director
26
26
PROJECT_DIR =$(shell pwd)
27
27
28
- BUILD_NUMBER =11
28
+ BUILD_NUMBER =custom
29
29
30
30
MACOSX_DEPLOYMENT_TARGET =10.8
31
31
@@ -39,7 +39,7 @@ OPENSSL_VERSION=$(OPENSSL_VERSION_NUMBER)$(OPENSSL_REVISION)
39
39
40
40
BZIP2_VERSION =1.0.8
41
41
42
- XZ_VERSION =5.2.4
42
+ XZ_VERSION =5.2.5
43
43
44
44
# Supported OS
45
45
OS =macOS iOS tvOS watchOS
@@ -50,20 +50,22 @@ CFLAGS-macOS=-mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET)
50
50
51
51
# iOS targets
52
52
TARGETS-iOS =iphonesimulator.x86_64 iphoneos.arm64
53
- CFLAGS-iOS=-mios-version-min =8.0
54
- CFLAGS-iphoneos.arm64 =-fembed-bitcode
55
- CFLAGS-iphonesimulator.x86_64 =-fembed-bitcode
53
+ CFLAGS-iOS=-mios-version-min =8.0 -fembed-bitcode
54
+ CFLAGS-iphoneos.arm64 =
55
+ CFLAGS-iphonesimulator.x86_64 =
56
56
57
57
# tvOS targets
58
58
TARGETS-tvOS =appletvsimulator.x86_64 appletvos.arm64
59
- CFLAGS-tvOS=-mtvos-version-min =9.0
60
- CFLAGS-appletvos.arm64 =-fembed-bitcode
59
+ CFLAGS-tvOS=-mtvos-version-min =9.0 -fembed-bitcode
60
+ CFLAGS-appletvos.arm64 =
61
+ CFLAGS-appletvsimulator.x86_64 =
61
62
PYTHON_CONFIGURE-tvOS=ac_cv_func_sigaltstack =no
62
63
63
64
# watchOS targets
64
65
TARGETS-watchOS =watchsimulator.i386 watchos.armv7k
65
- CFLAGS-watchOS=-mwatchos-version-min =4.0
66
- CFLAGS-watchos.armv7k =-fembed-bitcode
66
+ CFLAGS-watchOS=-mwatchos-version-min =4.0 -fembed-bitcode
67
+ CFLAGS-watchsimulator.i386 =
68
+ CFLAGS-watchos.armv7k =
67
69
PYTHON_CONFIGURE-watchOS=ac_cv_func_sigaltstack =no
68
70
69
71
# override machine types for arm64
@@ -88,9 +90,6 @@ update-patch:
88
90
if [ -z " $( PYTHON_REPO_DIR) " ]; then echo " \n\nPYTHON_REPO_DIR must be set to the root of your Python github checkout\n\n" ; fi
89
91
cd $(PYTHON_REPO_DIR ) && git diff -D v$(PYTHON_VERSION ) $(PYTHON_VER ) | filterdiff -X $(PROJECT_DIR ) /patch/Python/diff-exclude.lst -p 1 --clean > $(PROJECT_DIR ) /patch/Python/Python.patch
90
92
91
- upload : $(foreach os,$(OS ) ,$(os ) )
92
- python tools/upload.py b$(BUILD_NUMBER )
93
-
94
93
# ##########################################################################
95
94
# OpenSSL
96
95
# These build instructions adapted from the scripts developed by
@@ -227,16 +226,12 @@ endif
227
226
228
227
# Build OpenSSL
229
228
$$(OPENSSL_DIR-$1 ) /libssl.a $$(OPENSSL_DIR-$1 ) /libcrypto.a: $$(OPENSSL_DIR-$1 ) /Makefile
230
- # Installing multiple times causes problems with the man directory.
231
- # Since we're just overwriting anyway, and we're not going to keep the man files
232
- # delete the man directory (if it exists) first.
233
- rm -rf $(PROJECT_DIR ) /build/$2/openssl/man
234
- # Make the build
229
+ # Make the build, and install just the software (not the docs)
235
230
cd $$(OPENSSL_DIR-$1 ) && \
236
231
CC="$$(CC-$1 ) " \
237
232
CROSS_TOP="$$(dir $$(SDK_ROOT-$1 ) ) .." \
238
233
CROSS_SDK="$$(notdir $$(SDK_ROOT-$1 ) ) " \
239
- make all && make install
234
+ make all && make install_sw
240
235
241
236
# Unpack BZip2
242
237
$$(BZIP2_DIR-$1 ) /Makefile: downloads/bzip2-$(BZIP2_VERSION ) .tgz
@@ -276,17 +271,22 @@ $$(PYTHON_DIR-$1)/Makefile: downloads/Python-$(PYTHON_VERSION).tgz $$(PYTHON_HOS
276
271
tar zxf downloads/Python-$(PYTHON_VERSION ) .tgz --strip-components 1 -C $$(PYTHON_DIR-$1 )
277
272
# Apply target Python patches
278
273
cd $$(PYTHON_DIR-$1 ) && patch -p1 < $(PROJECT_DIR ) /patch/Python/Python.patch
279
- cp -f $(PROJECT_DIR ) /patch/Python/Setup.embedded $$(PYTHON_DIR-$1 ) /Modules/Setup.embedded
280
-
281
274
# Configure target Python
282
275
ifeq ($2,macOS)
276
+ # A locally hosted Python requires a full Setup.local configuration
277
+ # because there's no PYTHON_HOST_PLATFORM to cause Setup.local to be
278
+ # generated
279
+ cat $(PROJECT_DIR)/patch/Python/Setup.embedded $(PROJECT_DIR)/patch/Python/Setup.macOS-x86_64 > $$(PYTHON_DIR-$1)/Modules/Setup.local
283
280
# Make a fully embedded macOS build
284
- cat $$(PYTHON_DIR-$1)/Modules/Setup.embedded $(PROJECT_DIR)/patch/Python/Setup.macOS-x86_64 > $$(PYTHON_DIR-$1)/Modules/Setup.local
285
281
cd $$(PYTHON_DIR-$1) && MACOSX_DEPLOYMENT_TARGET=$$(MACOSX_DEPLOYMENT_TARGET) ./configure \
286
282
--prefix=$(PROJECT_DIR)/$$(PYTHON_DIR-$1)/dist \
287
283
--without-doc-strings --enable-ipv6 --without-ensurepip \
288
284
$$(PYTHON_CONFIGURE-$2)
289
285
else
286
+ # Copy in the embedded and platform/arch configuration
287
+ cp -f $(PROJECT_DIR)/patch/Python/Setup.embedded $$(PYTHON_DIR-$1)/Modules/Setup.embedded
288
+ if [ -e "$(PROJECT_DIR)/patch/Python/Setup.$2-$$(ARCH-$1)" ]; then \
289
+ cp -f $(PROJECT_DIR)/patch/Python/Setup.$2-$$(ARCH-$1) $$(PYTHON_DIR-$1)/Modules/Setup.$2-$$(ARCH-$1); fi
290
290
cd $$(PYTHON_DIR-$1) && PATH=$(PROJECT_DIR)/$(PYTHON_DIR-macOS)/dist/bin:$(PATH) ./configure \
291
291
CC="$$(CC-$1)" LD="$$(CC-$1)" \
292
292
--host=$$(MACHINE_DETAILED-$1)-apple-$(shell echo $2 | tr '[:upper:]' '[:lower:]') \
@@ -327,12 +327,12 @@ XZ_FRAMEWORK-$1=build/$1/Support/XZ
327
327
PYTHON_FRAMEWORK-$1=build/$1/Support/Python
328
328
PYTHON_RESOURCES-$1=$$(PYTHON_FRAMEWORK-$1 ) /Resources
329
329
330
- $1: dist/Python-$(PYTHON_VER ) -$1-support.b $(BUILD_NUMBER ) .tar.gz
330
+ $1: dist/Python-$(PYTHON_VER ) -$1-support.$(BUILD_NUMBER ) .tar.gz
331
331
332
332
clean-$1:
333
333
rm -rf build/$1
334
334
335
- dist/Python-$(PYTHON_VER ) -$1-support.b $(BUILD_NUMBER ) .tar.gz: $$(BZIP2_FRAMEWORK-$1 ) $$(XZ_FRAMEWORK-$1 ) $$(OPENSSL_FRAMEWORK-$1 ) $$(PYTHON_FRAMEWORK-$1 )
335
+ dist/Python-$(PYTHON_VER ) -$1-support.$(BUILD_NUMBER ) .tar.gz: $$(BZIP2_FRAMEWORK-$1 ) $$(XZ_FRAMEWORK-$1 ) $$(OPENSSL_FRAMEWORK-$1 ) $$(PYTHON_FRAMEWORK-$1 )
336
336
mkdir -p dist
337
337
echo "Python version: $(PYTHON_VERSION ) " > build/$1/Support/VERSIONS
338
338
echo "Build: $(BUILD_NUMBER ) " >> build/$1/Support/VERSIONS
@@ -343,9 +343,12 @@ dist/Python-$(PYTHON_VER)-$1-support.b$(BUILD_NUMBER).tar.gz: $$(BZIP2_FRAMEWORK
343
343
ifeq ($1,macOS)
344
344
cp -r build/$1/Python-$(PYTHON_VERSION)-macosx.x86_64/dist build/$1/python
345
345
mv build/$1/Support/VERSIONS build/$1/python/VERSIONS
346
- tar zcvf $$@ -C build/$1/python `ls -A build/$1/python`
346
+ tar zcvf $$@ -X patch/Python/exclude.macOS - C build/$1/python `ls -A build/$1/python`
347
347
else
348
- tar zcvf $$@ -C build/$1/Support `ls -A build/$1/Support`
348
+ # Build a "full" tarball with all content for test purposes
349
+ tar zcvf dist/Python-$(PYTHON_VER)-$1-support.test-$(BUILD_NUMBER).tar.gz -X patch/Python/test-exclude.embedded -C build/$1/Support `ls -A build/$1/Support`
350
+ # Build a distributable tarball
351
+ tar zcvf $$@ -X patch/Python/exclude.embedded -C build/$1/Support `ls -A build/$1/Support`
349
352
endif
350
353
351
354
# Build OpenSSL
@@ -410,7 +413,7 @@ build/$1/xz/lib/liblzma.a: $$(foreach target,$$(TARGETS-$1),$$(XZ_DIR-$$(target)
410
413
411
414
$1: Python-$1
412
415
413
- Python-$1: dist/Python-$(PYTHON_VER ) -$1-support.b $(BUILD_NUMBER ) .tar.gz
416
+ Python-$1: dist/Python-$(PYTHON_VER ) -$1-support.$(BUILD_NUMBER ) .tar.gz
414
417
415
418
# Build Python
416
419
$$(PYTHON_FRAMEWORK-$1 ) : build/$1/libpython$(PYTHON_VER ) m.a $$(foreach target,$$(TARGETS-$1 ) ,build/$1/$$(pyconfig.h-$$(target ) ) )
@@ -431,16 +434,7 @@ endif
431
434
cp -f -r $$(PYTHON_FRAMEWORK-$1 ) /Headers/Python.h $$(PYTHON_RESOURCES-$1 ) /include/python$(PYTHON_VER ) m
432
435
433
436
# Copy the standard library from the simulator build
434
- ifneq ($(TEST ) ,)
435
437
cp -f -r $$(PYTHON_DIR-$$(firstword $$(TARGETS-$1 ) ) ) /dist/lib $$(PYTHON_RESOURCES-$1 )
436
- # Remove the pieces of the resources directory that aren't needed:
437
- rm -f $$(PYTHON_RESOURCES-$1)/lib/libpython$(PYTHON_VER)m.a
438
- rm -rf $$(PYTHON_RESOURCES-$1)/lib/pkgconfig
439
- else
440
- mkdir -p $$(PYTHON_RESOURCES-$1)/lib
441
- cd $$(PYTHON_DIR-$$(firstword $$(TARGETS-$1)))/dist/lib/python$(PYTHON_VER) && \
442
- zip -x@$(PROJECT_DIR)/patch/Python/lib-exclude.lst -r $(PROJECT_DIR)/$$(PYTHON_RESOURCES-$1)/lib/python$(subst .,,$(PYTHON_VER)) *
443
- endif
444
438
445
439
# Copy fat library
446
440
cp -f $$(filter % .a,$$^ ) $$(PYTHON_FRAMEWORK-$1 ) /libPython.a
0 commit comments