Files
MINGW-packages/mingw-w64-python/0011-configure-add-options-so-that-shared-build-is-possib.patch
2023-10-03 09:04:31 +02:00

60 lines
1.9 KiB
Diff

From 0f36d0e54ec627b531de674a96c2f97f5edd1425 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 011/N] configure: add options so that shared build is
possible on MINGW
Co-authored-by: Naveen M K <naveen521kk@gmail.com>
---
configure.ac | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 979d8c8..1d5bdee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1520,6 +1520,11 @@ if test $enable_shared = "yes"; then
LDLIBRARY='libpython$(LDVERSION).dll.a'
DLLLIBRARY='libpython$(LDVERSION).dll'
;;
+ MINGW*)
+ LDLIBRARY='libpython$(LDVERSION).dll.a'
+ DLLLIBRARY='libpython$(LDVERSION).dll'
+ BLDLIBRARY='-L. -lpython$(LDVERSION)'
+ ;;
SunOS*)
LDLIBRARY='libpython$(LDVERSION).so'
BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(LDVERSION)'
@@ -1570,6 +1575,9 @@ else # shared is disabled
BLDLIBRARY='$(LIBRARY)'
LDLIBRARY='libpython$(LDVERSION).dll.a'
;;
+ MINGW*)
+ LDLIBRARY='libpython$(LDVERSION).a'
+ ;;
esac
fi
@@ -3336,6 +3344,10 @@ then
CYGWIN*)
LDSHARED="gcc -shared -Wl,--enable-auto-image-base"
LDCXXSHARED="g++ -shared -Wl,--enable-auto-image-base";;
+ MINGW*)
+ LDSHARED='$(CC) -shared -Wl,--enable-auto-image-base'
+ LDCXXSHARED='$(CXX) -shared -Wl,--enable-auto-image-base'
+ ;;
*) LDSHARED="ld";;
esac
fi
@@ -6495,7 +6507,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