1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
From aacd49b757cccfef161f2107248b8a80ab62f3d5 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Sat, 31 Jul 2021 15:55:00 +0200
Subject: [PATCH 123/N] Make sure MACHDEP matches sys.platform
MACHDEP=win32
This simplifies things a bit and also makes sure that
_PYTHON_SYSCONFIGDATA_NAME is set correctly when cross compiling
---
Python/getplatform.c | 6 ------
configure.ac | 17 +++++------------
2 files changed, 5 insertions(+), 18 deletions(-)
diff --git a/Python/getplatform.c b/Python/getplatform.c
index 636b0a8..81a0f7a 100644
--- a/Python/getplatform.c
+++ b/Python/getplatform.c
@@ -1,12 +1,6 @@
#include "Python.h"
-#ifdef __MINGW32__
-# undef PLATFORM
-/* see PC/pyconfig.h */
-# define PLATFORM "win32"
-#endif
-
#ifndef PLATFORM
#define PLATFORM "unknown"
#endif
diff --git a/configure.ac b/configure.ac
index 215dc75..736e1b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -383,17 +383,6 @@ AC_DEFINE_UNQUOTED(_PYTHONFRAMEWORK, "${PYTHONFRAMEWORK}", [framework name])
# Set name for machine-dependent library files
AC_ARG_VAR([MACHDEP], [name for machine-dependent library files])
AC_MSG_CHECKING(MACHDEP)
-case $host in
- *-*-mingw*)
- # On those hosts MACHDEP is 'win', as platform specific files
- # go in plat-$(MACHDEP), but runtime platform is 'win32'
- test -z "$MACHDEP" && MACHDEP=win
-
- dnl Configuration will be based only on "host triplet" as build
- dnl must not depend from posix compatible environement.
- ac_sys_system=ignore
- ;;
-esac
if test -z "$MACHDEP"
then
# avoid using uname for cross builds
@@ -412,6 +401,9 @@ then
*-*-cygwin*)
ac_sys_system=Cygwin
;;
+ *-*-mingw*)
+ ac_sys_system=MINGW
+ ;;
*-*-darwin*)
ac_sys_system=Darwin
ac_sys_release=$(echo $host | sed -n 's/.*-[^0-9]\+\([0-9]\+\)/\1/p')
@@ -461,6 +453,7 @@ then
linux*) MACHDEP="linux";;
cygwin*) MACHDEP="cygwin";;
darwin*) MACHDEP="darwin";;
+ mingw*) MACHDEP="win32";;
'') MACHDEP="unknown";;
esac
fi
@@ -5236,7 +5229,7 @@ AC_MSG_RESULT($LDVERSION)
# On Android and Cygwin the shared libraries must be linked with libpython.
AC_SUBST(LIBPYTHON)
-if test -n "$ANDROID_API_LEVEL" -o "$MACHDEP" = "cygwin" -o "$MACHDEP" = "win"; then
+if test -n "$ANDROID_API_LEVEL" -o "$MACHDEP" = "cygwin" -o "$MACHDEP" = "win32"; then
LIBPYTHON="-lpython${VERSION}${ABIFLAGS}"
else
LIBPYTHON=''
--
2.32.0
|