head	1.44;
access;
symbols
	REL9_0_0:1.44
	REL9_1_ALPHA1:1.44
	REL9_0_RC1:1.44
	REL9_0_BETA4:1.44
	REL9_0_STABLE:1.44.0.2
	REL9_0_BETA3:1.44
	REL9_0_BETA2:1.44
	REL7_4_29:1.10.6.2
	REL8_0_25:1.18.4.2
	REL8_1_21:1.25.2.1
	REL8_2_17:1.28.2.1
	REL8_3_11:1.33.2.2
	REL8_4_4:1.37.2.1
	REL9_0_BETA1:1.43
	REL9_0_ALPHA5_BRANCH:1.43.0.4
	REL9_0_ALPHA5:1.43
	REL7_4_28:1.10.6.1
	REL8_0_24:1.18.4.1
	REL8_1_20:1.25
	REL8_2_16:1.28
	REL8_3_10:1.33.2.1
	REL8_4_3:1.37
	REL9_0_ALPHA4:1.43
	REL9_0_ALPHA4_BRANCH:1.43.0.2
	REL8_5_ALPHA3:1.37
	REL8_5_ALPHA3_BRANCH:1.37.0.8
	REL7_4_27:1.10.6.1
	REL8_0_23:1.18.4.1
	REL8_1_19:1.25
	REL8_2_15:1.28
	REL8_3_9:1.33.2.1
	REL8_4_2:1.37
	REL8_5_ALPHA2:1.37
	REL8_5_ALPHA2_BRANCH:1.37.0.6
	REL7_4_26:1.10.6.1
	REL8_0_22:1.18.4.1
	REL8_1_18:1.25
	REL8_2_14:1.28
	REL8_3_8:1.33.2.1
	REL8_4_1:1.37
	REL8_5_ALPHA1:1.37
	REL8_5_ALPHA1_BRANCH:1.37.0.4
	REL8_4_STABLE:1.37.0.2
	REL8_4_0:1.37
	REL8_4_RC2:1.37
	REL8_4_RC1:1.37
	REL8_4_BETA2:1.36
	REL8_4_BETA1:1.36
	REL7_4_25:1.10.6.1
	REL8_0_21:1.18.4.1
	REL8_1_17:1.25
	REL8_2_13:1.28
	REL8_3_7:1.33
	REL7_4_24:1.10.6.1
	REL8_0_20:1.18.4.1
	REL8_1_16:1.25
	REL8_2_12:1.28
	REL8_3_6:1.33
	REL7_4_23:1.10.6.1
	REL8_0_19:1.18.4.1
	REL8_1_15:1.25
	REL8_2_11:1.28
	REL8_3_5:1.33
	REL7_4_22:1.10.6.1
	REL8_0_18:1.18.4.1
	REL8_1_14:1.25
	REL8_2_10:1.28
	REL8_3_4:1.33
	REL7_4_21:1.10.6.1
	REL8_0_17:1.18.4.1
	REL8_1_13:1.25
	REL8_2_9:1.28
	REL8_3_3:1.33
	REL7_4_20:1.10.6.1
	REL8_0_16:1.18.4.1
	REL8_1_12:1.25
	REL8_2_8:1.28
	REL8_3_2:1.33
	REL8_2_7:1.28
	REL8_3_1:1.33
	REL8_3_STABLE:1.33.0.2
	REL8_3_0:1.33
	REL8_3_RC2:1.33
	REL7_3_21:1.10
	REL7_4_19:1.10.6.1
	REL8_0_15:1.18.4.1
	REL8_1_11:1.25
	REL8_2_6:1.28
	REL8_3_RC1:1.33
	REL8_3_BETA4:1.33
	REL8_3_BETA3:1.31
	REL8_3_BETA2:1.31
	REL8_3_BETA1:1.31
	REL7_3_20:1.10
	REL7_4_18:1.10.6.1
	REL8_0_14:1.18.4.1
	REL8_1_10:1.25
	REL8_2_5:1.28
	REL7_3_19:1.10
	REL7_4_17:1.10.6.1
	REL8_0_13:1.18.4.1
	REL8_1_9:1.25
	REL8_2_4:1.28
	REL8_0_12:1.18.4.1
	REL8_1_8:1.25
	REL8_2_3:1.28
	REL7_3_18:1.10
	REL7_4_16:1.10.6.1
	REL8_0_11:1.18.4.1
	REL8_1_7:1.25
	REL8_2_2:1.28
	REL8_0_10:1.18.4.1
	REL8_1_6:1.25
	REL8_2_1:1.28
	REL7_4_15:1.10.6.1
	REL7_3_17:1.10
	REL8_2_STABLE:1.28.0.2
	REL8_2_0:1.28
	REL8_2_RC1:1.28
	REL8_2_BETA3:1.28
	REL8_2_BETA2:1.28
	REL8_1_5:1.25
	REL8_0_9:1.18.4.1
	REL7_4_14:1.10.6.1
	REL7_3_16:1.10
	REL8_2_BETA1:1.28
	REL7_3_15:1.10
	REL7_4_13:1.10.6.1
	REL8_0_8:1.18.4.1
	REL8_1_4:1.25
	REL7_3_14:1.10
	REL7_4_12:1.10.6.1
	REL8_0_7:1.18.4.1
	REL8_1_3:1.25
	REL7_3_13:1.10
	REL7_4_11:1.10.6.1
	REL8_0_6:1.18.4.1
	REL8_1_2:1.25
	REL7_3_12:1.10
	REL7_4_10:1.10.6.1
	REL8_0_5:1.18.4.1
	REL8_1_1:1.25
	REL8_1_STABLE:1.25.0.2
	REL8_1_0:1.25
	REL8_1_0RC1:1.25
	REL8_1_0BETA4:1.25
	REL8_1_0BETA3:1.25
	REL7_3_11:1.10
	REL7_4_9:1.10.6.1
	REL8_0_4:1.18.4.1
	REL8_1_0BETA2:1.25
	REL8_1_0BETA1:1.25
	REL7_2_8:1.8
	REL7_3_10:1.10
	REL7_4_8:1.10.6.1
	REL8_0_3:1.18
	REL8_0_2:1.18
	REL7_2_7:1.8
	REL7_3_9:1.10
	REL7_4_7:1.10.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.16
	REL7_4_6:1.10.6.1
	REL7_3_8:1.10
	REL7_2_6:1.8
	REL8_0_0BETA3:1.15
	REL8_0_0BETA2:1.15
	REL7_2_5:1.8
	REL7_4_5:1.10.6.1
	REL7_3_7:1.10
	REL7_4_4:1.10.6.1
	REL8_0_0BETA1:1.15
	REL7_4_3:1.10.6.1
	REL7_4_2:1.10.6.1
	REL7_3_6:1.10
	REL7_4_1:1.10
	REL7_3_5:1.10
	REL7_4:1.10
	REL7_4_RC2:1.10
	REL7_4_STABLE:1.10.0.6
	REL7_4_RC1:1.10
	REL7_4_BETA5:1.10
	REL7_4_BETA4:1.10
	REL7_4_BETA3:1.10
	REL7_4_BETA2:1.10
	WIN32_DEV:1.10.0.4
	REL7_4_BETA1:1.10
	REL7_3_4:1.10
	REL7_3_2:1.10
	REL7_2_4:1.8
	REL7_3_STABLE:1.10.0.2
	REL7_2_3:1.8
	REL7_2_STABLE:1.8.0.2
	REL7_2:1.8
	REL7_2_RC2:1.8
	REL7_2_RC1:1.8
	REL7_2_BETA5:1.8
	REL7_2_BETA4:1.8
	REL7_2_BETA3:1.8
	REL7_2_BETA2:1.8
	REL7_2_BETA1:1.8
	REL7_1_2:1.6
	REL7_1_STABLE:1.6.0.2
	REL7_1_BETA:1.6
	REL7_1_BETA3:1.6
	REL7_1_BETA2:1.6
	REL7_1:1.6;
locks; strict;
comment	@# @;


1.44
date	2010.05.13.16.39.43;	author adunstan;	state Exp;
branches;
next	1.43;

1.43
date	2010.02.12.19.35.25;	author adunstan;	state Exp;
branches;
next	1.42;

1.42
date	2010.01.20.01.08.21;	author adunstan;	state Exp;
branches;
next	1.41;

1.41
date	2010.01.10.18.10.03;	author tgl;	state Exp;
branches;
next	1.40;

1.40
date	2010.01.09.15.25.41;	author adunstan;	state Exp;
branches;
next	1.39;

1.39
date	2010.01.09.03.53.40;	author tgl;	state Exp;
branches;
next	1.38;

1.38
date	2010.01.09.02.40.50;	author adunstan;	state Exp;
branches;
next	1.37;

1.37
date	2009.06.05.18.29.56;	author adunstan;	state Exp;
branches
	1.37.2.1;
next	1.36;

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

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

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

1.33
date	2007.12.01.15.30.09;	author adunstan;	state Exp;
branches
	1.33.2.1;
next	1.32;

1.32
date	2007.12.01.15.20.34;	author adunstan;	state Exp;
branches;
next	1.31;

1.31
date	2007.07.25.10.17.46;	author mha;	state Exp;
branches;
next	1.30;

1.30
date	2007.02.10.04.26.24;	author tgl;	state Exp;
branches;
next	1.29;

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

1.28
date	2006.07.21.00.24.04;	author tgl;	state Exp;
branches
	1.28.2.1;
next	1.27;

1.27
date	2006.07.19.02.37.00;	author tgl;	state Exp;
branches;
next	1.26;

1.26
date	2005.12.09.21.19.36;	author petere;	state Exp;
branches;
next	1.25;

1.25
date	2005.07.13.17.12.56;	author tgl;	state Exp;
branches
	1.25.2.1;
next	1.24;

1.24
date	2005.07.06.22.44.49;	author momjian;	state Exp;
branches;
next	1.23;

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

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

1.21
date	2005.05.24.08.05.36;	author neilc;	state Exp;
branches;
next	1.20;

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

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

1.18
date	2004.11.19.19.22.58;	author tgl;	state Exp;
branches
	1.18.4.1;
next	1.17;

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

1.16
date	2004.10.07.19.01.09;	author momjian;	state Exp;
branches;
next	1.15;

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

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

1.13
date	2004.07.01.20.50.22;	author joe;	state Exp;
branches;
next	1.12;

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

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

1.10
date	2002.05.28.16.57.53;	author petere;	state Exp;
branches
	1.10.6.1;
next	1.9;

1.9
date	2002.02.23.21.49.10;	author momjian;	state Exp;
branches;
next	1.8;

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

1.7
date	2001.08.26.23.54.41;	author petere;	state Exp;
branches;
next	1.6;

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

1.5
date	2000.10.24.17.01.05;	author tgl;	state Exp;
branches;
next	1.4;

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

1.3
date	2000.08.31.16.12.13;	author petere;	state Exp;
branches;
next	1.2;

1.2
date	2000.06.28.18.30.12;	author petere;	state Exp;
branches;
next	1.1;

1.1
date	2000.06.27.00.31.49;	author petere;	state Exp;
branches;
next	;

1.10.6.1
date	2004.01.21.19.25.11;	author tgl;	state Exp;
branches;
next	1.10.6.2;

1.10.6.2
date	2010.05.13.16.44.35;	author adunstan;	state Exp;
branches;
next	;

1.18.4.1
date	2005.07.17.04.05.49;	author tgl;	state Exp;
branches;
next	1.18.4.2;

1.18.4.2
date	2010.05.13.16.44.03;	author adunstan;	state Exp;
branches;
next	;

1.25.2.1
date	2010.05.13.16.43.40;	author adunstan;	state Exp;
branches;
next	;

1.28.2.1
date	2010.05.13.16.43.14;	author adunstan;	state Exp;
branches;
next	;

1.33.2.1
date	2009.06.05.18.31.48;	author adunstan;	state Exp;
branches;
next	1.33.2.2;

1.33.2.2
date	2010.05.13.16.42.51;	author adunstan;	state Exp;
branches;
next	;

1.37.2.1
date	2010.05.13.16.40.36;	author adunstan;	state Exp;
branches;
next	;


desc
@@


1.44
log
@Abandon the use of Perl's Safe.pm to enforce restrictions in plperl, as it is
fundamentally insecure. Instead apply an opmask to the whole interpreter that
imposes restrictions on unsafe operations. These restrictions are much harder
to subvert than is Safe.pm, since there is no container to be broken out of.
Backported to release 7.4.

In releases 7.4, 8.0 and 8.1 this also includes the necessary backporting of
the two interpreters model for plperl and plperlu adopted in release 8.2.

In versions 8.0 and up, the use of Perl's POSIX module to undo its locale
mangling on Windows has become insecure with these changes, so it is
replaced by our own routine, which is also faster.

Nice side effects of the changes include that it is now possible to use perl's
"strict" pragma in a natural way in plperl, and that perl's $a and
$b variables now work as expected in sort routines, and that function
compilation is significantly faster.

Tim Bunce and Andrew Dunstan, with reviews from Alex Hunsaker and
Alexey Klyukin.

Security: CVE-2010-1169
@
text
@# Makefile for PL/Perl
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.43 2010/02/12 19:35:25 adunstan Exp $

subdir = src/pl/plperl
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global

ifeq ($(perl_useshrplib),true)
shared_libperl = yes
endif
ifeq ($(perl_useshrplib),yes)
shared_libperl = yes
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_libperl)$(allow_nonpic_in_shlib)))

ifeq ($(PORTNAME), win32)
perl_archlibexp := $(subst \,/,$(perl_archlibexp))
perl_privlibexp := $(subst \,/,$(perl_privlibexp))
perl_lib := $(basename $(notdir $(wildcard $(perl_archlibexp)/CORE/perl[5-9]*.lib)))
perl_embed_ldflags = -L$(perl_archlibexp)/CORE -l$(perl_lib)
override CPPFLAGS += -DPLPERL_HAVE_UID_GID
# Perl on win32 contains /* within comment all over the header file,
# so disable this warning.
override CFLAGS += -Wno-comment
endif

override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS) -I$(perl_archlibexp)/CORE

rpathdir = $(perl_archlibexp)/CORE


NAME = plperl

OBJS = plperl.o SPI.o Util.o

PERLCHUNKS = plc_perlboot.pl plc_trusted.pl

SHLIB_LINK = $(perl_embed_ldflags)

REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-language=plperl  --load-language=plperlu
REGRESS = plperl plperl_trigger plperl_shared plperl_elog plperl_util plperl_init plperlu
# if Perl can support two interpreters in one backend, 
# test plperl-and-plperlu cases
ifneq ($(PERL),)
ifeq ($(shell $(PERL) -V:usemultiplicity), usemultiplicity='define';)
	REGRESS += plperl_plperlu
endif
endif
# where to find psql for running the tests
PSQLDIR = $(bindir)

include $(top_srcdir)/src/Makefile.shlib

plperl.o: perlchunks.h plperl_opmask.h

plperl_opmask.h: plperl_opmask.pl
	$(PERL) $< $@@

perlchunks.h: $(PERLCHUNKS) 
	$(PERL) $(srcdir)/text2macro.pl --strip='^(\#.*|\s*)$$' $^ > $@@

all: all-lib

SPI.c: SPI.xs
	$(PERL) $(perl_privlibexp)/ExtUtils/xsubpp -typemap $(perl_privlibexp)/ExtUtils/typemap $< >$@@

Util.c: Util.xs
	$(PERL) $(perl_privlibexp)/ExtUtils/xsubpp -typemap $(perl_privlibexp)/ExtUtils/typemap $< >$@@

install: all installdirs install-lib

installdirs: installdirs-lib

uninstall: uninstall-lib

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

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

clean distclean maintainer-clean: clean-lib
	rm -f SPI.c Util.c $(OBJS) perlchunks.h plperl_opmask.h
	rm -rf results
	rm -f regression.diffs regression.out

else # can't build

all:
	@@echo ""; \
	 echo "*** Cannot build PL/Perl because libperl is not a shared library."; \
	 echo "*** You might have to rebuild your Perl installation.  Refer to"; \
	 echo "*** the documentation for details."; \
	 echo ""

endif # can't build
@


1.43
log
@Add plperl.on_plperl_init and plperl.on_plperlu_init settings for language-specific startup. Rename recently added plperl.on_perl_init to plperl.on_init. Also, code cleanup for utf8 hack. Patch from Tim Bunce, reviewed by Alex Hunsaker.
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.42 2010/01/20 01:08:21 adunstan Exp $
d39 1
a39 1
PERLCHUNKS = plc_perlboot.pl plc_safe_bad.pl plc_safe_ok.pl
d57 1
a57 1
plperl.o: perlchunks.h
d59 4
a62 1
perlchunks.h: $(PERLCHUNKS)
d87 1
a87 1
	rm -f SPI.c Util.c $(OBJS) perlchunks.h
@


1.42
log
@Add utility functions to PLPerl:
    quote_literal, quote_nullable, quote_ident,
    encode_bytea, decode_bytea, looks_like_number,
    encode_array_literal, encode_array_constructor.
Split SPI.xs into two - SPI.xs now contains only SPI functions. Remainder
are in new Util.xs.
Some more code and documentation cleanup along the way, as well as
adding some CVS markers to files missing them.

Original patch from Tim Bunce, with a little editing from me.
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.41 2010/01/10 18:10:03 tgl Exp $
d44 1
a44 1
REGRESS = plperl plperl_trigger plperl_shared plperl_elog plperl_util plperlu
@


1.41
log
@Remove unnecessary use of temp file.  Tim Bunce
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.40 2010/01/09 15:25:41 adunstan Exp $
d37 1
a37 1
OBJS = plperl.o spi_internal.o SPI.o
d44 1
a44 1
REGRESS = plperl plperl_trigger plperl_shared plperl_elog plperlu
d67 3
d84 1
a84 1
	rm -f SPI.c $(OBJS) perlchunks.h
@


1.40
log
@Provide regression testing for plperlu, and for plperl+plperlu interaction.
The latter are only run if the platform can run both interpreters in the
same backend.
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.39 2010/01/09 03:53:40 tgl Exp $
d60 1
a60 2
	$(PERL) $(srcdir)/text2macro.pl --strip='^(\#.*|\s*)$$' $^ > perlchunks.htmp
	mv perlchunks.htmp perlchunks.h
d81 1
a81 1
	rm -f SPI.c $(OBJS) perlchunks.htmp perlchunks.h
@


1.39
log
@Fix makefile so it works for VPATH case.
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.38 2010/01/09 02:40:50 adunstan Exp $
d43 9
a51 2
REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-language=plperl
REGRESS = plperl plperl_trigger plperl_shared plperl_elog
@


1.38
log
@Tidy up and refactor plperl.c.

- Changed MULTIPLICITY check from runtime to compiletime.
    No loads the large Config module.
- Changed plperl_init_interp() to return new interp
    and not alter the global interp_state
- Moved plperl_safe_init() call into check_interp().
- Removed plperl_safe_init_done state variable
    as interp_state now covers that role.
- Changed plperl_create_sub() to take a plperl_proc_desc argument.
- Simplified return value handling in plperl_create_sub.
- Changed perl.com link in the docs to perl.org and tweaked
    wording to clarify that require, not use, is what's blocked.
- Moved perl code in large multi-line C string literal macros
    out to plc_*.pl files.
- Added a test2macro.pl utility to convert the plc_*.pl files to
    macros in a perlchunks.h file which is #included
- Simplifed plperl_safe_init() slightly
- Optimized pg_verifymbstr calls to avoid unneeded strlen()s.

Patch from Tim Bunce, with minor editing from me.
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.37 2009/06/05 18:29:56 adunstan Exp $
d30 1
a30 1
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) -I$(perl_archlibexp)/CORE
d39 2
d52 2
a53 2
perlchunks.h: plc_*.pl
	$(PERL) text2macro.pl --strip='^(\#.*|\s*)$$' plc_*.pl > perlchunks.htmp
@


1.37
log
@Search for versioned perl library instead of using hardcoded name on Windows. Backpatch to release 8.3
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.36 2008/10/02 08:11:11 petere Exp $
d48 5
d73 1
a73 1
	rm -f SPI.c $(OBJS)
@


1.37.2.1
log
@Abandon the use of Perl's Safe.pm to enforce restrictions in plperl, as it is
fundamentally insecure. Instead apply an opmask to the whole interpreter that
imposes restrictions on unsafe operations. These restrictions are much harder
to subvert than is Safe.pm, since there is no container to be broken out of.
Backported to release 7.4.

In releases 7.4, 8.0 and 8.1 this also includes the necessary backporting of
the two interpreters model for plperl and plperlu adopted in release 8.2.

In versions 8.0 and up, the use of Perl's POSIX module to undo its locale
mangling on Windows has become insecure with these changes, so it is
replaced by our own routine, which is also faster.

Nice side effects of the changes include that it is now possible to use perl's
"strict" pragma in a natural way in plperl, and that perl's $a and
$b variables now work as expected in sort routines, and that function
compilation is significantly faster.

Tim Bunce and Andrew Dunstan, with reviews from Alex Hunsaker and
Alexey Klyukin.

Security: CVE-2010-1169
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.37 2009/06/05 18:29:56 adunstan Exp $
d30 1
a30 1
override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS) -I$(perl_archlibexp)/CORE
d41 1
a41 1
REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-language=plperl  --load-language=plperlu
a42 7
# if Perl can support two interpreters in one backend, 
# test plperl-and-plperlu cases
ifneq ($(PERL),)
ifeq ($(shell $(PERL) -V:usemultiplicity), usemultiplicity='define';)
	REGRESS += plperlu_plperl
endif
endif
a50 6
plperl.o: plperl_opmask.h

plperl_opmask.h: plperl_opmask.pl
	$(PERL) $< $@@


d68 1
a68 1
	rm -f SPI.c $(OBJS) plperl_opmask.h
@


1.36
log
@Update pg_regress calls in PL checks to handle vpath builds.
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.35 2008/10/01 22:38:56 petere Exp $
d22 2
a23 1
perl_embed_ldflags = -L$(perl_archlibexp)/CORE -lperl58
@


1.35
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
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.34 2008/04/07 14:15:58 petere Exp $
d60 1
a60 1
	$(top_builddir)/src/test/regress/pg_regress --psqldir=$(PSQLDIR) $(REGRESS_OPTS) $(REGRESS)
@


1.34
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
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.33 2007/12/01 15:30:09 adunstan Exp $
a52 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.33
log
@Revert inadvertantly committed change.
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.32 2007/12/01 15:20:34 adunstan Exp $
a34 2
SO_MAJOR_VERSION = 0
SO_MINOR_VERSION = 0
d38 1
a38 1
SHLIB_LINK = $(perl_embed_ldflags) $(BE_DLLLIBS)
d74 1
a74 8
install: all installdirs
ifeq ($(enable_shared), yes)
	$(INSTALL_SHLIB) $(shlib) '$(DESTDIR)$(pkglibdir)/plperl$(DLSUFFIX)'
else
	@@echo "*****"; \
	 echo "* PL/Perl was not installed due to lack of shared library support."; \
	 echo "*****"
endif
d76 1
a76 2
installdirs:
	$(mkinstalldirs) '$(DESTDIR)$(pkglibdir)'
d78 1
a78 2
uninstall:
	rm -f '$(DESTDIR)$(pkglibdir)/plperl$(DLSUFFIX)'
@


1.33.2.1
log
@Search for versioned perl library instead of using hardcoded name on Windows. Backpatch to release 8.3
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.33 2007/12/01 15:30:09 adunstan Exp $
d22 1
a22 2
perl_lib := $(basename $(notdir $(wildcard $(perl_archlibexp)/CORE/perl[5-9]*.lib)))
perl_embed_ldflags = -L$(perl_archlibexp)/CORE -l$(perl_lib)
@


1.33.2.2
log
@Abandon the use of Perl's Safe.pm to enforce restrictions in plperl, as it is
fundamentally insecure. Instead apply an opmask to the whole interpreter that
imposes restrictions on unsafe operations. These restrictions are much harder
to subvert than is Safe.pm, since there is no container to be broken out of.
Backported to release 7.4.

In releases 7.4, 8.0 and 8.1 this also includes the necessary backporting of
the two interpreters model for plperl and plperlu adopted in release 8.2.

In versions 8.0 and up, the use of Perl's POSIX module to undo its locale
mangling on Windows has become insecure with these changes, so it is
replaced by our own routine, which is also faster.

Nice side effects of the changes include that it is now possible to use perl's
"strict" pragma in a natural way in plperl, and that perl's $a and
$b variables now work as expected in sort routines, and that function
compilation is significantly faster.

Tim Bunce and Andrew Dunstan, with reviews from Alex Hunsaker and
Alexey Klyukin.

Security: CVE-2010-1169
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.33.2.1 2009/06/05 18:31:48 adunstan Exp $
d30 1
a30 1
override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS) -I$(perl_archlibexp)/CORE
d43 1
a43 1
REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-language=plperl  --load-language=plperlu
a44 7
# if Perl can support two interpreters in one backend, 
# test plperl-and-plperlu cases
ifneq ($(PERL),)
ifeq ($(shell $(PERL) -V:usemultiplicity), usemultiplicity='define';)
	REGRESS += plperlu_plperl
endif
endif
a52 6
plperl.o: plperl_opmask.h

plperl_opmask.h: plperl_opmask.pl
	$(PERL) $< $@@


d100 1
a100 1
	rm -f SPI.c $(OBJS) plperl_opmask.h
@


1.32
log
@Workaround for perl problem where evaluating UTF8 regexes can cause
implicit loading of modules, thereby breaking Safe rules.
We compile and call a tiny perl function on trusted interpreter init, after which
the problem does not occur.
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.31 2007/07/25 10:17:46 mha Exp $
a29 1
override CFLAGS += -fPIC
@


1.31
log
@Silence compiler warnings on mingw
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.30 2007/02/10 04:26:24 tgl Exp $
d30 1
@


1.30
log
@Put back some not-so-unnecessary-as-all-that := usages.  Per buildfarm.
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.29 2007/02/09 15:56:00 petere Exp $
d24 3
@


1.29
log
@Replace useless uses of := by = in makefiles.
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.28 2006/07/21 00:24:04 tgl Exp $
d20 2
a21 2
perl_archlibexp = $(subst \,/,$(perl_archlibexp))
perl_privlibexp = $(subst \,/,$(perl_privlibexp))
@


1.28
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
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.27 2006/07/19 02:37:00 tgl Exp $
d20 3
a22 3
perl_archlibexp := $(subst \,/,$(perl_archlibexp))
perl_privlibexp := $(subst \,/,$(perl_privlibexp))
perl_embed_ldflags := -L$(perl_archlibexp)/CORE -lperl58
@


1.28.2.1
log
@Abandon the use of Perl's Safe.pm to enforce restrictions in plperl, as it is
fundamentally insecure. Instead apply an opmask to the whole interpreter that
imposes restrictions on unsafe operations. These restrictions are much harder
to subvert than is Safe.pm, since there is no container to be broken out of.
Backported to release 7.4.

In releases 7.4, 8.0 and 8.1 this also includes the necessary backporting of
the two interpreters model for plperl and plperlu adopted in release 8.2.

In versions 8.0 and up, the use of Perl's POSIX module to undo its locale
mangling on Windows has become insecure with these changes, so it is
replaced by our own routine, which is also faster.

Nice side effects of the changes include that it is now possible to use perl's
"strict" pragma in a natural way in plperl, and that perl's $a and
$b variables now work as expected in sort routines, and that function
compilation is significantly faster.

Tim Bunce and Andrew Dunstan, with reviews from Alex Hunsaker and
Alexey Klyukin.

Security: CVE-2010-1169
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.28 2006/07/21 00:24:04 tgl Exp $
d26 1
a26 1
override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS) -I$(perl_archlibexp)/CORE
d39 1
a39 1
REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-language=plperl  --load-language=plperlu
a40 7
# if Perl can support two interpreters in one backend, 
# test plperl-and-plperlu cases
ifneq ($(PERL),)
ifeq ($(shell $(PERL) -V:usemultiplicity), usemultiplicity='define';)
	REGRESS += plperlu_plperl
endif
endif
a48 6
plperl.o: plperl_opmask.h

plperl_opmask.h: plperl_opmask.pl
	$(PERL) $< $@@


d96 1
a96 1
	rm -f SPI.c $(OBJS) plperl_opmask.h
@


1.27
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
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.26 2005/12/09 21:19:36 petere Exp $
d41 2
d89 1
a89 1
	$(top_builddir)/src/test/regress/pg_regress $(REGRESS_OPTS) $(REGRESS)
@


1.26
log
@Allow installation into directories containing spaces in the name.
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.25 2005/07/13 17:12:56 tgl Exp $
d87 1
a87 1
	$(SHELL) $(top_builddir)/src/test/regress/pg_regress $(REGRESS_OPTS) $(REGRESS)
d91 1
a91 1
	$(MAKE) -C $(top_builddir)/src/test/regress pg_regress
@


1.25
log
@Remove extraneous space after -L ... it confuses SHLIB_LINK filter -L
hack.
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.24 2005/07/06 22:44:49 momjian Exp $
d73 1
a73 1
	$(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/plperl$(DLSUFFIX)
d81 1
a81 1
	$(mkinstalldirs) $(DESTDIR)$(pkglibdir)
d84 1
a84 1
	rm -f $(DESTDIR)$(pkglibdir)/plperl$(DLSUFFIX)
@


1.25.2.1
log
@Abandon the use of Perl's Safe.pm to enforce restrictions in plperl, as it is
fundamentally insecure. Instead apply an opmask to the whole interpreter that
imposes restrictions on unsafe operations. These restrictions are much harder
to subvert than is Safe.pm, since there is no container to be broken out of.
Backported to release 7.4.

In releases 7.4, 8.0 and 8.1 this also includes the necessary backporting of
the two interpreters model for plperl and plperlu adopted in release 8.2.

In versions 8.0 and up, the use of Perl's POSIX module to undo its locale
mangling on Windows has become insecure with these changes, so it is
replaced by our own routine, which is also faster.

Nice side effects of the changes include that it is now possible to use perl's
"strict" pragma in a natural way in plperl, and that perl's $a and
$b variables now work as expected in sort routines, and that function
compilation is significantly faster.

Tim Bunce and Andrew Dunstan, with reviews from Alex Hunsaker and
Alexey Klyukin.

Security: CVE-2010-1169
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.25 2005/07/13 17:12:56 tgl Exp $
d26 1
a26 1
override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS) -I$(perl_archlibexp)/CORE
d39 1
a39 1
REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-language=plperl --load-language=plperlu
a40 7
# if Perl can support two interpreters in one backend, 
# test plperl-and-plperlu cases
ifneq ($(PERL),)
ifeq ($(shell $(PERL) -V:usemultiplicity), usemultiplicity='define';)
       REGRESS += plperlu_plperl
endif
endif
a46 6
plperl.o: plperl_opmask.h

plperl_opmask.h: plperl_opmask.pl
	$(PERL) $< $@@


d94 1
a94 1
	rm -f SPI.c $(OBJS) plperl_opmask.h
@


1.24
log
@Currently, nonfatal warnings are not trapped (as they should be) by
plperl - the attached small patch remedies that omission, and adds a
small regression test for error and warning output - the new regression
input and expected output are in separate attached files.

Andrew Dunstan
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.22 2005/05/24 17:07:41 tgl Exp $
d22 1
a22 1
perl_embed_ldflags := -L $(perl_archlibexp)/CORE -lperl58
@


1.23
log
@Currently, nonfatal warnings are not trapped (as they should be) by
plperl - the attached small patch remedies that omission.

Andrew Dunstan
@
text
@@


1.22
log
@Fix PL makefiles to support running regression tests in VPATH builds.
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.21 2005/05/24 08:05:36 neilc Exp $
d40 1
a40 1
REGRESS = plperl plperl_trigger plperl_shared
@


1.21
log
@Add regression tests for previously-untested PL/Perl features. From
Andrew Dunstan.
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.20 2005/05/17 18:26:22 tgl Exp $
d50 21
@


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
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.19 2005/05/14 17:55:20 tgl Exp $
d40 1
a40 1
REGRESS = plperl
@


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
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.18 2004/11/19 19:22:58 tgl Exp $
d39 1
d66 1
a66 1
	$(SHELL) $(top_builddir)/src/test/regress/pg_regress --load-language=plperl $(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
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.17 2004/11/17 21:23:36 tgl Exp $
d39 2
d64 7
d73 2
@


1.18.4.1
log
@Back-patch recent changes to alter the order of -L flags inserted from
LDFLAGS versus those built into the Makefiles.  This looks like it will
fix several buildfarm failures in the back branches.
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.18 2004/11/19 19:22:58 tgl Exp $
d22 1
a22 1
perl_embed_ldflags := -L$(perl_archlibexp)/CORE -lperl58
@


1.18.4.2
log
@Abandon the use of Perl's Safe.pm to enforce restrictions in plperl, as it is
fundamentally insecure. Instead apply an opmask to the whole interpreter that
imposes restrictions on unsafe operations. These restrictions are much harder
to subvert than is Safe.pm, since there is no container to be broken out of.
Backported to release 7.4.

In releases 7.4, 8.0 and 8.1 this also includes the necessary backporting of
the two interpreters model for plperl and plperlu adopted in release 8.2.

In versions 8.0 and up, the use of Perl's POSIX module to undo its locale
mangling on Windows has become insecure with these changes, so it is
replaced by our own routine, which is also faster.

Nice side effects of the changes include that it is now possible to use perl's
"strict" pragma in a natural way in plperl, and that perl's $a and
$b variables now work as expected in sort routines, and that function
compilation is significantly faster.

Tim Bunce and Andrew Dunstan, with reviews from Alex Hunsaker and
Alexey Klyukin.

Security: CVE-2010-1169
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.18.4.1 2005/07/17 04:05:49 tgl Exp $
d26 1
a26 1
override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS) -I$(perl_archlibexp)/CORE
a43 7
plperl.o: plperl_opmask.h

plperl_opmask.h: plperl_opmask.pl
	$(PERL) $< $@@



d63 1
a63 1
	rm -f SPI.c $(OBJS) plperl_opmask.h
@


1.17
log
@Remove ill-considered suppression of gcc warnings in plperl, and fix
some of the bugs exposed thereby.  The remaining 'might be used uninitialized'
warnings look like live bugs, but I am not familiar enough with Perl/C hacking
to tell how to fix them.
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.16 2004/10/07 19:01:09 momjian Exp $
d28 2
@


1.16
log
@Move  -DPLPERL_HAVE_UID_GID to the plperl Makefile, for Win32 only.
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql-server/src/pl/plperl/GNUmakefile,v 1.15 2004/07/16 19:18:24 momjian Exp $
a18 5
# The code isn't clean with regard to these warnings.
ifeq ($(GCC),yes)
override CFLAGS := $(filter-out -Wall -Wmissing-declarations -Wmissing-prototypes, $(CFLAGS))
endif

@


1.15
log
@Here is a patch required to build plperl with win32. The issues were:

* perl_useshrplib gets set to "yes" and not to "true". I assume it's set
to "true" on unix, so I left both.
* Need to translate backslashes into slashes
* The linker config coming out of perl was for MSVC and not for mingw

Magnus Hagander
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql-server/src/pl/plperl/GNUmakefile,v 1.14 2004/07/05 23:24:12 tgl Exp $
d28 1
@


1.14
log
@Revert broken rpath addition.
@
text
@d2 1
a2 1
# $PostgreSQL: pgsql-server/src/pl/plperl/GNUmakefile,v 1.12 2004/01/21 19:04:11 tgl Exp $
d11 3
d24 7
a30 1
override CPPFLAGS := -I$(srcdir) -I$(perl_archlibexp)/CORE $(CPPFLAGS)
@


1.13
log
@plperl update from Andrew Dunstan, deriving (I believe) from Command Prompt's
plperlNG. Review and minor cleanup/improvements by Joe Conway.

Summary of new functionality:
- Shared data space and namespace. There is a new global variable %_SHARED
  that functions can use to store and save data between invocations of a
  function, or between different functions. Also, all trusted plperl function
  now share a common Safe container (this is an optimization, also), which
  they can use for storing non-lexical variables, functions, etc.
- Triggers are now supported
- Records can now be returned (as a hash reference)
- Sets of records can now be returned (as a reference to an array of hash
  references).
- New function spi_exec_query() provided for performing db functions or
  getting data from db.
- Optimization for counting hash keys (Abhijit Menon-Sen)
- Allow return of 'record' and 'setof record'
@
text
@a29 3
ifeq ($(enable_rpath), yes)
SHLIB_LINK = $(perl_embed_ldflags) $(BE_DLLLIBS) -Wl,-rpath,$(perl_archlibexp)/CORE
else
a30 1
endif
@


1.12
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
@d2 1
a2 1
# $PostgreSQL: pgsql-server/src/pl/plperl/GNUmakefile,v 1.11 2003/11/29 19:52:12 pgsql Exp $
d28 5
a32 1
OBJS = plperl.o eloglvl.o SPI.o
d34 1
@


1.11
log
@
$Header: -> $PostgreSQL Changes ...
@
text
@d2 1
a2 1
# $PostgreSQL: /cvsroot/pgsql-server/src/pl/plperl/GNUmakefile,v 1.10 2002/05/28 16:57:53 petere Exp $
d40 1
d42 5
@


1.10
log
@Change PL/Perl and Pg interface build to use configured compiler and
Makefile.shlib system, not MakeMaker.
@
text
@d2 1
a2 1
# $Header$
@


1.10.6.1
log
@Back-patch repairs for --disable-shared support.
@
text
@d2 1
a2 1
# $Header: /cvsroot/pgsql-server/src/pl/plperl/GNUmakefile,v 1.10 2002/05/28 16:57:53 petere Exp $
a39 1
ifeq ($(enable_shared), yes)
a40 5
else
	@@echo "*****"; \
	 echo "* PL/Perl was not installed due to lack of shared library support."; \
	 echo "*****"
endif
@


1.10.6.2
log
@Abandon the use of Perl's Safe.pm to enforce restrictions in plperl, as it is
fundamentally insecure. Instead apply an opmask to the whole interpreter that
imposes restrictions on unsafe operations. These restrictions are much harder
to subvert than is Safe.pm, since there is no container to be broken out of.
Backported to release 7.4.

In releases 7.4, 8.0 and 8.1 this also includes the necessary backporting of
the two interpreters model for plperl and plperlu adopted in release 8.2.

In versions 8.0 and up, the use of Perl's POSIX module to undo its locale
mangling on Windows has become insecure with these changes, so it is
replaced by our own routine, which is also faster.

Nice side effects of the changes include that it is now possible to use perl's
"strict" pragma in a natural way in plperl, and that perl's $a and
$b variables now work as expected in sort routines, and that function
compilation is significantly faster.

Tim Bunce and Andrew Dunstan, with reviews from Alex Hunsaker and
Alexey Klyukin.

Security: CVE-2010-1169
@
text
@d2 1
a2 1
# $Header: /cvsroot/pgsql/src/pl/plperl/GNUmakefile,v 1.10.6.1 2004/01/21 19:25:11 tgl Exp $
d21 1
a21 1
override CPPFLAGS := -I. -I$(srcdir) -I$(perl_archlibexp)/CORE $(CPPFLAGS)
a35 7
plperl.o: plperl_opmask.h

plperl_opmask.h: plperl_opmask.pl
	$(PERL) $< $@@



d55 1
a55 1
	rm -f SPI.c $(OBJS) plperl_opmask.h
@


1.9
log
@
OK'ed by Peter.

The attached patch enables plperl to build under Cygwin.  It is
basically yet another BE_DLLLIBS patch with a perl MakeMaker twist.  I
tried the patch under Red Hat 7.1 Linux too and I did not observe any
ill effects.

Jason Tishler
@
text
@d1 2
a2 1
# $Header: /cvsroot/pgsql/src/pl/plperl/GNUmakefile,v 1.8 2001/09/16 16:11:11 petere Exp $
d8 2
a9 2
ifeq ($(allow_nonpic_in_shlib),yes)
makefile_pl_flags = --force
d12 18
d31 1
a31 2
all: Makefile
	$(MAKE) -f $< all VPATH=$(VPATH)
d33 5
a37 4
Makefile: Makefile.PL
	plperl_installdir='$$(DESTDIR)$(pkglibdir)' \
	$(PERL) $< $(makefile_pl_flags) LIBS='$(BE_DLLLIBS)' \
	INC='-I$(srcdir) $(filter -I%, $(CPPFLAGS))'
d40 1
a40 1
	$(MAKE) -f Makefile install DESTDIR='$(DESTDIR)'
d48 13
a60 3
clean distclean maintainer-clean:
	-[ -f Makefile ] && $(MAKE) -f Makefile clean
	rm -f Makefile Makefile.old
@


1.8
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/plperl/GNUmakefile,v 1.7 2001/08/26 23:54:41 petere Exp $
d17 2
a18 1
	$(PERL) $< $(makefile_pl_flags) INC='-I$(srcdir) $(filter -I%, $(CPPFLAGS))'
@


1.7
log
@VPATH and DESTDIR support for PL/Perl, using the same techniques employed
in interfaces/perl5 a brief while ago.

Also, since building PL/Perl without a shared libperl actually works on
some platforms we can enable it there to get some development happening.
I've only checked off linux right now, but others should be added in the
future.
@
text
@d1 1
a1 1
# $Header: /home/projects/pgsql/cvsroot/pgsql/src/pl/plperl/GNUmakefile,v 1.6 2000/11/02 18:40:13 petere Exp $
d16 1
a16 1
	plperl_installdir='$$(DESTDIR)$(libdir)' \
d23 1
a23 1
	$(mkinstalldirs) $(DESTDIR)$(libdir)
d26 1
a26 1
	rm -f $(DESTDIR)$(libdir)/plperl$(DLSUFFIX)
@


1.6
log
@Pass on all CPPFLAGS that look like -I* to the PL/Perl build.
(This previously worked, but must have gotten lost somewhere...)
@
text
@d1 1
a1 1
# $Header: /home/projects/pgsql/cvsroot/pgsql/src/pl/plperl/GNUmakefile,v 1.5 2000/10/24 17:01:05 tgl Exp $
d7 3
a9 1
plperl_installdir = $(DESTDIR)$(libdir)
d13 1
a13 1
	$(MAKE) -f $< all
d16 2
a17 3
	plperl_installdir='$(plperl_installdir)' \
	EXTRA_INCLUDES='$(filter -I%, $(CPPFLAGS))' \
	$(PERL) $<
d20 1
a20 1
	$(MAKE) -f Makefile install
d23 1
a23 1
	$(mkinstalldirs) $(DESTDIR)$(plperl_installdir)
@


1.5
log
@Eliminate POLLUTE=1 hack for cross-Perl-version compatibility by using
Devel::PPPort instead.  Thanks to Gilles Darold for doing the legwork.
@
text
@d1 1
a1 1
# $Header: /home/projects/pgsql/cvsroot/pgsql/src/pl/plperl/GNUmakefile,v 1.4 2000/09/17 13:02:51 petere Exp $
d14 3
a16 3
	@@plperl_installdir='$(plperl_installdir)' \
	  EXTRA_INCLUDES='-I$(top_srcdir)/src/include $(INCLUDES)' \
	  $(PERL) $<
@


1.4
log
@Support for DESTDIR make variable. This is used as in `make install
DESTDIR=/else/where' and prepends the value of DESTDIR to the full
installation paths (e.g., /else/where/usr/local/pgsql/bin). This allows
users to install the package into a location different from the one that
was configured and hard-coded into various scripts, e.g., for creating
binary packages.

DESTDIR is in many cases preferrable over `make install
prefix=/else/where' because

a) `prefix' affects the path that is hard-coded into the files, which can
lead to a `make install prefix=xxx' (as done by the regression test
driver) corrupting the files in the source tree with wrong paths.

b) it doesn't work at all if a directory was overridden to not depend on
`prefix', e.g., --sysconfdir=/etc.

(Updating the regression test driver to use DESTDIR is a separate
undertaking.)

See also autoconf@@gnu.org, From: Akim Demaille <akim@@epita.fr>, Date: 08
Sep 2000 12:48:59 +0200, Message-ID:
<mv4em2vb1lw.fsf@@nostromo.lrde.epita.fr>, Subject: Re: HTML format
documentation.
@
text
@d1 1
a1 1
# $Header: /home/projects/pgsql/cvsroot/pgsql/src/pl/plperl/GNUmakefile,v 1.3 2000/08/31 16:12:13 petere Exp $
d16 1
a16 1
	  $(PERL) $< POLLUTE=1
@


1.3
log
@Fix relative path references so that make knowns which dependencies refer
to one another. Sort out builddir vs srcdir variable namings. Remove some
now obsoleted make variables.
@
text
@d1 1
a1 1
# $Header: /home/projects/pgsql/cvsroot/pgsql/src/pl/plperl/GNUmakefile,v 1.2 2000/06/28 18:30:12 petere Exp $
d7 1
a7 1
plperl_installdir = $(libdir)
d19 1
a19 1
	$(MAKE) -f $< install
d22 1
a22 1
	$(mkinstalldirs) $(plperl_installdir)
d25 1
a25 1
	rm -f $(libdir)/plperl$(DLSUFFIX)
@


1.2
log
@Makefile cleanup for interface tree. Now essentially with all the
standard targets and behaviour. Replaced Makefile.in's with
Makefile's and declared the respective variables in Makefile.global.

maintainer-clean target now available at top level, although it does
not work in the backend tree yet.

Cleanup pass over Makefile.shlib, renamed some targets and variables.
The shared library symlink tests are now done by make, not the shell.

ecpg: Remove one warning in sloppy flex output.

PL/Perl and Perl interface: the MakeMaker documentation is confusing,
the realclean target *does* "delete derived files", but it also
uninstalls them. Don't use that.

The submake targets in the various bin directories that update libpq
should `make all', not `make libpq.a'. That is a) unportable, and
b) doesn't build the shared library.
@
text
@d1 1
a1 1
# $Header: /home/projects/pgsql/cvsroot/pgsql/src/pl/plperl/GNUmakefile,v 1.1 2000/06/27 00:31:49 petere Exp $
d5 1
a5 1
include ../../Makefile.global
@


1.1
log
@Makefile cleanup for bin and pl subtrees. They should now support
all the standard semantics. Also get rid of Makefile.in's on the
way and instead declare all variables in Makefile.global.
@
text
@d1 1
a1 1
# $Header$
d28 2
a29 1
	-[ -f Makefile ] && $(MAKE) -f Makefile realclean
@
