Files
MINGW-packages/mingw-w64-python3/0300-MINGW-configure-for-shared-build.patch

52 lines
1.4 KiB
Diff

diff -Naur Python-3.7.0-orig/configure.ac Python-3.7.0/configure.ac
--- Python-3.7.0-orig/configure.ac 2018-07-12 10:20:58.876714100 +0300
+++ Python-3.7.0/configure.ac 2018-07-12 10:21:05.771926200 +0300
@@ -1226,6 +1226,13 @@
;;
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
@@ -1234,6 +1241,10 @@
LDLIBRARY='libpython$(LDVERSION).dll.a'
;;
esac
+ case $host in
+ *-*-mingw*)
+ LDLIBRARY='libpython$(LDVERSION).a';;
+ esac
fi
if test "$cross_compiling" = yes; then
@@ -2742,6 +2753,12 @@
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}
@@ -5496,7 +5513,8 @@
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