summarylogtreecommitdiffstats
path: root/0013-MINGW-configure-for-shared-build.patch
blob: 43a074da2c619319834c643dd19b44df584d7d8d (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
66
67
68
69
From ed8995bda0e5acd112b43ee5662df3640f6154f3 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:24 +0530
Subject: [PATCH 013/N] MINGW configure for shared build
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Co-authored-by: Алексей <alexey.pawlow@gmail.com>
---
 configure.ac | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 806ebe0..6ebf250 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1233,6 +1233,13 @@ if test $enable_shared = "yes"; then
 	;;
 
   esac
+  case $host in
+    *-*-mingw*)
+        LDLIBRARY='libpython$(LDVERSION).dll.a'
+        DLLLIBRARY='libpython$(LDVERSION).dll'
+        BLDLIBRARY='-L. -lpython$(LDVERSION)'
+        ;;
+  esac
 else # shared is disabled
   PY_ENABLE_SHARED=0
   case $ac_sys_system in
@@ -1241,6 +1248,10 @@ else # shared is disabled
           LDLIBRARY='libpython$(LDVERSION).dll.a'
           ;;
   esac
+  case $host in
+    *-*-mingw*)
+          LDLIBRARY='libpython$(LDVERSION).a';;
+  esac
 fi
 
 if test "$cross_compiling" = yes; then
@@ -2843,6 +2854,12 @@ then
 		LDCXXSHARED="g++ -shared -Wl,--enable-auto-image-base";;
 	*)	LDSHARED="ld";;
 	esac
+	case $host in
+	*-*-mingw*)
+		LDSHARED='$(CC) -shared -Wl,--enable-auto-image-base'
+		LDCXXSHARED='$(CXX) -shared -Wl,--enable-auto-image-base'
+		;;
+	esac
 fi
 AC_MSG_RESULT($LDSHARED)
 LDCXXSHARED=${LDCXXSHARED-$LDSHARED}
@@ -5670,7 +5687,8 @@ case $host in
     dnl "errmap.h" from $srcdir/PC.
     dnl Note we cannot use BASECPPFLAGS as autogenerated pyconfig.h
     dnl has to be before customized located in ../PC.
-    CPPFLAGS="-I\$(srcdir)/PC $CPPFLAGS"
+    dnl (-I. at end is workaround for setup.py logic)
+    CPPFLAGS="-I\$(srcdir)/PC $CPPFLAGS -I."
     ;;
 esac
 
-- 
2.33.0