99 lines
2.6 KiB
Diff
99 lines
2.6 KiB
Diff
From 0ac134000d160b50609d66e978e2498feb4e0417 Mon Sep 17 00:00:00 2001
|
|
From: Roumen Petrov <local@example.net>
|
|
Date: Tue, 26 Feb 2013 23:55:05 +0200
|
|
Subject: [PATCH 05/24] MINGW: dynamic loading support
|
|
|
|
---
|
|
Makefile.pre.in | 6 ++++++
|
|
Python/dynload_win.c | 10 ++++++++++
|
|
configure.ac | 15 +++++++++++++++
|
|
3 files changed, 31 insertions(+)
|
|
|
|
diff --git a/Makefile.pre.in b/Makefile.pre.in
|
|
index 52fc911..58334fe 100644
|
|
--- a/Makefile.pre.in
|
|
+++ b/Makefile.pre.in
|
|
@@ -666,6 +666,12 @@ Python/dynload_hpux.o: $(srcdir)/Python/dynload_hpux.c Makefile
|
|
-DSHLIB_EXT='"$(EXT_SUFFIX)"' \
|
|
-o $@ $(srcdir)/Python/dynload_hpux.c
|
|
|
|
+Python/dynload_win.o: $(srcdir)/Python/dynload_win.c Makefile
|
|
+ $(CC) -c $(PY_CORE_CFLAGS) \
|
|
+ -DSHLIB_SUFFIX='"$(SHLIB_SUFFIX)"' \
|
|
+ -DEXT_SUFFIX='"$(EXT_SUFFIX)"' \
|
|
+ -o $@ $(srcdir)/Python/dynload_win.c
|
|
+
|
|
Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile
|
|
$(CC) -c $(PY_CORE_CFLAGS) \
|
|
-DABIFLAGS='"$(ABIFLAGS)"' \
|
|
diff --git a/Python/dynload_win.c b/Python/dynload_win.c
|
|
index ffcf0ee..62adea5 100644
|
|
--- a/Python/dynload_win.c
|
|
+++ b/Python/dynload_win.c
|
|
@@ -18,6 +18,12 @@ void _Py_DeactivateActCtx(ULONG_PTR cookie);
|
|
#endif
|
|
|
|
const char *_PyImport_DynLoadFiletab[] = {
|
|
+#ifdef EXT_SUFFIX
|
|
+ EXT_SUFFIX, /* include SOABI flags where is encoded debug */
|
|
+#endif
|
|
+#ifdef SHLIB_SUFFIX
|
|
+ "-abi" PYTHON_ABI_STRING SHLIB_SUFFIX,
|
|
+#endif
|
|
#ifdef _DEBUG
|
|
"_d.pyd",
|
|
#else
|
|
@@ -27,6 +33,10 @@ const char *_PyImport_DynLoadFiletab[] = {
|
|
};
|
|
|
|
|
|
+#if defined(__MINGW32__)
|
|
+/* avoid compile error: conflicting types for 'strcasecmp' */
|
|
+# define strcasecmp fake_strcasecmp
|
|
+#endif
|
|
/* Case insensitive string compare, to avoid any dependencies on particular
|
|
C RTL implementations */
|
|
|
|
diff --git a/configure.ac b/configure.ac
|
|
index 23d83d1..14e0035 100644
|
|
--- a/configure.ac
|
|
+++ b/configure.ac
|
|
@@ -2043,6 +2043,9 @@ if test -z "$SHLIB_SUFFIX"; then
|
|
CYGWIN*) SHLIB_SUFFIX=.dll;;
|
|
*) SHLIB_SUFFIX=.so;;
|
|
esac
|
|
+ case $host_os in
|
|
+ mingw*) SHLIB_SUFFIX=.dll;;
|
|
+ esac
|
|
fi
|
|
AC_MSG_RESULT($SHLIB_SUFFIX)
|
|
|
|
@@ -2933,6 +2936,12 @@ then
|
|
fi
|
|
;;
|
|
esac
|
|
+ case $host in
|
|
+ *-*-mingw*)
|
|
+ DYNLOADFILE="dynload_win.o"
|
|
+ extra_machdep_objs="$extra_machdep_objs PC/dl_nt.o"
|
|
+ ;;
|
|
+ esac
|
|
fi
|
|
AC_MSG_RESULT($DYNLOADFILE)
|
|
if test "$DYNLOADFILE" != "dynload_stub.o"
|
|
@@ -4156,6 +4165,12 @@ case $ac_sys_system in
|
|
*)
|
|
EXT_SUFFIX=${SHLIB_SUFFIX};;
|
|
esac
|
|
+case $host_os in
|
|
+ mingw*)
|
|
+ dnl Synchronized with _PyImport_DynLoadFiletab (dynload_win.c)
|
|
+ dnl Do not use more then one dot on this platform !
|
|
+ EXT_SUFFIX=-$SOABI$SHLIB_SUFFIX;;
|
|
+esac
|
|
|
|
AC_MSG_CHECKING(LDVERSION)
|
|
LDVERSION='$(VERSION)$(ABIFLAGS)'
|
|
--
|
|
1.7.12.1
|