mirror of https://github.com/postgres/postgres
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
97 lines
2.8 KiB
97 lines
2.8 KiB
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.16 2004/10/10 19:07:55 tgl Exp $
|
|
|
|
subdir = src/pl/plpython
|
|
top_builddir = ../../..
|
|
include $(top_builddir)/src/Makefile.global
|
|
|
|
|
|
# On some platforms we can only build PL/Python if libpython is a
|
|
# shared library. Since there is no official way to determine this,
|
|
# we see if there is a file that is named like a shared library.
|
|
ifneq (,$(wildcard $(python_configdir)/libpython*$(DLSUFFIX)*))
|
|
shared_libpython = yes
|
|
endif
|
|
|
|
# Windows needs to convert backslashed paths to normal slashes,
|
|
# and we have to remove -lpython from libspec since we are building our own
|
|
ifeq ($(PORTNAME), win32)
|
|
shared_libpython = yes
|
|
python_includespec := $(subst \,/,$(python_includespec))
|
|
python_libspec := $(subst -lpython$(python_version),,$(python_libspec))
|
|
endif
|
|
|
|
# Darwin (OS X) has its own ideas about how to do this.
|
|
ifeq ($(PORTNAME), darwin)
|
|
shared_libpython = yes
|
|
override python_libspec := -framework Python
|
|
endif
|
|
|
|
# If we don't have a shared library and the platform doesn't allow it
|
|
# to work without, we have to skip it.
|
|
ifneq (,$(findstring yes, $(shared_libpython)$(allow_nonpic_in_shlib)))
|
|
|
|
override CPPFLAGS := -I$(srcdir) $(python_includespec) $(CPPFLAGS)
|
|
rpath :=
|
|
|
|
NAME = plpython
|
|
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
|
|
|
|
|
|
all: all-lib
|
|
|
|
install: all installdirs
|
|
ifeq ($(enable_shared), yes)
|
|
$(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/plpython$(DLSUFFIX)
|
|
else
|
|
@echo "*****"; \
|
|
echo "* PL/Python was not installed due to lack of shared library support."; \
|
|
echo "*****"
|
|
endif
|
|
|
|
installdirs:
|
|
$(mkinstalldirs) $(DESTDIR)$(pkglibdir)
|
|
|
|
uninstall:
|
|
rm -f $(DESTDIR)$(pkglibdir)/plpython$(DLSUFFIX)
|
|
|
|
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
|
|
|
|
else # can't build
|
|
|
|
all:
|
|
@echo ""; \
|
|
echo "*** Cannot build PL/Python because libpython is not a shared library." ; \
|
|
echo "*** You might have to rebuild your Python installation. Refer to"; \
|
|
echo "*** the documentation for details."; \
|
|
echo ""
|
|
|
|
endif # can't build
|
|
|