Skip to content

Commit 47a907c

Browse files
committed
Modified handling of pyconfig.h
1 parent da46bd2 commit 47a907c

File tree

4 files changed

+36
-10
lines changed

4 files changed

+36
-10
lines changed

Makefile

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -313,14 +313,6 @@ vars-$1:
313313
@echo "CC-$1: $$(CC-$1)"
314314
endef
315315

316-
#
317-
# Install target pyconfig.h
318-
# Parameters:
319-
# - $1 - target
320-
# - $2 - framework directory
321-
define install-target-pyconfig
322-
endef
323-
324316
#
325317
# Build for specified OS (from $(OS))
326318
# Parameters:
@@ -424,10 +416,15 @@ $$(PYTHON_FRAMEWORK-$1): build/$1/libpython$(PYTHON_VER)m.a $$(foreach target,$$
424416
mkdir -p $$(PYTHON_RESOURCES-$1)/include/python$(PYTHON_VER)m
425417

426418
# Copy the headers. The headers are the same for every platform, except for pyconfig.h
419+
# We ship a master pyconfig.h for iOS, tvOS and watchOS that delegates to architecture
420+
# specific versions; on macOS, we can use the original version as-is.
427421
cp -f -r $$(PYTHON_DIR-$$(firstword $$(TARGETS-$1)))/dist/include/python$(PYTHON_VER)m $$(PYTHON_FRAMEWORK-$1)/Headers
428422
cp -f $$(filter %.h,$$^) $$(PYTHON_FRAMEWORK-$1)/Headers
429-
cp -f $$(PYTHON_DIR-$$(firstword $$(TARGETS-$1)))/iOS/include/pyconfig.h $$(PYTHON_FRAMEWORK-$1)/Headers
430-
423+
ifeq ($1,macOS)
424+
mv $$(PYTHON_FRAMEWORK-$1)/Headers/pyconfig-x86_64.h $$(PYTHON_FRAMEWORK-$1)/Headers/pyconfig.h
425+
else
426+
cp -f $(PROJECT_DIR)/patch/Python/pyconfig-$1.h $$(PYTHON_FRAMEWORK-$1)/Headers/pyconfig.h
427+
endif
431428
# Copy Python.h and pyconfig.h into the resources include directory
432429
cp -f -r $$(PYTHON_FRAMEWORK-$1)/Headers/pyconfig*.h $$(PYTHON_RESOURCES-$1)/include/python$(PYTHON_VER)m
433430
cp -f -r $$(PYTHON_FRAMEWORK-$1)/Headers/Python.h $$(PYTHON_RESOURCES-$1)/include/python$(PYTHON_VER)m

patch/Python/pyconfig-iOS.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#ifdef __arm__
2+
#include "pyconfig-armv7.h"
3+
#endif
4+
5+
#ifdef __arm64__
6+
#include "pyconfig-arm64.h"
7+
#endif
8+
9+
#ifdef __i386__
10+
#include "pyconfig-i386.h"
11+
#endif
12+
13+
#ifdef __x86_64__
14+
#include "pyconfig-x86_64.h"
15+
#endif

patch/Python/pyconfig-tvOS.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#ifdef __arm64__
2+
#include "pyconfig-arm64.h"
3+
#endif
4+
5+
#ifdef __x86_64__
6+
#include "pyconfig-x86_64.h"
7+
#endif

patch/Python/pyconfig-watchOS.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#ifdef __arm__
2+
#include "pyconfig-armv7k.h"
3+
#endif
4+
5+
#ifdef __i386__
6+
#include "pyconfig-i386.h"
7+
#endif

0 commit comments

Comments
 (0)