mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Allow plpython to build on Win32.
Magnus Hagander
This commit is contained 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@
|
||||
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user