@@ -811,6 +811,21 @@ $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
811
811
$(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)
812
812
$(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources
813
813
814
+ # This rule is for iOS, which requires an annoyingly just slighly different
815
+ # format for frameworks to macOS. It *doesn't* use a versioned framework, and
816
+ # the Info.plist must be in the root of the framework.
817
+ $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK): \
818
+ $(LIBRARY) \
819
+ $(RESSRCDIR)/Info.plist
820
+ $(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)
821
+ $(CC) -o $(LDLIBRARY) $(PY_CORE_LDFLAGS) -dynamiclib \
822
+ -all_load $(LIBRARY) \
823
+ -install_name $(PYTHONFRAMEWORKINSTALLNAMEPREFIX)/$(PYTHONFRAMEWORK) \
824
+ -compatibility_version $(VERSION) \
825
+ -current_version $(VERSION) \
826
+ -framework CoreFoundation $(LIBS);
827
+ $(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(PYTHONFRAMEWORKDIR)/Info.plist
828
+
814
829
# This rule builds the Cygwin Python DLL and import library if configured
815
830
# for a shared core library; otherwise, this rule is a noop.
816
831
$(DLLLIBRARY) libpython$(LDVERSION).dll.a: $(LIBRARY_OBJS)
@@ -2319,9 +2334,11 @@ frameworkinstall: install
2319
2334
# automatically set prefix to the location deep down in the framework, so we
2320
2335
# only have to cater for the structural bits of the framework.
2321
2336
2322
- frameworkinstallframework: frameworkinstallstructure install frameworkinstallmaclib
2337
+ frameworkinstallframework: @FRAMEWORKINSTALLFIRST@ install frameworkinstallmaclib
2323
2338
2324
- frameworkinstallstructure: $(LDLIBRARY)
2339
+ # macOS uses a versioned frameworks structure that includes a full install
2340
+ .PHONY: frameworkinstallversionedstructure
2341
+ frameworkinstallversionedstructure: $(LDLIBRARY)
2325
2342
@if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
2326
2343
echo Not configured with --enable-framework; \
2327
2344
exit 1; \
@@ -2342,6 +2359,27 @@ frameworkinstallstructure: $(LDLIBRARY)
2342
2359
$(LN) -fsn Versions/Current/Resources $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Resources
2343
2360
$(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
2344
2361
2362
+ # iOS/tvOS/watchOS uses a non-versioned framework with Info.plist in the
2363
+ # framework root, no .lproj data, and only stub compilation assistance binaries
2364
+ .PHONY: frameworkinstallunversionedstructure
2365
+ frameworkinstallunversionedstructure: $(LDLIBRARY)
2366
+ @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
2367
+ echo Not configured with --enable-framework; \
2368
+ exit 1; \
2369
+ else true; \
2370
+ fi
2371
+ if test -d $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/include; then \
2372
+ echo "Clearing stale header symlink directory"; \
2373
+ rm -rf $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/include; \
2374
+ fi
2375
+ $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)
2376
+ sed 's/%VERSION%/'"`$(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Info.plist
2377
+ $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
2378
+ $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(BINDIR)
2379
+ for file in $(srcdir)/$(RESSRCDIR)/bin/* ; do \
2380
+ $(INSTALL) -m $(EXEMODE) $$file $(DESTDIR)$(BINDIR); \
2381
+ done
2382
+
2345
2383
# This installs Mac/Lib into the framework
2346
2384
# Install a number of symlinks to keep software that expects a normal unix
2347
2385
# install (which includes python-config) happy.
@@ -2376,6 +2414,19 @@ frameworkaltinstallunixtools:
2376
2414
frameworkinstallextras:
2377
2415
cd Mac && $(MAKE) installextras DESTDIR="$(DESTDIR)"
2378
2416
2417
+ # On iOS, bin/lib can't live inside the framework; include needs to be called
2418
+ # "Headers", but *must* be in the framework, and *not* include the `python3.X`
2419
+ # subdirectory. The install has put these folders in the same folder as
2420
+ # Python.framework; Move the headers to their final framework-compatible home.
2421
+ .PHONY: frameworkinstallmobileheaders
2422
+ frameworkinstallmobileheaders:
2423
+ if test -d $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers; then \
2424
+ echo "Removing old framework headers"; \
2425
+ rm -rf $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers; \
2426
+ fi
2427
+ mv "$(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/include/python$(VERSION)" "$(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers"
2428
+ $(LN) -fs "../$(PYTHONFRAMEWORKDIR)/Headers" "$(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/include/python$(VERSION)"
2429
+
2379
2430
# Build the toplevel Makefile
2380
2431
Makefile.pre: $(srcdir)/Makefile.pre.in config.status
2381
2432
CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status
@@ -2581,7 +2632,7 @@ Python/thread.o: @THREADHEADERS@ $(srcdir)/Python/condvar.h
2581
2632
.PHONY: all build_all build_wasm sharedmods check-clean-src oldsharedmods test quicktest
2582
2633
.PHONY: install altinstall oldsharedinstall bininstall altbininstall
2583
2634
.PHONY: maninstall libinstall inclinstall libainstall sharedinstall
2584
- .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
2635
+ .PHONY: frameworkinstall frameworkinstallframework
2585
2636
.PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
2586
2637
.PHONY: frameworkaltinstallunixtools recheck clean clobber distclean
2587
2638
.PHONY: smelly funny patchcheck touch altmaninstall commoninstall
0 commit comments