summarylogtreecommitdiffstats
path: root/0011-MINGW-determine-if-pwdmodule-should-be-used.patch
blob: 06e38e5c3f1c5e4cf10ea3b0a51f7d8191afe11b (plain)
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
From 892c8b91944241a71222a04d9276fdd409479408 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?=
 <alexey.pawlow@gmail.com>
Date: Thu, 17 Jun 2021 18:51:21 +0530
Subject: [PATCH 011/N] MINGW determine if pwdmodule should be used
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
---
 Modules/Setup           | 2 --
 Modules/Setup.config.in | 3 +++
 configure.ac            | 7 +++++++
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/Modules/Setup b/Modules/Setup
index 6b6926d..2bafdd0 100644
--- a/Modules/Setup
+++ b/Modules/Setup
@@ -102,8 +102,6 @@ PYTHONPATH=$(COREPYTHONPATH)
 # setup.py script in the root of the Python source tree.
 
 errno errnomodule.c			# posix (UNIX) errno values
-pwd pwdmodule.c				# this is needed to find out the user's home dir
-					# if $HOME is not set
 _sre _sre.c				# Fredrik Lundh's new regular expressions
 _codecs _codecsmodule.c			# access to the builtin codecs and codec registry
 _weakref _weakref.c			# weak references
diff --git a/Modules/Setup.config.in b/Modules/Setup.config.in
index 612cabd..d071a74 100644
--- a/Modules/Setup.config.in
+++ b/Modules/Setup.config.in
@@ -6,6 +6,9 @@
 # init system calls(posix/nt/...) for INITFUNC (used by makesetup)
 @INITSYS@ -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal posixmodule.c
 
+# This is needed to find out the user's home dir if $HOME is not set
+@USE_PWD_MODULE@pwd pwdmodule.c
+
 # build-in modules for windows platform:
 @USE_WIN32_MODULE@winreg ../PC/winreg.c
 
diff --git a/configure.ac b/configure.ac
index 59f3edc..806ebe0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3333,6 +3333,13 @@ case $host in
   *-*-mingw*) USE_WIN32_MODULE=;;
 esac
 
+# Determine if pwdmodule should be used.
+AC_SUBST(USE_PWD_MODULE)
+USE_PWD_MODULE=
+case $host in
+  *-*-mingw*) USE_PWD_MODULE='#';;
+esac
+
 # Templates for things AC_DEFINEd more than once.
 # For a single AC_DEFINE, no template is needed.
 AH_TEMPLATE(_REENTRANT,
-- 
2.33.0