Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
gh-114099: Add configure and Makefile targets to support iOS compilation.#115390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
15 commits Select commitHold shift + click to select a range
dfd97f8
Add configure and Makefile targets to support iOS compilation.
freakboy3742838713d
Improve error handling and reuse in configure.ac.
freakboy37425b54336
Clarifications to iOS README from review.
freakboy37429a5f851
Normalize usage of arm64 in iOS README.
freakboy37428c763af
Move the future location of the iOS testbed project to the iOS folder.
freakboy374295275c1
Corrections to iOS README.
freakboy37429f851b0
Merge branch 'main' into iOS-configure-targets
freakboy3742302a5b0
Add note about Command Line Tools, and the need for a Simulator platf…
freakboy3742ba946fb
Modify compiler utility scripts to avoid bash, and allow for SDK vers…
freakboy374224b3770
Added support for DESTDIR to iOS framework targets.
freakboy37423a1a6fb
Correct dependency issue with parallel builds.
freakboy37426247052
Correct issue with finding resources when not building from the root …
freakboy3742ee41015
Merge branch 'main' into ios-configure-targets
freakboy374249778fe
Removed an unnecessary srcdir usage.
freakboy37428a3cbeb
Clarified the restriction on host python compatibility.
freakboy3742File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
1 change: 1 addition & 0 deletions.gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -912,6 +912,21 @@ $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \ | ||
$(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK) | ||
$(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources | ||
# This rule is for iOS, which requires an annoyingly just slighly different | ||
# format for frameworks to macOS. It *doesn't* use a versioned framework, and | ||
# the Info.plist must be in the root of the framework. | ||
$(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK): \ | ||
$(LIBRARY) \ | ||
$(RESSRCDIR)/Info.plist | ||
$(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR) | ||
ned-deily marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
$(CC) -o $(LDLIBRARY) $(PY_CORE_LDFLAGS) -dynamiclib \ | ||
-all_load $(LIBRARY) \ | ||
-install_name $(PYTHONFRAMEWORKINSTALLNAMEPREFIX)/$(PYTHONFRAMEWORK) \ | ||
-compatibility_version $(VERSION) \ | ||
-current_version $(VERSION) \ | ||
-framework CoreFoundation $(LIBS); | ||
$(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(PYTHONFRAMEWORKDIR)/Info.plist | ||
# This rule builds the Cygwin Python DLL and import library if configured | ||
# for a shared core library; otherwise, this rule is a noop. | ||
$(DLLLIBRARY) libpython$(LDVERSION).dll.a: $(LIBRARY_OBJS) | ||
@@ -2607,10 +2622,11 @@ frameworkinstall: install | ||
# only have to cater for the structural bits of the framework. | ||
.PHONY: frameworkinstallframework | ||
frameworkinstallframework:@FRAMEWORKINSTALLFIRST@ install frameworkinstallmaclib | ||
# macOS uses a versioned frameworks structure that includes a full install | ||
.PHONY: frameworkinstallversionedstructure | ||
frameworkinstallversionedstructure:$(LDLIBRARY) | ||
@if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ | ||
echo Not configured with --enable-framework; \ | ||
exit 1; \ | ||
@@ -2631,6 +2647,27 @@ frameworkinstallstructure:$(LDLIBRARY) | ||
$(LN) -fsn Versions/Current/Resources $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Resources | ||
$(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY) | ||
# iOS/tvOS/watchOS uses a non-versioned framework with Info.plist in the | ||
# framework root, no .lproj data, and only stub compilation assistance binaries | ||
.PHONY: frameworkinstallunversionedstructure | ||
frameworkinstallunversionedstructure:$(LDLIBRARY) | ||
@if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ | ||
echo Not configured with --enable-framework; \ | ||
exit 1; \ | ||
else true; \ | ||
fi | ||
if test -d $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/include; then \ | ||
echo "Clearing stale header symlink directory"; \ | ||
rm -rf $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/include; \ | ||
fi | ||
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR) | ||
sed 's/%VERSION%/'"`$(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Info.plist | ||
$(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY) | ||
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(BINDIR) | ||
for file in $(srcdir)/$(RESSRCDIR)/bin/* ; do \ | ||
$(INSTALL) -m $(EXEMODE) $$file $(DESTDIR)$(BINDIR); \ | ||
done | ||
# This installs Mac/Lib into the framework | ||
# Install a number of symlinks to keep software that expects a normal unix | ||
# install (which includes python-config) happy. | ||
@@ -2671,6 +2708,19 @@ frameworkaltinstallunixtools: | ||
frameworkinstallextras: | ||
cd Mac && $(MAKE) installextras DESTDIR="$(DESTDIR)" | ||
# On iOS, bin/lib can't live inside the framework; include needs to be called | ||
# "Headers", but *must* be in the framework, and *not* include the `python3.X` | ||
# subdirectory. The install has put these folders in the same folder as | ||
# Python.framework; Move the headers to their final framework-compatible home. | ||
.PHONY: frameworkinstallmobileheaders | ||
frameworkinstallmobileheaders: | ||
if test -d $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers; then \ | ||
echo "Removing old framework headers"; \ | ||
rm -rf $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers; \ | ||
fi | ||
mv "$(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/include/python$(VERSION)" "$(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers" | ||
$(LN) -fs "../$(PYTHONFRAMEWORKDIR)/Headers" "$(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/include/python$(VERSION)" | ||
# Build the toplevel Makefile | ||
Makefile.pre: $(srcdir)/Makefile.pre.in config.status | ||
CONFIG_FILES=Makefile.pre CONFIG_HEADERS= ./config.status | ||
2 changes: 2 additions & 0 deletionsMisc/NEWS.d/next/Build/2024-02-13-14-52-59.gh-issue-114099.zjXsQr.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Makefile targets were added to support compiling an iOS-compatible framework | ||
build. |
15 changes: 15 additions & 0 deletionsMisc/platform_triplet.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletionconfig.sub
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.