port 2P step 1: vendor CPython 2.7.18 as the mtpython static library
The embedded 40250 script layer needs its own interpreter on five platforms. 2.7 is end-of-life, so nothing can be fetched from the target SDKs and the source is vendored (official 2.7.18 tarball, trimmed to 25MB; Lib/ stays for step 3's python27.zip). cpython-2.7.18/CMakeLists.txt builds one `mtpython` static library from exactly the 133 objects the reference libpython2.7.a contains, off by default behind -DMTGODOT_EMBED_PYTHON=ON. The source list and the built-in module table (config/config.c, 39 entries) are shared; pyconfig.h is a probe result and is not, so each platform keeps its own under config/<platform>/, regenerated by tools/py_embed/gen_pyconfig.sh and checked against the shared table. Three vendor patches, documented in docs/THIRD-PARTY.md: configure/configure.ac learn arm64 on macOS, and posixmodule.c undefines the process-control calls it hard-defines past pyconfig.h when building for iOS. macOS (ctest python.embed: every builtin imports, codecs and pickle work off the vendored Lib/), Android arm64 and iOS arm64 build. Linux needs a Linux host and Windows needs a MinGW-vs-MSVC decision; both are noted for step 4. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
/* Generated file. Do not edit. */
|
||||
int winerror_to_errno(int winerror)
|
||||
{
|
||||
switch(winerror) {
|
||||
case 2: return 2;
|
||||
case 3: return 2;
|
||||
case 4: return 24;
|
||||
case 5: return 13;
|
||||
case 6: return 9;
|
||||
case 7: return 12;
|
||||
case 8: return 12;
|
||||
case 9: return 12;
|
||||
case 10: return 7;
|
||||
case 11: return 8;
|
||||
case 15: return 2;
|
||||
case 16: return 13;
|
||||
case 17: return 18;
|
||||
case 18: return 2;
|
||||
case 19: return 13;
|
||||
case 20: return 13;
|
||||
case 21: return 13;
|
||||
case 22: return 13;
|
||||
case 23: return 13;
|
||||
case 24: return 13;
|
||||
case 25: return 13;
|
||||
case 26: return 13;
|
||||
case 27: return 13;
|
||||
case 28: return 13;
|
||||
case 29: return 13;
|
||||
case 30: return 13;
|
||||
case 31: return 13;
|
||||
case 32: return 13;
|
||||
case 33: return 13;
|
||||
case 34: return 13;
|
||||
case 35: return 13;
|
||||
case 36: return 13;
|
||||
case 53: return 2;
|
||||
case 65: return 13;
|
||||
case 67: return 2;
|
||||
case 80: return 17;
|
||||
case 82: return 13;
|
||||
case 83: return 13;
|
||||
case 89: return 11;
|
||||
case 108: return 13;
|
||||
case 109: return 32;
|
||||
case 112: return 28;
|
||||
case 114: return 9;
|
||||
case 128: return 10;
|
||||
case 129: return 10;
|
||||
case 130: return 9;
|
||||
case 132: return 13;
|
||||
case 145: return 41;
|
||||
case 158: return 13;
|
||||
case 161: return 2;
|
||||
case 164: return 11;
|
||||
case 167: return 13;
|
||||
case 183: return 17;
|
||||
case 188: return 8;
|
||||
case 189: return 8;
|
||||
case 190: return 8;
|
||||
case 191: return 8;
|
||||
case 192: return 8;
|
||||
case 193: return 8;
|
||||
case 194: return 8;
|
||||
case 195: return 8;
|
||||
case 196: return 8;
|
||||
case 197: return 8;
|
||||
case 198: return 8;
|
||||
case 199: return 8;
|
||||
case 200: return 8;
|
||||
case 201: return 8;
|
||||
case 202: return 8;
|
||||
case 206: return 2;
|
||||
case 215: return 11;
|
||||
case 1816: return 12;
|
||||
default: return EINVAL;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user