3 subdir
= src
/pl
/plpython
4 top_builddir
= ..
/..
/..
5 include $(top_builddir
)/src
/Makefile.global
8 # On some platforms we can only build PL/Python if libpython is a
9 # shared library. Since there is no official way to determine this
10 # (at least not in pre-2.3 Python), we see if there is a file that is
11 # named like a shared library.
12 ifneq (,$(wildcard $(python_libdir
)/libpython
*$(DLSUFFIX
)*))
13 shared_libpython
= yes
16 # Windows needs to convert backslashed paths to normal slashes,
17 # and we have to remove -lpython from the link since we are building our own
18 ifeq ($(PORTNAME
), win32
)
19 shared_libpython
= yes
20 python_includespec
:= $(subst \
,/,$(python_includespec
))
21 override python_libspec
=
24 # Darwin (OS X) has its own ideas about how to do this.
25 ifeq ($(PORTNAME
), darwin
)
26 shared_libpython
= yes
27 override python_libspec
= -framework Python
28 override python_additional_libs
=
31 # If we don't have a shared library and the platform doesn't allow it
32 # to work without, we have to skip it.
33 ifneq (,$(findstring yes
, $(shared_libpython
)$(allow_nonpic_in_shlib
)))
35 override CPPFLAGS
:= -I
$(srcdir) $(python_includespec
) $(CPPFLAGS
)
37 rpathdir
= $(python_libdir
)
43 # Python on win32 ships with import libraries only for Microsoft Visual C++,
44 # which are not compatible with mingw gcc. Therefore we need to build a
45 # new import library to link with.
46 ifeq ($(PORTNAME
), win32
)
47 pytverstr
=$(subst .
,,${python_version})
48 OBJS
+= libpython
${pytverstr}.a
49 libpython
${pytverstr}.a
: python
${pytverstr}.def
50 dlltool
--dllname python
${pytverstr}.dll
--def python
${pytverstr}.def
--output-lib libpython
${pytverstr}.a
51 WD
=$(subst \
,/,$(WINDIR
))
52 python
${pytverstr}.def
: $(WD
)/system32
/python
${pytverstr}.dll
53 pexports
$(WD
)/system32
/python
${pytverstr}.dll
> python
${pytverstr}.def
57 SHLIB_LINK
= $(python_libspec
) $(python_additional_libs
)
59 REGRESS_OPTS
= --dbname
=$(PL_TESTDB
) --load-language
=plpythonu
60 REGRESS
= plpython_schema plpython_populate plpython_function plpython_test plpython_error plpython_drop
61 # where to find psql for running the tests
64 include $(top_srcdir
)/src
/Makefile.shlib
69 install: all installdirs install-lib
71 installdirs: installdirs-lib
73 uninstall: uninstall-lib
76 $(top_builddir
)/src
/test/regress
/pg_regress
--inputdir
=$(srcdir) --psqldir
=$(PSQLDIR
) $(REGRESS_OPTS
) $(REGRESS
)
80 $(MAKE
) -C
$(top_builddir
)/src
/test/regress pg_regress
$(X
)
82 clean distclean maintainer-clean
: clean-lib
85 rm -f regression.diffs regression.out
86 ifeq ($(PORTNAME
), win32
)
87 rm -f python
${pytverstr}.def
94 echo
"*** Cannot build PL/Python because libpython is not a shared library." ; \
95 echo
"*** You might have to rebuild your Python installation. Refer to"; \
96 echo
"*** the documentation for details."; \