25
25
# Current director
26
26
PROJECT_DIR =$(shell pwd)
27
27
28
- BUILD_NUMBER =2
28
+ BUILD_NUMBER =1
29
29
30
30
MACOSX_DEPLOYMENT_TARGET =10.8
31
31
32
32
# Version of packages that will be compiled by this meta-package
33
- PYTHON_VERSION =3.7.5
33
+ PYTHON_VERSION =3.8.0
34
34
PYTHON_VER =$(basename $(PYTHON_VERSION ) )
35
35
36
- OPENSSL_VERSION_NUMBER =1.0.2
37
- OPENSSL_REVISION =t
36
+ OPENSSL_VERSION_NUMBER =1.1.1
37
+ OPENSSL_REVISION =d
38
38
OPENSSL_VERSION =$(OPENSSL_VERSION_NUMBER )$(OPENSSL_REVISION )
39
39
40
40
BZIP2_VERSION =1.0.8
@@ -50,7 +50,7 @@ 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 =7 .0
53
+ CFLAGS-iOS=-mios-version-min =8 .0
54
54
CFLAGS-iphoneos.arm64 =-fembed-bitcode
55
55
56
56
# tvOS targets
@@ -145,7 +145,7 @@ downloads/xz-$(XZ_VERSION).tgz:
145
145
clean-Python :
146
146
rm -rf \
147
147
build/* /Python-$(PYTHON_VERSION ) -* \
148
- build/* /libpython$(PYTHON_VER ) m .a \
148
+ build/* /libpython$(PYTHON_VER ) .a \
149
149
build/* /pyconfig-* .h \
150
150
build/* /Python
151
151
@@ -155,7 +155,7 @@ downloads/Python-$(PYTHON_VERSION).tgz:
155
155
if [ ! -e downloads/Python-$( PYTHON_VERSION) .tgz ]; then curl -L https://www.python.org/ftp/python/$( PYTHON_VERSION) /Python-$( PYTHON_VERSION) .tgz > downloads/Python-$( PYTHON_VERSION) .tgz; fi
156
156
157
157
PYTHON_DIR-macOS =build/macOS/Python-$(PYTHON_VERSION ) -macosx.x86_64
158
- PYTHON_HOST =$(PYTHON_DIR-macOS ) /dist/lib/libpython$(PYTHON_VER ) m .a
158
+ PYTHON_HOST =$(PYTHON_DIR-macOS ) /dist/lib/libpython$(PYTHON_VER ) .a
159
159
160
160
# Build for specified target (from $(TARGETS))
161
161
#
@@ -205,8 +205,9 @@ ifeq ($$(findstring simulator,$$(SDK-$1)),)
205
205
sed -ie "s!static volatile sig_atomic_t intr_signal;!static volatile intr_signal;!" $$(OPENSSL_DIR-$1)/crypto/ui/ui_openssl.c
206
206
endif
207
207
ifeq ($$(findstring iphone,$$(SDK-$1 ) ) ,)
208
- # Patch apps/speed.c to not use fork() since it's not available on tvOS
208
+ # Patch apps/speed.c and apps/ocsp.c to not use fork() since it's not available on tvOS
209
209
sed -ie 's/define HAVE_FORK 1/define HAVE_FORK 0/' $$(OPENSSL_DIR-$1)/apps/speed.c
210
+ sed -ie 's/define HAVE_FORK 1/define HAVE_FORK 0/' $$(OPENSSL_DIR-$1)/apps/ocsp.c
210
211
# Patch Configure to build for tvOS or watchOS, not iOS
211
212
LC_ALL=C sed -ie 's/-D_REENTRANT:iOS/-D_REENTRANT:$2/' $$(OPENSSL_DIR-$1)/Configure
212
213
endif
@@ -215,13 +216,13 @@ endif
215
216
ifeq ($2,macOS)
216
217
cd $$(OPENSSL_DIR-$1) && \
217
218
CC="$$(CC-$1)" MACOSX_DEPLOYMENT_TARGET=$$(MACOSX_DEPLOYMENT_TARGET) \
218
- ./Configure darwin64-x86_64-cc --openssldir=$(PROJECT_DIR)/build/$2/openssl
219
+ ./Configure darwin64-x86_64-cc no-tests --prefix=$(PROJECT_DIR)/build/$2/openssl --openssldir=$(PROJECT_DIR)/build/$2/openssl
219
220
else
220
221
cd $$(OPENSSL_DIR-$1) && \
221
222
CC="$$(CC-$1)" \
222
223
CROSS_TOP="$$(dir $$(SDK_ROOT-$1)).." \
223
224
CROSS_SDK="$$(notdir $$(SDK_ROOT-$1))" \
224
- ./Configure iphoneos-cross no-asm --openssldir=$(PROJECT_DIR)/build/$2/openssl
225
+ ./Configure iphoneos-cross no-asm no-tests --prefix=$(PROJECT_DIR)/build/$2/openssl --openssldir=$(PROJECT_DIR)/build/$2/openssl
225
226
endif
226
227
227
228
# Build OpenSSL
@@ -297,11 +298,11 @@ else
297
298
endif
298
299
299
300
# Build Python
300
- $$(PYTHON_DIR-$1 ) /dist/lib/libpython$(PYTHON_VER ) m .a: build/$2/Support/OpenSSL build/$2/Support/BZip2 build/$2/Support/XZ $$(PYTHON_DIR-$1 ) /Makefile
301
+ $$(PYTHON_DIR-$1 ) /dist/lib/libpython$(PYTHON_VER ) .a: build/$2/Support/OpenSSL build/$2/Support/BZip2 build/$2/Support/XZ $$(PYTHON_DIR-$1 ) /Makefile
301
302
# Build target Python
302
303
cd $$(PYTHON_DIR-$1 ) && PATH="$(PROJECT_DIR ) /$(PYTHON_DIR-macOS ) /dist/bin:$(PATH ) " make all install
303
304
304
- build/$2/$$(pyconfig.h-$1 ) : $$(PYTHON_DIR-$1 ) /dist/include/python$(PYTHON_VER ) m /pyconfig.h
305
+ build/$2/$$(pyconfig.h-$1 ) : $$(PYTHON_DIR-$1 ) /dist/include/python$(PYTHON_VER ) /pyconfig.h
305
306
cp -f $$^ $$@
306
307
307
308
# Dump vars (for test)
@@ -412,28 +413,28 @@ $1: Python-$1
412
413
Python-$1: dist/Python-$(PYTHON_VER ) -$1-support.b$(BUILD_NUMBER ) .tar.gz
413
414
414
415
# Build Python
415
- $$(PYTHON_FRAMEWORK-$1 ) : build/$1/libpython$(PYTHON_VER ) m .a $$(foreach target,$$(TARGETS-$1 ) ,build/$1/$$(pyconfig.h-$$(target ) ) )
416
- mkdir -p $$(PYTHON_RESOURCES-$1 ) /include/python$(PYTHON_VER ) m
416
+ $$(PYTHON_FRAMEWORK-$1 ) : build/$1/libpython$(PYTHON_VER ) .a $$(foreach target,$$(TARGETS-$1 ) ,build/$1/$$(pyconfig.h-$$(target ) ) )
417
+ mkdir -p $$(PYTHON_RESOURCES-$1 ) /include/python$(PYTHON_VER )
417
418
418
419
# Copy the headers. The headers are the same for every platform, except for pyconfig.h
419
420
# We ship a master pyconfig.h for iOS, tvOS and watchOS that delegates to architecture
420
421
# specific versions; on macOS, we can use the original version as-is.
421
- cp -f -r $$(PYTHON_DIR-$$(firstword $$(TARGETS-$1 ) ) ) /dist/include/python$(PYTHON_VER ) m $$(PYTHON_FRAMEWORK-$1 ) /Headers
422
+ cp -f -r $$(PYTHON_DIR-$$(firstword $$(TARGETS-$1 ) ) ) /dist/include/python$(PYTHON_VER ) $$(PYTHON_FRAMEWORK-$1 ) /Headers
422
423
cp -f $$(filter % .h,$$^ ) $$(PYTHON_FRAMEWORK-$1 ) /Headers
423
424
ifeq ($1,macOS)
424
425
mv $$(PYTHON_FRAMEWORK-$1)/Headers/pyconfig-x86_64.h $$(PYTHON_FRAMEWORK-$1)/Headers/pyconfig.h
425
426
else
426
427
cp -f $(PROJECT_DIR)/patch/Python/pyconfig-$1.h $$(PYTHON_FRAMEWORK-$1)/Headers/pyconfig.h
427
428
endif
428
429
# Copy Python.h and pyconfig.h into the resources include directory
429
- cp -f -r $$(PYTHON_FRAMEWORK-$1 ) /Headers/pyconfig*.h $$(PYTHON_RESOURCES-$1 ) /include/python$(PYTHON_VER ) m
430
- cp -f -r $$(PYTHON_FRAMEWORK-$1 ) /Headers/Python.h $$(PYTHON_RESOURCES-$1 ) /include/python$(PYTHON_VER ) m
430
+ cp -f -r $$(PYTHON_FRAMEWORK-$1 ) /Headers/pyconfig*.h $$(PYTHON_RESOURCES-$1 ) /include/python$(PYTHON_VER )
431
+ cp -f -r $$(PYTHON_FRAMEWORK-$1 ) /Headers/Python.h $$(PYTHON_RESOURCES-$1 ) /include/python$(PYTHON_VER )
431
432
432
433
# Copy the standard library from the simulator build
433
434
ifneq ($(TEST ) ,)
434
435
cp -f -r $$(PYTHON_DIR-$$(firstword $$(TARGETS-$1)))/dist/lib $$(PYTHON_RESOURCES-$1)
435
436
# Remove the pieces of the resources directory that aren't needed:
436
- rm -f $$(PYTHON_RESOURCES-$1)/lib/libpython$(PYTHON_VER)m .a
437
+ rm -f $$(PYTHON_RESOURCES-$1)/lib/libpython$(PYTHON_VER).a
437
438
rm -rf $$(PYTHON_RESOURCES-$1)/lib/pkgconfig
438
439
else
439
440
mkdir -p $$(PYTHON_RESOURCES-$1)/lib
@@ -446,7 +447,7 @@ endif
446
447
447
448
448
449
# Build libpython fat library
449
- build/$1/libpython$(PYTHON_VER ) m .a: $$(foreach target,$$(TARGETS-$1 ) ,$$(PYTHON_DIR-$$(target ) ) /dist/lib/libpython$(PYTHON_VER ) m .a)
450
+ build/$1/libpython$(PYTHON_VER ) .a: $$(foreach target,$$(TARGETS-$1 ) ,$$(PYTHON_DIR-$$(target ) ) /dist/lib/libpython$(PYTHON_VER ) .a)
450
451
# Create a fat binary for the libPython library
451
452
mkdir -p build/$1
452
453
xcrun lipo -create -output $$@ $$^
0 commit comments