From 67df9782e94765a281a82a7672d39ebb4bf58828 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter_e@gmx.net>
Date: Sat, 2 May 2015 13:23:16 -0400
Subject: [PATCH] Windows also needs an override of the shared libpython
 detection

---
 configure                | 11 +++++++----
 configure.in             | 11 +++++++----
 src/pl/plpython/Makefile |  1 -
 3 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index 17105fa9e9..6691d7382c 100755
--- a/configure
+++ b/configure
@@ -7549,15 +7549,18 @@ fi
   # we see if there is a file that is named like a shared library.
 
   if test "$python_enable_shared" != 1; then
-    # OS X does supply a .dylib even though Py_ENABLE_SHARED does not
-    # get set.  The file detection logic below doesn't succeed on
-    # older OS X versions, so make it explicit.
     if test "$PORTNAME" = darwin; then
+      # OS X does supply a .dylib even though Py_ENABLE_SHARED does
+      # not get set.  The file detection logic below doesn't succeed
+      # on older OS X versions, so make it explicit.
+      python_enable_shared=1
+    elif test "$PORTNAME" = win32; then
+      # Windows also needs an explicit override.
       python_enable_shared=1
     else
       # We don't know the platform shared library extension here yet,
       # so we try some candidates.
-      for dlsuffix in .so .dll .sl; do
+      for dlsuffix in .so .sl; do
         if ls "$python_libdir"/libpython*${dlsuffix}* >/dev/null 2>&1; then
           python_enable_shared=1
           break
diff --git a/configure.in b/configure.in
index 6cc47cd5d5..5e2db6c026 100644
--- a/configure.in
+++ b/configure.in
@@ -909,15 +909,18 @@ if test "$with_python" = yes; then
   # we see if there is a file that is named like a shared library.
 
   if test "$python_enable_shared" != 1; then
-    # OS X does supply a .dylib even though Py_ENABLE_SHARED does not
-    # get set.  The file detection logic below doesn't succeed on
-    # older OS X versions, so make it explicit.
     if test "$PORTNAME" = darwin; then
+      # OS X does supply a .dylib even though Py_ENABLE_SHARED does
+      # not get set.  The file detection logic below doesn't succeed
+      # on older OS X versions, so make it explicit.
+      python_enable_shared=1
+    elif test "$PORTNAME" = win32; then
+      # Windows also needs an explicit override.
       python_enable_shared=1
     else
       # We don't know the platform shared library extension here yet,
       # so we try some candidates.
-      for dlsuffix in .so .dll .sl; do
+      for dlsuffix in .so .sl; do
         if ls "$python_libdir"/libpython*${dlsuffix}* >/dev/null 2>&1; then
           python_enable_shared=1
           break
diff --git a/src/pl/plpython/Makefile b/src/pl/plpython/Makefile
index 8b1d8908e6..4c9d146147 100644
--- a/src/pl/plpython/Makefile
+++ b/src/pl/plpython/Makefile
@@ -8,7 +8,6 @@ include $(top_builddir)/src/Makefile.global
 # Windows needs to convert backslashed paths to normal slashes,
 # and we have to remove -lpython from the link since we are building our own
 ifeq ($(PORTNAME), win32)
-shared_libpython = yes
 python_includespec := $(subst \,/,$(python_includespec))
 override python_libspec =
 endif