Added build config to get python.com

Modules/Setup and Modules/Setup.local contain the build recipes for
various extensions, wrote a custom script to translate them for
python.mk. Modules/config.c needs to be changed if any extensions are
removed or added.

Most of the source modifications are for missing headers or compile time
build vars like ABIFLAGS.

Created separate mk files for the C extensions and the Python stdlib.
Can use find for adding the python files to the APE ZIP store, but right
now necessary files are just hardcoded.

python.com loads but some build configs are still missing (showing 1 Jan
1970 as time of compilation).
This commit is contained in:
ahgamut 2021-08-09 02:49:30 +05:30 committed by Justine Tunney
parent 5ef64dbcdb
commit 98f330b764
45 changed files with 2482 additions and 45 deletions

View file

@ -17,7 +17,7 @@
#endif /* NetBSD */
#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#include "libc/runtime/dlfcn.h"
#endif
#if (defined(__OpenBSD__) || defined(__NetBSD__)) && !defined(__ELF__)

View file

@ -1,6 +1,6 @@
#include "Python.h"
#include "osdefs.h"
#include <locale.h>
#include "libc/unicode/locale.h"
#ifdef MS_WINDOWS
# include <malloc.h>
@ -13,7 +13,8 @@ extern int winerror_to_errno(int);
#endif
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#include "libc/calls/calls.h"
#include "libc/sysv/consts/fd.h"
#endif
#ifdef HAVE_FCNTL_H

View file

@ -3,7 +3,7 @@
of int.__float__, etc., that take and return unicode objects */
#include "Python.h"
#include <locale.h>
#include "libc/unicode/locale.h"
/* Raises an exception about an unknown presentation type for this
* type. */

View file

@ -2,7 +2,7 @@
/* Python interpreter main program for frozen scripts */
#include "Python.h"
#include <locale.h>
#include "libc/unicode/locale.h"
#ifdef MS_WINDOWS
extern void PyWinFreeze_ExeInit(void);

View file

@ -14,7 +14,8 @@
#include "ast.h"
#include "marshal.h"
#include "osdefs.h"
#include <locale.h>
#include "libc/unicode/locale.h"
#include "libc/calls/sigbits.h"
#ifdef HAVE_SIGNAL_H
#include <signal.h>

View file

@ -23,7 +23,7 @@ to avoid the expense of doing their own locking).
#ifdef HAVE_DLOPEN
#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#include "libc/runtime/dlfcn.h"
#endif
#if !HAVE_DECL_RTLD_LAZY
#define RTLD_LAZY 1

View file

@ -1,7 +1,7 @@
/* -*- Mode: C; c-file-style: "python" -*- */
#include <Python.h>
#include <locale.h>
#include "libc/unicode/locale.h"
/* Case-insensitive string match used for nan and inf detection; t should be
lower-case. Returns 1 for a successful match, 0 otherwise. */

View file

@ -15,7 +15,7 @@
#include "ast.h"
#include "marshal.h"
#include "osdefs.h"
#include <locale.h>
#include "libc/unicode/locale.h"
#ifdef HAVE_SIGNAL_H
#include <signal.h>

View file

@ -20,7 +20,7 @@ Data members:
#include "pythread.h"
#include "osdefs.h"
#include <locale.h>
#include "libc/unicode/locale.h"
#ifdef MS_WINDOWS
#define WIN32_LEAN_AND_MEAN