Skip to content

Commit 2f7de7a

Browse files
committed
Switch on platform_dispatchers
93438876ebd102c07d52ce42cc48e5465a7277ff
1 parent 3cfc201 commit 2f7de7a

File tree

5 files changed

+32
-32
lines changed

5 files changed

+32
-32
lines changed

contrib/tools/python3/Include/pyconfig-linux.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1612,7 +1612,10 @@
16121612
#define PY_SUPPORT_TIER 1
16131613

16141614
/* Define if you want to build an interpreter with many run-time checks. */
1615-
/* #undef Py_DEBUG */
1615+
#if !defined(NDEBUG) && !defined(Py_LIMITED_API) && !defined(DISABLE_PYDEBUG)
1616+
#define Py_DEBUG
1617+
#define GC_NDEBUG
1618+
#endif
16161619

16171620
/* Defined if Python is built as a shared library. */
16181621
/* #undef Py_ENABLE_SHARED */

contrib/tools/python3/Include/pyconfig-osx-arm64.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1610,7 +1610,10 @@
16101610
#define PY_SUPPORT_TIER 2
16111611

16121612
/* Define if you want to build an interpreter with many run-time checks. */
1613-
/* #undef Py_DEBUG */
1613+
#if !defined(NDEBUG) && !defined(Py_LIMITED_API) && !defined(DISABLE_PYDEBUG)
1614+
#define Py_DEBUG
1615+
#define GC_NDEBUG
1616+
#endif
16141617

16151618
/* Defined if Python is built as a shared library. */
16161619
/* #undef Py_ENABLE_SHARED */

contrib/tools/python3/Include/pyconfig-win.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,9 @@
44

55
#define Py_NO_ENABLE_SHARED
66

7+
#if !defined(NDEBUG) && !defined(Py_LIMITED_API) && !defined(DISABLE_PYDEBUG)
8+
#define Py_DEBUG
9+
#define GC_NDEBUG
10+
#endif
11+
712
#include "../PC/pyconfig.h"

contrib/tools/python3/Include/pyconfig.h

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,5 @@
11
#pragma once
22

3-
#if defined(Py_BUILD_CORE) || defined(Py_BUILD_CORE_BUILTIN) || defined(Py_BUILD_CORE_MODULE)
4-
5-
#define ABIFLAGS ""
6-
7-
// Need for Modules/getpath.c
8-
#define PREFIX "/var/empty"
9-
#define EXEC_PREFIX "/var/empty"
10-
#define VERSION "3.12"
11-
#define VPATH ""
12-
#define PLATLIBDIR "lib"
13-
14-
#define USE_ZLIB_CRC32
15-
16-
#if defined(__linux__)
17-
# define PLATFORM "linux"
18-
# define MULTIARCH "x86_64-linux-gnu"
19-
# define SOABI "cpython-312-x86_64-linux-gnu"
20-
#elif defined(__APPLE__)
21-
# define PLATFORM "darwin"
22-
# define MULTIARCH "darwin"
23-
# define SOABI "cpython-312-darwin"
24-
#endif
25-
26-
#endif
27-
28-
#if !defined(NDEBUG) && !defined(Py_DEBUG) && !defined(Py_LIMITED_API) && !defined(DISABLE_PYDEBUG)
29-
#define Py_DEBUG
30-
#define GC_NDEBUG
31-
#endif
32-
333
#if defined(__APPLE__) && (defined(__aarch64__) || defined(_M_ARM64))
344
# include "pyconfig-osx-arm64.h"
355
#elif defined(__APPLE__) && (defined(__x86_64__) || defined(_M_X64))

contrib/tools/python3/ya.make

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ NO_UTIL()
3838
CFLAGS(
3939
-DPy_BUILD_CORE
4040
-DPy_BUILD_CORE_BUILTIN
41+
-DUSE_ZLIB_CRC32
42+
-DABIFLAGS=\"\"
43+
-DPREFIX=\"/var/empty\"
44+
-DEXEC_PREFIX=\"/var/empty\"
45+
-DVERSION=\"3.12\"
46+
-DVPATH=\"\"
47+
-DPLATLIBDIR=\"lib\"
4148
)
4249

4350
IF (CLANG_CL)
@@ -47,10 +54,22 @@ IF (CLANG_CL)
4754
ENDIF()
4855

4956
IF (OS_DARWIN)
57+
CFLAGS(
58+
-DPLATFORM=\"darwin\"
59+
-DMULTIARCH=\"darwin\"
60+
-DSOABI=\"cpython-312-darwin\"
61+
)
62+
5063
LDFLAGS(
5164
-framework CoreFoundation
5265
-framework SystemConfiguration
5366
)
67+
ELSEIF (OS_LINUX)
68+
CFLAGS(
69+
-DPLATFORM=\"linux\"
70+
-DMULTIARCH=\"x86_64-linux-gnu\"
71+
-DSOABI=\"cpython-312-x86_64-linux-gnu\"
72+
)
5473
ELSEIF (OS_WINDOWS)
5574
CFLAGS(
5675
-DPY3_DLLNAME=L\"python3\"

0 commit comments

Comments
 (0)