head	1.36;
access;
symbols
	REL9_0_0:1.36
	REL9_1_ALPHA1:1.36
	REL9_0_RC1:1.36
	REL9_0_BETA4:1.36
	REL9_0_STABLE:1.36.0.6
	REL9_0_BETA3:1.36
	REL9_0_BETA2:1.36
	REL7_4_29:1.11.6.1
	REL8_0_25:1.18
	REL8_1_21:1.23
	REL8_2_17:1.26
	REL8_3_11:1.28
	REL8_4_4:1.32
	REL9_0_BETA1:1.36
	REL9_0_ALPHA5_BRANCH:1.36.0.4
	REL9_0_ALPHA5:1.36
	REL7_4_28:1.11.6.1
	REL8_0_24:1.18
	REL8_1_20:1.23
	REL8_2_16:1.26
	REL8_3_10:1.28
	REL8_4_3:1.32
	REL9_0_ALPHA4:1.36
	REL9_0_ALPHA4_BRANCH:1.36.0.2
	REL8_5_ALPHA3:1.35
	REL8_5_ALPHA3_BRANCH:1.35.0.2
	REL7_4_27:1.11.6.1
	REL8_0_23:1.18
	REL8_1_19:1.23
	REL8_2_15:1.26
	REL8_3_9:1.28
	REL8_4_2:1.32
	REL8_5_ALPHA2:1.34
	REL8_5_ALPHA2_BRANCH:1.34.0.4
	REL7_4_26:1.11.6.1
	REL8_0_22:1.18
	REL8_1_18:1.23
	REL8_2_14:1.26
	REL8_3_8:1.28
	REL8_4_1:1.32
	REL8_5_ALPHA1:1.34
	REL8_5_ALPHA1_BRANCH:1.34.0.2
	REL8_4_STABLE:1.32.0.2
	REL8_4_0:1.32
	REL8_4_RC2:1.32
	REL8_4_RC1:1.32
	REL8_4_BETA2:1.32
	REL8_4_BETA1:1.32
	REL7_4_25:1.11.6.1
	REL8_0_21:1.18
	REL8_1_17:1.23
	REL8_2_13:1.26
	REL8_3_7:1.28
	REL7_4_24:1.11.6.1
	REL8_0_20:1.18
	REL8_1_16:1.23
	REL8_2_12:1.26
	REL8_3_6:1.28
	REL7_4_23:1.11.6.1
	REL8_0_19:1.18
	REL8_1_15:1.23
	REL8_2_11:1.26
	REL8_3_5:1.28
	REL7_4_22:1.11.6.1
	REL8_0_18:1.18
	REL8_1_14:1.23
	REL8_2_10:1.26
	REL8_3_4:1.28
	REL7_4_21:1.11.6.1
	REL8_0_17:1.18
	REL8_1_13:1.23
	REL8_2_9:1.26
	REL8_3_3:1.28
	REL7_4_20:1.11.6.1
	REL8_0_16:1.18
	REL8_1_12:1.23
	REL8_2_8:1.26
	REL8_3_2:1.28
	REL8_2_7:1.26
	REL8_3_1:1.28
	REL8_3_STABLE:1.28.0.2
	REL8_3_0:1.28
	REL8_3_RC2:1.28
	REL7_3_21:1.11
	REL7_4_19:1.11.6.1
	REL8_0_15:1.18
	REL8_1_11:1.23
	REL8_2_6:1.26
	REL8_3_RC1:1.28
	REL8_3_BETA4:1.28
	REL8_3_BETA3:1.28
	REL8_3_BETA2:1.28
	REL8_3_BETA1:1.28
	REL7_3_20:1.11
	REL7_4_18:1.11.6.1
	REL8_0_14:1.18
	REL8_1_10:1.23
	REL8_2_5:1.26
	REL7_3_19:1.11
	REL7_4_17:1.11.6.1
	REL8_0_13:1.18
	REL8_1_9:1.23
	REL8_2_4:1.26
	REL8_0_12:1.18
	REL8_1_8:1.23
	REL8_2_3:1.26
	REL7_3_18:1.11
	REL7_4_16:1.11.6.1
	REL8_0_11:1.18
	REL8_1_7:1.23
	REL8_2_2:1.26
	REL8_0_10:1.18
	REL8_1_6:1.23
	REL8_2_1:1.26
	REL7_4_15:1.11.6.1
	REL7_3_17:1.11
	REL8_2_STABLE:1.26.0.2
	REL8_2_0:1.26
	REL8_2_RC1:1.26
	REL8_2_BETA3:1.26
	REL8_2_BETA2:1.26
	REL8_1_5:1.23
	REL8_0_9:1.18
	REL7_4_14:1.11.6.1
	REL7_3_16:1.11
	REL8_2_BETA1:1.26
	REL7_3_15:1.11
	REL7_4_13:1.11.6.1
	REL8_0_8:1.18
	REL8_1_4:1.23
	REL7_3_14:1.11
	REL7_4_12:1.11.6.1
	REL8_0_7:1.18
	REL8_1_3:1.23
	REL7_3_13:1.11
	REL7_4_11:1.11.6.1
	REL8_0_6:1.18
	REL8_1_2:1.23
	REL7_3_12:1.11
	REL7_4_10:1.11.6.1
	REL8_0_5:1.18
	REL8_1_1:1.23
	REL8_1_STABLE:1.23.0.2
	REL8_1_0:1.23
	REL8_1_0RC1:1.23
	REL8_1_0BETA4:1.23
	REL8_1_0BETA3:1.23
	REL7_3_11:1.11
	REL7_4_9:1.11.6.1
	REL8_0_4:1.18
	REL8_1_0BETA2:1.23
	REL8_1_0BETA1:1.23
	REL7_2_8:1.10
	REL7_3_10:1.11
	REL7_4_8:1.11.6.1
	REL8_0_3:1.18
	REL8_0_2:1.18
	REL7_2_7:1.10
	REL7_3_9:1.11
	REL7_4_7:1.11.6.1
	REL8_0_1:1.18
	REL8_0_STABLE:1.18.0.4
	REL8_0_0:1.18.0.2
	REL8_0_0RC5:1.18
	REL8_0_0RC4:1.18
	REL8_0_0RC3:1.18
	REL8_0_0RC2:1.18
	REL8_0_0RC1:1.18
	REL8_0_0BETA5:1.18
	REL8_0_0BETA4:1.17
	REL7_4_6:1.11.6.1
	REL7_3_8:1.11
	REL7_2_6:1.10
	REL8_0_0BETA3:1.14
	REL8_0_0BETA2:1.13
	REL7_2_5:1.10
	REL7_4_5:1.11.6.1
	REL7_3_7:1.11
	REL7_4_4:1.11.6.1
	REL8_0_0BETA1:1.13
	REL7_4_3:1.11.6.1
	REL7_4_2:1.11.6.1
	REL7_3_6:1.11
	REL7_4_1:1.11
	REL7_3_5:1.11
	REL7_4:1.11
	REL7_4_RC2:1.11
	REL7_4_STABLE:1.11.0.6
	REL7_4_RC1:1.11
	REL7_4_BETA5:1.11
	REL7_4_BETA4:1.11
	REL7_4_BETA3:1.11
	REL7_4_BETA2:1.11
	WIN32_DEV:1.11.0.4
	REL7_4_BETA1:1.11
	REL7_3_4:1.11
	REL7_3_2:1.11
	REL7_2_4:1.10
	REL7_3_STABLE:1.11.0.2
	REL7_2_3:1.10
	REL7_2_STABLE:1.10.0.2
	REL7_2:1.10
	REL7_2_RC2:1.10
	REL7_2_RC1:1.10
	REL7_2_BETA5:1.10
	REL7_2_BETA4:1.10
	REL7_2_BETA3:1.10
	REL7_2_BETA2:1.10
	REL7_2_BETA1:1.10;
locks; strict;
comment	@# @;


1.36
date	2010.01.22.15.45.15;	author petere;	state Exp;
branches;
next	1.35;

1.35
date	2009.12.15.22.59.54;	author petere;	state Exp;
branches;
next	1.34;

1.34
date	2009.08.14.13.42.16;	author petere;	state Exp;
branches;
next	1.33;

1.33
date	2009.08.12.16.37.25;	author petere;	state Exp;
branches;
next	1.32;

1.32
date	2009.01.15.13.49.56;	author petere;	state Exp;
branches;
next	1.31;

1.31
date	2008.10.02.08.11.11;	author petere;	state Exp;
branches;
next	1.30;

1.30
date	2008.10.01.22.38.56;	author petere;	state Exp;
branches;
next	1.29;

1.29
date	2008.04.07.14.15.58;	author petere;	state Exp;
branches;
next	1.28;

1.28
date	2007.02.10.04.26.24;	author tgl;	state Exp;
branches;
next	1.27;

1.27
date	2007.02.09.15.56.00;	author petere;	state Exp;
branches;
next	1.26;

1.26
date	2006.07.21.00.24.04;	author tgl;	state Exp;
branches;
next	1.25;

1.25
date	2006.07.19.02.37.00;	author tgl;	state Exp;
branches;
next	1.24;

1.24
date	2005.12.09.21.19.36;	author petere;	state Exp;
branches;
next	1.23;

1.23
date	2005.08.12.21.44.51;	author momjian;	state Exp;
branches;
next	1.22;

1.22
date	2005.08.12.20.57.11;	author momjian;	state Exp;
branches;
next	1.21;

1.21
date	2005.05.24.17.07.41;	author tgl;	state Exp;
branches;
next	1.20;

1.20
date	2005.05.17.18.26.23;	author tgl;	state Exp;
branches;
next	1.19;

1.19
date	2005.05.14.17.55.21;	author tgl;	state Exp;
branches;
next	1.18;

1.18
date	2004.11.19.19.23.01;	author tgl;	state Exp;
branches;
next	1.17;

1.17
date	2004.10.11.19.32.19;	author tgl;	state Exp;
branches;
next	1.16;

1.16
date	2004.10.10.19.07.55;	author tgl;	state Exp;
branches;
next	1.15;

1.15
date	2004.10.06.09.20.41;	author momjian;	state Exp;
branches;
next	1.14;

1.14
date	2004.09.24.20.08.42;	author tgl;	state Exp;
branches;
next	1.13;

1.13
date	2004.01.21.19.04.11;	author tgl;	state Exp;
branches;
next	1.12;

1.12
date	2003.11.29.19.52.12;	author pgsql;	state Exp;
branches;
next	1.11;

1.11
date	2002.09.05.18.28.46;	author petere;	state Exp;
branches
	1.11.6.1;
next	1.10;

1.10
date	2001.09.16.16.11.11;	author petere;	state Exp;
branches;
next	1.9;

1.9
date	2001.08.27.00.29.49;	author petere;	state Exp;
branches;
next	1.8;

1.8
date	2001.07.10.16.33.02;	author petere;	state Exp;
branches;
next	1.7;

1.7
date	2001.05.25.15.48.33;	author momjian;	state Exp;
branches;
next	1.6;

1.6
date	2001.05.14.22.06.50;	author petere;	state Exp;
branches;
next	1.5;

1.5
date	2001.05.12.17.49.32;	author petere;	state Exp;
branches;
next	1.4;

1.4
date	2001.05.12.01.30.30;	author petere;	state Exp;
branches;
next	1.3;

1.3
date	2001.05.10.03.00.11;	author momjian;	state Exp;
branches;
next	1.2;

1.2
date	2001.05.09.23.00.44;	author momjian;	state Exp;
branches;
next	1.1;

1.1
date	2001.05.09.19.54.38;	author momjian;	state Exp;
branches;
next	;

1.11.6.1
date	2004.01.21.19.25.11;	author tgl;	state Exp;
branches;
next	;


desc
@@


1.36
log
@PL/Python DO handler

Also cleaned up some redundancies between the primary error messages and the
error context in PL/Python.

Hannu Valtonen
@
text
@# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.35 2009/12/15 22:59:54 petere 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
# (at least not in pre-2.3 Python), we see if there is a file that is
# named like a shared library.
ifneq (,$(wildcard $(python_libdir)/libpython*$(DLSUFFIX)*))
shared_libpython = yes
endif

# Windows needs to convert backslashed paths to normal slashes,
# and we have to remove -lpython from the link since we are building our own
ifeq ($(PORTNAME), win32)
shared_libpython = yes
python_includespec := $(subst \,/,$(python_includespec))
override 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
override python_additional_libs =
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)

rpathdir = $(python_libdir)

NAME = plpython$(python_majorversion)
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 = $(python_libspec) $(python_additional_libs) $(filter -lintl,$(LIBS))

REGRESS_OPTS = --dbname=$(PL_TESTDB)
# Only load plpythonu with Python 2.  The test files themselves load
# the versioned language plpython(2|3)u.
ifeq ($(python_majorversion),2)
REGRESS_OPTS += --load-language=plpythonu
endif
REGRESS = \
	plpython_schema \
	plpython_populate \
	plpython_test \
	plpython_do \
	plpython_global \
	plpython_import \
	plpython_spi \
	plpython_newline \
	plpython_void \
	plpython_params \
	plpython_setof \
	plpython_record \
	plpython_trigger \
	plpython_types \
	plpython_error \
	plpython_unicode \
	plpython_drop
# where to find psql for running the tests
PSQLDIR = $(bindir)

include $(top_srcdir)/src/Makefile.shlib


all: all-lib

install: all installdirs install-lib
ifeq ($(python_majorversion),2)
	cd '$(DESTDIR)$(pkglibdir)' && rm -f plpython$(DLSUFFIX) && $(LN_S) $(shlib) plpython$(DLSUFFIX)
endif

installdirs: installdirs-lib

uninstall: uninstall-lib
ifeq ($(python_majorversion),2)
	rm -f '$(DESTDIR)$(pkglibdir)/plpython$(DLSUFFIX)'
endif

ifeq ($(python_majorversion),3)
# Adjust regression tests for Python 3 compatibility
prep3:
	$(MKDIR_P) python3 python3/sql python3/expected
	for file in $(srcdir)/sql/*.sql $(srcdir)/expected/*.out; do \
	  sed -e 's/except \([[:alpha:]][[:alpha:].]*\), *\([[:alpha:]][[:alpha:]]*\):/except \1 as \2:/g' \
	      -e "s/<type 'exceptions\.\([[:alpha:]]*\)'>/<class '\1'>/g" \
	      -e "s/<type 'long'>/<class 'int'>/g" \
	      -e "s/\([0-9][0-9]*\)L/\1/g" \
	      -e 's/\([ [{]\)u"/\1"/g' \
	      -e "s/\([ [{]\)u'/\1'/g" \
	      -e "s/def next/def __next__/g" \
	      -e "s/LANGUAGE plpythonu/LANGUAGE plpython3u/g" \
	      -e "s/LANGUAGE plpython2u/LANGUAGE plpython3u/g" \
	    $$file >`echo $$file | sed 's,$(srcdir),python3,'`; \
	done

clean3:
	rm -rf python3/

installcheck: submake prep3
	$(top_builddir)/src/test/regress/pg_regress --inputdir=./python3 --outputdir=./python3 --psqldir=$(PSQLDIR) $(REGRESS_OPTS) $(REGRESS)

clean: clean3
else
installcheck: submake
	$(top_builddir)/src/test/regress/pg_regress --inputdir=$(srcdir) --psqldir=$(PSQLDIR) $(REGRESS_OPTS) $(REGRESS)
endif

.PHONY: submake
submake:
	$(MAKE) -C $(top_builddir)/src/test/regress pg_regress$(X)

clean distclean maintainer-clean: clean-lib
	rm -f $(OBJS)
	rm -rf results
	rm -f regression.diffs regression.out
ifeq ($(PORTNAME), win32)
	rm -f python${pytverstr}.def
endif

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
@


1.35
log
@Python 3 support in PL/Python

Behaves more or less unchanged compared to Python 2, but the new language
variant is called plpython3u.  Documentation describing the naming scheme
is included.
@
text
@d1 1
a1 1
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.34 2009/08/14 13:42:16 petere Exp $
d69 1
@


1.34
log
@PL/Python regression tests for data type handling

Add some checks on various data types are converted into and out of Python.
This is extracted from Caleb Welton's patch for improved bytea support,
but much expanded.
@
text
@d1 1
a1 1
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.33 2009/08/12 16:37:25 petere Exp $
d39 1
a39 1
NAME = plpython
d59 6
a64 1
REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-language=plpythonu
d91 3
d98 20
d119 8
d129 1
@


1.33
log
@Split the plpython regression test into test cases arranged by topic, instead
of the previous monolithic setup-create-run sequence, that was apparently
inherited from a previous test infrastructure, but makes working with the
tests and adding new ones weird.
@
text
@d1 1
a1 1
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.32 2009/01/15 13:49:56 petere Exp $
d73 1
@


1.32
log
@Cleanup pass over PL/Python NLS.  Add translation support to PLy_elog and
PLy_exception_set, and clarify some error messages.
@
text
@d1 1
a1 1
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.31 2008/10/02 08:11:11 petere Exp $
d60 16
a75 1
REGRESS = plpython_schema plpython_populate plpython_function plpython_test plpython_error plpython_drop
@


1.31
log
@Update pg_regress calls in PL checks to handle vpath builds.
@
text
@d1 1
a1 1
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.30 2008/10/01 22:38:56 petere Exp $
d57 1
a57 1
SHLIB_LINK = $(python_libspec) $(python_additional_libs)
@


1.30
log
@Allow pg_regress to be run outside the build tree.  Look for input files
in both input and output dir, to handle vpath builds more simply.
@
text
@d1 1
a1 1
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.29 2008/04/07 14:15:58 petere Exp $
d76 1
a76 1
	$(top_builddir)/src/test/regress/pg_regress --psqldir=$(PSQLDIR) $(REGRESS_OPTS) $(REGRESS)
@


1.29
log
@Implement a few changes to how shared libraries and dynamically loadable
modules are built.  Foremost, it creates a solid distinction between these two
types of targets based on what had already been implemented and duplicated in
ad hoc ways before.  Specifically,

- Dynamically loadable modules no longer get a soname.  The numbers previously
set in the makefiles were dummy numbers anyway, and the presence of a soname
upset a few packaging tools, so it is nicer not to have one.

- The cumbersome detour taken on installation (build a libfoo.so.0.0.0 and
then override the rule to install foo.so instead) is removed.

- Lots of duplicated code simplified.
@
text
@d1 1
a1 1
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.28 2007/02/10 04:26:24 tgl Exp $
a68 21
# When doing a VPATH build, copy over the .sql and .out files so that the
# test script can find them.  See comments in src/test/regress/GNUmakefile.
ifdef VPATH

ifneq ($(PORTNAME),win32)
abs_srcdir := $(shell cd $(srcdir) && pwd)
abs_builddir := $(shell pwd)
else
abs_srcdir := $(shell cd $(srcdir) && pwd -W)
abs_builddir := $(shell pwd -W)
endif

test_files_src := $(wildcard $(srcdir)/sql/*.sql) $(wildcard $(srcdir)/expected/*.out)
test_files_build := $(patsubst $(srcdir)/%, $(abs_builddir)/%, $(test_files_src))

all: $(test_files_build)
$(test_files_build): $(abs_builddir)/%: $(srcdir)/%
	ln -s $< $@@

endif

@


1.28
log
@Put back some not-so-unnecessary-as-all-that := usages.  Per buildfarm.
@
text
@d1 1
a1 1
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.27 2007/02/09 15:56:00 petere Exp $
a39 2
SO_MAJOR_VERSION = 0
SO_MINOR_VERSION = 0
d57 1
a57 1
SHLIB_LINK = $(BE_DLLLIBS) $(python_libspec) $(python_additional_libs)
d90 1
a90 8
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
d92 1
a92 2
installdirs:
	$(mkinstalldirs) '$(DESTDIR)$(pkglibdir)'
d94 1
a94 2
uninstall:
	rm -f '$(DESTDIR)$(pkglibdir)/plpython$(DLSUFFIX)'
@


1.27
log
@Replace useless uses of := by = in makefiles.
@
text
@d1 1
a1 1
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.26 2006/07/21 00:24:04 tgl Exp $
d20 1
a20 1
python_includespec = $(subst \,/,$(python_includespec))
@


1.26
log
@Ah, I finally realize why Magnus wanted to add a --bindir option to
pg_regress: there's no other way to cope with testing a relocated
installation.  Seems better to call it --psqldir though, since the
only thing we need to find in that case is psql.  It'd be better if
we could use find_other_exec, but that's not happening unless we are
willing to install pg_regress alongside psql, which seems unlikely
to happen.
@
text
@d1 1
a1 1
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.25 2006/07/19 02:37:00 tgl Exp $
d20 2
a21 2
python_includespec := $(subst \,/,$(python_includespec))
override python_libspec :=
d27 2
a28 2
override python_libspec := -framework Python
override python_additional_libs :=
@


1.25
log
@Rewrite pg_regress as a C program instead of a shell script.
This allows it to be used on Windows without installing mingw
(though you do still need 'diff'), and opens the door to future
improvements such as message localization.
Magnus Hagander and Tom Lane.
@
text
@d1 1
a1 1
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.24 2005/12/09 21:19:36 petere Exp $
d63 2
d108 1
a108 1
	$(top_builddir)/src/test/regress/pg_regress $(REGRESS_OPTS) $(REGRESS)
@


1.24
log
@Allow installation into directories containing spaces in the name.
@
text
@d1 1
a1 1
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.23 2005/08/12 21:44:51 momjian Exp $
d106 1
a106 1
	$(SHELL) $(top_builddir)/src/test/regress/pg_regress $(REGRESS_OPTS) $(REGRESS)
d110 1
a110 1
	$(MAKE) -C $(top_builddir)/src/test/regress pg_regress
@


1.23
log
@Back out plpython makefile change.
@
text
@d1 1
a1 1
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.21 2005/05/24 17:07:41 tgl Exp $
d92 1
a92 1
	$(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/plpython$(DLSUFFIX)
d100 1
a100 1
	$(mkinstalldirs) $(DESTDIR)$(pkglibdir)
d103 1
a103 1
	rm -f $(DESTDIR)$(pkglibdir)/plpython$(DLSUFFIX)
@


1.22
log
@Cleanups for FreeBSD linking (PIC) and plpython compiles.

FreeBSD ports, supplied by Jim C. Nasby
@
text
@d12 1
a12 1
ifneq (,$(wildcard $(python_libdir)/../../libpython*$(DLSUFFIX)*))
@


1.21
log
@Fix PL makefiles to support running regression tests in VPATH builds.
@
text
@d1 1
a1 1
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.20 2005/05/17 18:26:23 tgl Exp $
d12 1
a12 1
ifneq (,$(wildcard $(python_libdir)/libpython*$(DLSUFFIX)*))
@


1.20
log
@Add a --dbname option to the pg_regress script, and use pl_regression
for testing PLs and contrib_regression for testing contrib, instead of
overwriting the core system's regression database as formerly done.
Andrew Dunstan
@
text
@d1 1
a1 1
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.19 2005/05/14 17:55:21 tgl Exp $
d69 21
@


1.19
log
@Convert the existing regression test scripts for the various optional
PLs to use the standard pg_regress infrastructure.  No changes in the
tests themselves.  Andrew Dunstan
@
text
@d1 1
a1 1
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.18 2004/11/19 19:23:01 tgl Exp $
d61 1
d85 1
a85 1
	$(SHELL) $(top_builddir)/src/test/regress/pg_regress --load-language=plpythonu $(REGRESS)
@


1.18
log
@Set rpath for plperl and plpython to ensure we can find the .so files
for the languages even when not installed in a standard directory.
pltcl may need this treatment as well, but we don't have the right path
conveniently available, so I'll leave it alone as long as there aren't
actual reports of trouble.
@
text
@d1 1
a1 1
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.17 2004/10/11 19:32:19 tgl Exp $
d61 2
d83 7
d92 2
a93 1
	@@rm -f error.diff feature.diff error.output feature.output test.log
a97 3
installcheck:
	PATH=$(bindir):$$PATH $(SHELL) $(srcdir)/test.sh

@


1.17
log
@Another try at making plpython autoconfiguration work correctly.  Use a
-L spec rather than assuming libpython is in the standard search path
(this returns to the way 7.4 did it).  But check the distutils output
to see if it looks like Python has built a shared library, and if so
link with that instead of the probably-not-shared library found in
configdir.
@
text
@d1 1
a1 1
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.16 2004/10/10 19:07:55 tgl Exp $
d36 2
a37 1
rpath :=
@


1.16
log
@Un-break plpython build for non-Windows platforms.
@
text
@d1 1
a1 1
# $PostgreSQL: pgsql-server/src/pl/plpython/Makefile,v 1.15 2004/10/06 09:20:41 momjian Exp $
d9 4
a12 3
# 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)*))
d17 1
a17 1
# and we have to remove -lpython from libspec since we are building our own
d21 1
a21 1
python_libspec := $(subst -lpython$(python_version),,$(python_libspec))
d28 1
d58 1
a58 1
SHLIB_LINK = $(BE_DLLLIBS) $(python_libspec)
@


1.15
log
@Allow plpython to build on Win32.

Magnus Hagander
@
text
@d1 1
a1 1
# $PostgreSQL: pgsql-server/src/pl/plpython/Makefile,v 1.14 2004/09/24 20:08:42 tgl Exp $
d15 2
a16 1
# Convert backslashed paths to normal slashes
d20 1
@


1.14
log
@Persuade plpython to build on OS X.
@
text
@d1 1
a1 1
# $PostgreSQL: pgsql-server/src/pl/plpython/Makefile,v 1.13 2004/01/21 19:04:11 tgl Exp $
d15 6
d39 15
d79 3
@


1.13
log
@Fix bit-rot in support for building with --disable-shared.  This patch
gets us past 'make install', but initdb still fails for lack of conversion
libraries ...
@
text
@d1 1
a1 1
# $PostgreSQL: pgsql-server/src/pl/plpython/Makefile,v 1.12 2003/11/29 19:52:12 pgsql Exp $
d15 6
@


1.12
log
@
$Header: -> $PostgreSQL Changes ...
@
text
@d1 1
a1 1
# $PostgreSQL: /cvsroot/pgsql-server/src/pl/plpython/Makefile,v 1.11 2002/09/05 18:28:46 petere Exp $
d35 1
d37 5
@


1.11
log
@Assorted fixes for Cygwin:

Eliminate the mysterious games that the Cygwin build plays with the linker
flag variables.  DLLLIBS is gone, use SHLIB_LINK like everyone else.
Detect cygipc in configure, after the linker flags are set up, otherwise
configure might not work at all.

Make sure everything is covered by make clean.

Fix the build of the new conversion procedure modules.

Add new DLLIMPORT markers where required.

Finally, the compiler complains if we use an explicit
-I/usr/local/include, so don't do that.  Curiously, -L/usr/local/lib is
still necessary.
@
text
@d1 1
a1 1
# $Header: /cvsroot/pgsql-server/src/pl/plpython/Makefile,v 1.10 2001/09/16 16:11:11 petere Exp $
@


1.11.6.1
log
@Back-patch repairs for --disable-shared support.
@
text
@d1 1
a1 1
# $Header: /cvsroot/pgsql-server/src/pl/plpython/Makefile,v 1.11 2002/09/05 18:28:46 petere Exp $
a34 1
ifeq ($(enable_shared), yes)
a35 5
else
	@@echo "*****"; \
	 echo "* PL/Python was not installed due to lack of shared library support."; \
	 echo "*****"
endif
@


1.10
log
@Install dynamically loadable modules into a private subdirectory
under libdir, for a cleaner separation in the installation layout
and compatibility with binary packaging standards.  Point backend's
default search location there.  The contrib modules are also
installed in the said location, giving them the benefit of the
default search path as well.  No changes in user interface
nevertheless.
@
text
@d1 1
a1 1
# $Header: /home/projects/pgsql/cvsroot/pgsql/src/pl/plpython/Makefile,v 1.9 2001/08/27 00:29:49 petere Exp $
a19 1
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
d27 1
a27 1
SHLIB_LINK += $(python_libspec)
@


1.9
log
@Turn on plpython build by default if we have something that looks like a
shared library, or we can do without one.
@
text
@d1 1
a1 1
# $Header: /home/projects/pgsql/cvsroot/pgsql/src/pl/plpython/Makefile,v 1.8 2001/07/10 16:33:02 petere Exp $
a19 1

d21 1
d36 1
a36 1
	$(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(libdir)/plpython$(DLSUFFIX)
d39 1
a39 1
	$(mkinstalldirs) $(DESTDIR)$(libdir)
d42 1
a42 1
	rm -f $(DESTDIR)$(libdir)/plpython$(DLSUFFIX)
@


1.8
log
@Support fake root install, separate build dir, dependency tracking, our
choice of compiler and flags, uninstall, and peculiar Python installation
layouts for PyGreSql.  Also install into site-packages now, as officially
recommended.  And pgdb.py is also installed now, used to be forgotten.
@
text
@d1 1
a1 1
# $Header: /home/projects/pgsql/cvsroot/pgsql/src/pl/plpython/Makefile,v 1.7 2001/05/25 15:48:33 momjian Exp $
d8 11
d50 11
@


1.7
log
@See attached for a small patch that enables plpython to build cleanly
under Cygwin.  This patch together with my previous Python patch:

    http://postgresql.readysetnet.com/mhonarc/pgsql-patches/2001-05/msg00075.htm
l

enables full Python support (i.e., configure --with-python) for Cygwin
PostgreSQL.

Jason Tishler
@
text
@d1 1
a1 1
# $Header: /home/projects/pgsql/cvsroot/pgsql/src/pl/plpython/Makefile,v 1.6 2001/05/14 22:06:50 petere Exp $
d8 1
a8 1
override CPPFLAGS := -I$(srcdir) -I$(python_includedir) $(CPPFLAGS)
@


1.6
log
@Remove linking hacks now that dynloader is fixed.
@
text
@d1 1
a1 1
# $Header: /home/projects/pgsql/cvsroot/pgsql/src/pl/plpython/Makefile,v 1.5 2001/05/12 17:49:32 petere Exp $
d9 2
@


1.5
log
@PL/Python should build portably now, if you can get over the fact that
there's no shared libpython.  Test suite works as well. Also, add some
documentation.
@
text
@d1 1
a1 1
# $Header: /home/projects/pgsql/cvsroot/pgsql/src/pl/plpython/Makefile,v 1.4 2001/05/12 01:30:30 petere Exp $
a14 1

a15 17

# If you have not patched the dynamic loader files as described in the
# README you will have to link these in manually.  You may have to add
# more modules.  If you have patched the loader, override
# EXTRA_MODULES to be empty.

# version 2.x
ifneq (,$(findstring 2.,$(python_version)))
EXTRA_MODULES = array cmath errno math md5 operator pcre sha time
endif

# version 1.x
ifneq (,$(findstring 1.,$(python_version)))
EXTRA_MODULES = arraymodule cmathmodule errnomodule mathmodule md5module operator shamodule timemodule
endif

SHLIB_LINK += $(addprefix $(python_dynlibdir)/, $(addsuffix $(DLSUFFIX), $(EXTRA_MODULES)))
@


1.4
log
@PL/Python integration:  support in create/droplang, add CVS keywords,
remove useless files, beat some sense into Makefile.  For me it builds
and sort of runs, so it's a start.
@
text
@d1 1
a1 1
# $Header$
a6 1
# These things ought to go into $(top_srcdir)/config/python.m4 sometime.
d8 1
a8 6
PYTHON_VERSION := $(shell $(PYTHON) -c  'import sys; print sys.version[:3]')
PYTHON_INCLUDE := $(shell $(PYTHON) -c 'import sys; print sys.prefix')/include/python$(PYTHON_VERSION)

override CPPFLAGS := -I$(srcdir) -I$(PYTHON_INCLUDE) $(CPPFLAGS)

PYTHON_LIB := $(shell $(PYTHON) -c 'import sys; print sys.exec_prefix')/lib/python$(PYTHON_VERSION)
d15 19
a33 19
# This static version might work on most ELF systems...
SHLIB_LINK += $(PYTHON_LIB)/config/libpython$(PYTHON_VERSION).a
# ...otherwise you need a shared version, but you need to build that yourself.
#SHLIB_LINK += -lpython$(PYTHON_VERSION)

# Python uses this.  Should become a configure check.
SHLIB_LINK += -lpthread

# Python 2 seems to want libdb.
#SHLIB_LINK += -ldb2


# Hopefully you won't need this utter crap.  But if you can't patch
# the appropriate dynloader file, try this.  You may have to add other
# modules.
#
#DLDIR=$(PYTHON_LIB)/lib-dynload
#DLHACK=$(DLDIR)/arraymodule.so $(DLDIR)/timemodule.so $(DLDIR)/cmathmodule.so $(DLDIR)/errnomodule.so $(DLDIR)/mathmodule.so $(DLDIR)/md5module.so $(DLDIR)/operator.so $(DLDIR)/shamodule.so
#SHLIB_LINK += $(DLDIR)
@


1.3
log
@Move disabled message up to a higher makefile.
@
text
@d1 1
d3 5
a7 4
# cflags.  pick your favorite
#
CC=gcc
CFLAGS=-g -O0 -Wall -Wmissing-declarations -fPIC
d9 2
a10 2
# build info for python, alter as needed
#
d12 1
a12 4
# python headers
#
#INCPYTHON=/usr/include/python1.5
INCPYTHON=/usr/include/python2.0
d14 1
a14 4
# python shared library
#
#LIBPYTHON=python1.5
LIBPYTHON=python2.0
d16 4
a19 3
# if python is someplace odd
#
LIBPYTHONPATH=/usr/lib
d21 4
a24 5
# python 2 seems to want libdb
# various db libs are still messed on my system
#
#LIBPYTHONEXTRA=/usr/lib/libdb2.so.2.7.7
#LIBPYTHONEXTRA=-ldb2
d26 2
a27 1
LDPYTHON=-L$(LIBPYTHONPATH) -l$(LIBPYTHON) $(LIBPYTHONEXTRA)
d29 2
a30 2
# build info for postgres
#
a31 4
# postgres headers.  the installed include directory doesn't work for me
#
#INCPOSTGRES=/usr/include/postgres
INCPOSTGRES=/home/andrew/builds/postgresql/src/include
d33 3
a35 3
# hopefully you won't need this utter crap...
# but if you can't patch the appropriate dynloader file, try this.  you
# may have to add other modules.
d37 3
a39 3
#DLDIR=/usr/lib/python1.5/lib-dynload
#DLHACK=$(DLDIR)/arraymodule.so $(DLDIR)/timemodule.so $(DLDIR)/cmathmodule.so $(DLDIR)/errnomodule.so $(DLDIR)/mathmodule.so $(DLDIR)/md5module.so $(DLDIR)/operator.so
# $(DLDIR)/shamodule.so
d41 1
a41 3
# shouldn't need to alter anything below here
#
INCLUDES=-I$(INCPYTHON) -I$(INCPOSTGRES) -I./
a42 4
# dynamic linker flags.  
#
#LDFLAGS=--shared -Wl,-Bshareable -Wl,-E -Wl,-soname,$@@
LDFLAGS=--shared -Wl,-E -Wl,-soname,$@@
d44 1
a44 1
.PHONY: clean
d46 2
a47 1
all: plpython.so 
d49 2
a50 2
plpython.o: plpython.c plpython.h
	$(CC) $(CFLAGS) $(INCLUDES) -c -o $@@ $<
d52 2
a53 2
plpython.so: plpython.o
	$(CC) $(LDFLAGS) -o $@@ $^ $(LDPYTHON) $(DLHACK) -ldl -lpthread -lm
d55 3
a57 2
clean:
	rm -f plpython.so *.o
d59 2
@


1.2
log
@This directory contains a module that implements the "Metaphone" code as
a PostgreSQL user-defined function.  The Metaphone system is a method of
matching similar sounding names (or any words) to the same code.

Metaphone was invented by Lawrence Philips as an improvement to the popular
name-hashing routine, Soundex.

This metaphone code is from Michael Kuhn, and is detailed at
   http://aspell.sourceforge.net/metaphone/metaphone-kuhn.txt

Joel Burton
@
text
@d59 1
a59 4
all:
	@@echo "Disabled until merged into our Makefile system, bjm 2001-05-09"

disabled: plpython.so 
@


1.1
log
@Add plpython code.
@
text
@d59 4
a62 1
all: plpython.so 
@
