mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
Allow plpython to build on Win32.
Magnus Hagander
This commit is contained in:
@ -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