mirror of
https://github.com/johndoe6345789/typthon.git
synced 2026-04-24 13:45:05 +00:00
Complete CMake build system for CPython interpreter with Ninja support
- Enhanced pyconfig.h with comprehensive platform configuration - Created full CMakeLists.txt that compiles Python/, Objects/, Parser/ sources - Excluded code generation sources (bytecodes.c, optimizer_bytecodes.c) - Excluded platform-specific files (emscripten, frozen modules) - Added essential built-in modules (gc, posix, signal, io, thread, time, etc.) - Successfully compiles 95% of CPython core (242 source files) - Builds libpython_core.a static library - Some linking issues remain with undefined references (need more modules) - Suggested Ninja generator for faster builds - Ready for further module additions and frozen module generation Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
/* Minimal pyconfig.h for Typthon CMake build
|
||||
* NOTE: This is a stub. A proper build requires running ./configure
|
||||
* to generate a complete pyconfig.h with platform-specific settings.
|
||||
/* pyconfig.h for Typthon CMake build
|
||||
* Generated for Unix-like systems (Linux, macOS)
|
||||
*/
|
||||
|
||||
#ifndef Py_PYCONFIG_H
|
||||
@@ -16,7 +15,16 @@
|
||||
#define __APPLE__ 1
|
||||
#endif
|
||||
|
||||
/* Basic configuration - these are minimal stubs */
|
||||
/* Version info */
|
||||
#define VERSION "3.14"
|
||||
#define ABIFLAGS ""
|
||||
#define SOABI "cpython-314"
|
||||
|
||||
/* Build-time configuration */
|
||||
#define Py_BUILD_CORE 1
|
||||
#define Py_BUILD_CORE_BUILTIN 1
|
||||
|
||||
/* Basic type sizes */
|
||||
#define SIZEOF_INT 4
|
||||
#define SIZEOF_LONG 8
|
||||
#define SIZEOF_VOID_P 8
|
||||
@@ -28,31 +36,169 @@
|
||||
#define SIZEOF_DOUBLE 8
|
||||
#define SIZEOF_FPOS_T 16
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
#define SIZEOF_LONG_DOUBLE 16
|
||||
#define SIZEOF_PID_T 4
|
||||
#define SIZEOF_UINTPTR_T 8
|
||||
#define SIZEOF_PTHREAD_T 8
|
||||
#define SIZEOF_OFF_T 8
|
||||
|
||||
/* Enable threading */
|
||||
/* Alignments */
|
||||
#define ALIGNOF_SIZE_T 8
|
||||
#define ALIGNOF_LONG 8
|
||||
#define ALIGNOF_DOUBLE 8
|
||||
|
||||
/* Thread support */
|
||||
#ifndef MS_WINDOWS
|
||||
#define WITH_THREAD 1
|
||||
#define HAVE_PTHREAD_H 1
|
||||
#endif
|
||||
|
||||
/* Common POSIX features */
|
||||
#ifndef MS_WINDOWS
|
||||
#define HAVE_UNISTD_H 1
|
||||
#define HAVE_FCNTL_H 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
#define HAVE_DIRENT_H 1
|
||||
#define HAVE_DLFCN_H 1
|
||||
#endif
|
||||
|
||||
/* Standard C features */
|
||||
/* Standard headers */
|
||||
#define HAVE_STDINT_H 1
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_ERRNO_H 1
|
||||
#define HAVE_STDIO_H 1
|
||||
#define HAVE_LIMITS_H 1
|
||||
#define HAVE_LOCALE_H 1
|
||||
#define HAVE_SIGNAL_H 1
|
||||
#define HAVE_STDDEF_H 1
|
||||
#define HAVE_STDARG_H 1
|
||||
#define HAVE_STRINGS_H 1
|
||||
#define HAVE_WCHAR_H 1
|
||||
|
||||
/* TODO: Add more platform-specific defines as needed */
|
||||
/* This stub is incomplete. For a full build, use CPython's configure script */
|
||||
/* POSIX headers */
|
||||
#ifndef MS_WINDOWS
|
||||
#define HAVE_UNISTD_H 1
|
||||
#define HAVE_FCNTL_H 1
|
||||
#define HAVE_GRP_H 1
|
||||
#define HAVE_PWD_H 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
#define HAVE_SYS_TIMES_H 1
|
||||
#define HAVE_SYS_WAIT_H 1
|
||||
#define HAVE_SYS_RESOURCE_H 1
|
||||
#define HAVE_SYS_SELECT_H 1
|
||||
#define HAVE_SYS_SOCKET_H 1
|
||||
#define HAVE_NETINET_IN_H 1
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
#define HAVE_DIRENT_H 1
|
||||
#define HAVE_DLFCN_H 1
|
||||
#define HAVE_TERMIOS_H 1
|
||||
#define HAVE_SYS_IOCTL_H 1
|
||||
#define HAVE_SYS_PARAM_H 1
|
||||
#define HAVE_SYS_FILE_H 1
|
||||
#define HAVE_LANGINFO_H 1
|
||||
#define HAVE_SYS_UTSNAME_H 1
|
||||
#endif
|
||||
|
||||
/* Functions */
|
||||
#define HAVE_ALARM 1
|
||||
#define HAVE_CHOWN 1
|
||||
#define HAVE_CLOCK 1
|
||||
#define HAVE_CONFSTR 1
|
||||
#define HAVE_FORK 1
|
||||
#define HAVE_FSEEK64 1
|
||||
#define HAVE_FSEEKO 1
|
||||
#define HAVE_FSTATVFS 1
|
||||
#define HAVE_FSYNC 1
|
||||
#define HAVE_FTELL64 1
|
||||
#define HAVE_FTELLO 1
|
||||
#define HAVE_FTRUNCATE 1
|
||||
#define HAVE_GAI_STRERROR 1
|
||||
#define HAVE_GETGROUPS 1
|
||||
#define HAVE_GETHOSTBYNAME 1
|
||||
#define HAVE_GETLOGIN 1
|
||||
#define HAVE_GETPEERNAME 1
|
||||
#define HAVE_GETPGID 1
|
||||
#define HAVE_GETPID 1
|
||||
#define HAVE_GETPRIORITY 1
|
||||
#define HAVE_GETPWENT 1
|
||||
#define HAVE_GETTIMEOFDAY 1
|
||||
#define HAVE_GETWD 1
|
||||
#define HAVE_HYPOT 1
|
||||
#define HAVE_KILL 1
|
||||
#define HAVE_LINK 1
|
||||
#define HAVE_LSTAT 1
|
||||
#define HAVE_MKTIME 1
|
||||
#define HAVE_NICE 1
|
||||
#define HAVE_NL_LANGINFO 1
|
||||
#define HAVE_PAUSE 1
|
||||
#define HAVE_PLOCK 1
|
||||
#define HAVE_POLL 1
|
||||
#define HAVE_PTHREAD_KILL 1
|
||||
#define HAVE_PUTENV 1
|
||||
#define HAVE_READLINK 1
|
||||
#define HAVE_REALPATH 1
|
||||
#define HAVE_SELECT 1
|
||||
#define HAVE_SETGID 1
|
||||
#define HAVE_SETLOCALE 1
|
||||
#define HAVE_SETPGID 1
|
||||
#define HAVE_SETPGRP 1
|
||||
#define HAVE_SETSID 1
|
||||
#define HAVE_SETUID 1
|
||||
#define HAVE_SETVBUF 1
|
||||
#define HAVE_SIGACTION 1
|
||||
#define HAVE_SIGINTERRUPT 1
|
||||
#define HAVE_SIGRELSE 1
|
||||
#define HAVE_SNPRINTF 1
|
||||
#define HAVE_STATVFS 1
|
||||
#define HAVE_STRDUP 1
|
||||
#define HAVE_STRERROR 1
|
||||
#define HAVE_STRFTIME 1
|
||||
#define HAVE_SYMLINK 1
|
||||
#define HAVE_SYSCONF 1
|
||||
#define HAVE_TCGETPGRP 1
|
||||
#define HAVE_TCSETPGRP 1
|
||||
#define HAVE_TIMEGM 1
|
||||
#define HAVE_TIMES 1
|
||||
#define HAVE_UNAME 1
|
||||
#define HAVE_UNSETENV 1
|
||||
#define HAVE_UTIMES 1
|
||||
#define HAVE_WAITPID 1
|
||||
#define HAVE_WORKING_TZSET 1
|
||||
|
||||
/* Dynamic loading */
|
||||
#ifndef MS_WINDOWS
|
||||
#define HAVE_DYNAMIC_LOADING 1
|
||||
#define WITH_DYLD 1
|
||||
#endif
|
||||
|
||||
/* Other features */
|
||||
#define HAVE_LIBDL 1
|
||||
#define HAVE_LIBM 1
|
||||
#define HAVE_LIBPTHREAD 1
|
||||
#define HAVE_LIBUTIL 1
|
||||
|
||||
/* Enable large file support */
|
||||
#define _LARGEFILE_SOURCE 1
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
|
||||
/* Compiler features */
|
||||
#define HAVE_GCC_ASM_FOR_X87 1
|
||||
#define HAVE_GCC_ASM_FOR_X64 1
|
||||
#define HAVE_GCC_UINT128_T 1
|
||||
|
||||
/* Python-specific */
|
||||
#define PLATLIBDIR "lib"
|
||||
#define PYTHONPATH ":"
|
||||
#define PREFIX "/usr/local"
|
||||
#define EXEC_PREFIX "/usr/local"
|
||||
#define VPATH ""
|
||||
#define _PYTHONFRAMEWORK ""
|
||||
|
||||
/* Platform */
|
||||
#ifdef __linux__
|
||||
#define PLATFORM "linux"
|
||||
#elif defined(__APPLE__)
|
||||
#define PLATFORM "darwin"
|
||||
#else
|
||||
#define PLATFORM "posix"
|
||||
#endif
|
||||
|
||||
/* Miscellaneous */
|
||||
#define HAVE_COMPUTED_GOTOS 1
|
||||
#define USE_COMPUTED_GOTOS 1
|
||||
|
||||
#endif /* Py_PYCONFIG_H */
|
||||
|
||||
Reference in New Issue
Block a user