aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.global.in3
-rw-r--r--src/pl/plpython/Makefile26
2 files changed, 27 insertions, 2 deletions
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index c981e7ee15a..a8a3a1571da 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -1,5 +1,5 @@
# -*-makefile-*-
-# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.197 2004/10/05 19:30:19 momjian Exp $
+# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.198 2004/10/06 09:20:41 momjian Exp $
#------------------------------------------------------------------------------
# All PostgreSQL makefiles include this file and use the variables it sets,
@@ -137,6 +137,7 @@ enable_thread_safety = @enable_thread_safety@
python_includespec = @python_includespec@
python_libspec = @python_libspec@
python_configdir = @python_configdir@
+python_version = @python_version@
krb_srvtab = @krb_srvtab@
diff --git a/src/pl/plpython/Makefile b/src/pl/plpython/Makefile
index 4bcc9d88a06..5ed72d155f8 100644
--- a/src/pl/plpython/Makefile
+++ b/src/pl/plpython/Makefile
@@ -1,4 +1,4 @@
-# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.14 2004/09/24 20:08:42 tgl Exp $
+# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.15 2004/10/06 09:20:41 momjian Exp $
subdir = src/pl/plpython
top_builddir = ../../..
@@ -12,6 +12,12 @@ ifneq (,$(wildcard $(python_configdir)/libpython*$(DLSUFFIX)*))
shared_libpython = yes
endif
+# Convert backslashed paths to normal slashes
+ifeq ($(PORTNAME), win32)
+shared_libpython = yes
+python_includespec := $(subst \,/,$(python_includespec))
+endif
+
# Darwin (OS X) has its own ideas about how to do this.
ifeq ($(PORTNAME), darwin)
shared_libpython = yes
@@ -30,6 +36,21 @@ SO_MAJOR_VERSION = 0
SO_MINOR_VERSION = 0
OBJS = plpython.o
+
+# Python on win32 ships with import libraries only for Microsoft Visual C++,
+# which are not compatible with mingw gcc. Therefore we need to build a
+# new import library to link with.
+ifeq ($(PORTNAME), win32)
+pytverstr=$(subst .,,${python_version})
+OBJS += libpython${pytverstr}.a
+libpython${pytverstr}.a: python${pytverstr}.def
+ dlltool --dllname python${pytverstr}.dll --def python${pytverstr}.def --output-lib libpython${pytverstr}.a
+WD=$(subst \,/,$(WINDIR))
+python${pytverstr}.def: $(WD)/system32/python${pytverstr}.dll
+ pexports $(WD)/system32/python${pytverstr}.dll > python${pytverstr}.def
+endif
+
+
SHLIB_LINK = $(BE_DLLLIBS) $(python_libspec)
include $(top_srcdir)/src/Makefile.shlib
@@ -55,6 +76,9 @@ uninstall:
clean distclean maintainer-clean: clean-lib
rm -f $(OBJS)
@rm -f error.diff feature.diff error.output feature.output test.log
+ifeq ($(PORTNAME), win32)
+ rm -f python${pytverstr}.def
+endif
installcheck:
PATH=$(bindir):$$PATH $(SHELL) $(srcdir)/test.sh