46 captures
25 Jun 2018 - 16 Nov 2023
Mar APR May
24
2021 2022 2023
success
fail

About this capture

COLLECTED BY

Collection: Save Page Now

TIMESTAMPS

The Wayback Machine - http://web.archive.org/web/20220424202937/https://devguide.python.org/porting/
  Contents   <span class="latin" style="width:19px;height:19px;">M</span><span class="latin" style="width:19px;height:19px;">e</span><span class="latin" style="width:19px;height:19px;">n</span><span class="latin" style="width:19px;height:19px;">u</span>   <span class="latin" style="width:19px;height:19px;">E</span><span class="latin" style="width:19px;height:19px;">x</span><span class="latin" style="width:19px;height:19px;">p</span><span class="latin" style="width:19px;height:19px;">a</span><span class="latin" style="width:19px;height:19px;">n</span><span class="latin" style="width:19px;height:19px;">d</span>   <span class="latin" style="width:19px;height:19px;">L</span><span class="latin" style="width:19px;height:19px;">i</span><span class="latin" style="width:19px;height:19px;">g</span><span class="latin" style="width:19px;height:19px;">h</span><span class="latin" style="width:19px;height:19px;">t</span><span class="latin" style="display:block;width:19px;height:19px;"> </span><span class="latin" style="width:19px;height:19px;">m</span><span class="latin" style="width:19px;height:19px;">o</span><span class="latin" style="width:19px;height:19px;">d</span><span class="latin" style="width:19px;height:19px;">e</span>   <span class="latin" style="width:19px;height:19px;">D</span><span class="latin" style="width:19px;height:19px;">a</span><span class="latin" style="width:19px;height:19px;">r</span><span class="latin" style="width:19px;height:19px;">k</span><span class="latin" style="display:block;width:19px;height:19px;"> </span><span class="latin" style="width:19px;height:19px;">m</span><span class="latin" style="width:19px;height:19px;">o</span><span class="latin" style="width:19px;height:19px;">d</span><span class="latin" style="width:19px;height:19px;">e</span>   <span class="latin" style="width:19px;height:19px;">A</span><span class="latin" style="width:19px;height:19px;">u</span><span class="latin" style="width:19px;height:19px;">t</span><span class="latin" style="width:19px;height:19px;">o</span><span class="latin" style="display:block;width:19px;height:19px;"> </span><span class="latin" style="width:19px;height:19px;">l</span><span class="latin" style="width:19px;height:19px;">i</span><span class="latin" style="width:19px;height:19px;">g</span><span class="latin" style="width:19px;height:19px;">h</span><span class="latin" style="width:19px;height:19px;">t</span><span class="latin" style="width:19px;height:19px;">/</span><span class="latin" style="width:19px;height:19px;">d</span><span class="latin" style="width:19px;height:19px;">a</span><span class="latin" style="width:19px;height:19px;">r</span><span class="latin" style="width:19px;height:19px;">k</span><span class="latin" style="display:block;width:19px;height:19px;"> </span><span class="latin" style="width:19px;height:19px;">m</span><span class="latin" style="width:19px;height:19px;">o</span><span class="latin" style="width:19px;height:19px;">d</span><span class="latin" style="width:19px;height:19px;">e</span>  
Hide navigation sidebar

Hide table of contents sidebar

 


Toggle site navigation sidebar
 


Python Developer's Guide 



Toggle Light / Dark / Auto color theme
 

Toggle table of contents sidebar
 




Python Developer's Guide 



Getting Started

Where to Get Help

Lifecycle of a Pull Request

Running & Writing Tests

Increase Test Coverage

Helping with Documentation

Documenting Python

Silence Warnings From the Test Suite

Fixing easy Issues (and Beyond)

Issue Tracking
Toggle child pages in navigation


GitHub Labels

GitHub issues for BPO users



Triaging an Issue

Following Pythons Development

Porting Python to a new platform

How to Become a Core Developer

Developer Log

Accepting Pull Requests

Development Cycle

Continuous Integration

Adding to the Stdlib

Changing the Python Language

Experts Index

gdb Support

Exploring CPythons Internals

Changing CPythons Grammar

Guide to CPythons Parser

Design of CPythons Compiler

Design of CPythons Garbage Collector

Updating standard library extension modules

Changing Pythons C API

Coverity Scan

Dynamic Analysis with Clang

Running a buildbot worker

Core Developer Motivations and Affiliations

Git Bootcamp and Cheat Sheet

Appendix: Topics





     v: latest  


Versions

latest
 


Downloads

pdf

html

epub
 


On Read the Docs

Project Home  

Builds  








Back to top  

Edit this page  


Toggle Light / Dark / Auto color theme
 

Toggle table of contents sidebar
 

Porting Python to a new platform#


The first step is to familiarize yourself with the development toolchain on the platform in question, notably the C compiler. Make sure you can compile and run a hello-world program using the target compiler.

Next, learn how to compile and run the Python interpreter on a platform to which it has already been ported; preferably Unix, but Windows will do, too. The build process for Python, in particular the Makefile in the source distribution, will give you a hint on which files to compile for Python. Not all source files are relevant: some are platform specific, others are only used in emergencies (e.g. getopt.c).

It is not recommended to start porting Python without at least medium-level understanding of your target platform; i.e. how it is generally used, how to write platform specific apps, etc. Also, some Python knowledge is required, or you will be unable to verify that your port is working correctly.

You will need a pyconfig.h file tailored for your platform. You can start with pyconfig.h.in, read the comments, and turn on definitions that apply to your platform. Also, you will need a config.c file, which lists the built-in modules you support. Again, starting with Modules/config.c.in is recommended.

Finally, you will run into some things that are not supported on your target platform. Forget about the posix module in the beginning. You can simply comment it out of the config.c file.

Keep working on it until you get a >>> prompt. You may have to disable the importing of site.py by passing the -S option. When you have a prompt, bang on it until it executes very simple Python statements.

At some point you will want to use the osmodule; this is the time to start thinking about what to do with the posix module. It is okay to simply comment out functions in the posix module that cause problems; the remaining ones will be quite useful.

Before you are done, it is highly recommended to run the Python regression test suite, as described in Running & Writing Tests.
 



Next  

How to Become a Core Developer
 


Previous  

Following Pythons Development
 



Copyright © 2011-2022, Python Software Foundation  
Made with Sphinx and @pradyunsg's   Furo  
Last updated on Apr 21, 2022