Fix xslt_process() to ensure that it inserts a NULL terminator after the
[PostgreSQL.git] / src / pl / plperl / GNUmakefile
bloba3c3495aacf04a106b26840bff0467c2c083bd84
1 # Makefile for PL/Perl
2 # $PostgreSQL$
4 subdir = src/pl/plperl
5 top_builddir = ../../..
6 include $(top_builddir)/src/Makefile.global
8 ifeq ($(perl_useshrplib),true)
9 shared_libperl = yes
10 endif
11 ifeq ($(perl_useshrplib),yes)
12 shared_libperl = yes
13 endif
15 # If we don't have a shared library and the platform doesn't allow it
16 # to work without, we have to skip it.
17 ifneq (,$(findstring yes, $(shared_libperl)$(allow_nonpic_in_shlib)))
19 ifeq ($(PORTNAME), win32)
20 perl_archlibexp := $(subst \,/,$(perl_archlibexp))
21 perl_privlibexp := $(subst \,/,$(perl_privlibexp))
22 perl_lib := $(basename $(notdir $(wildcard $(perl_archlibexp)/CORE/perl[5-9]*.lib)))
23 perl_embed_ldflags = -L$(perl_archlibexp)/CORE -l$(perl_lib)
24 override CPPFLAGS += -DPLPERL_HAVE_UID_GID
25 # Perl on win32 contains /* within comment all over the header file,
26 # so disable this warning.
27 override CFLAGS += -Wno-comment
28 endif
30 override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) -I$(perl_archlibexp)/CORE
32 rpathdir = $(perl_archlibexp)/CORE
35 NAME = plperl
37 OBJS = plperl.o spi_internal.o SPI.o
39 SHLIB_LINK = $(perl_embed_ldflags)
41 REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-language=plperl
42 REGRESS = plperl plperl_trigger plperl_shared plperl_elog
43 # where to find psql for running the tests
44 PSQLDIR = $(bindir)
46 include $(top_srcdir)/src/Makefile.shlib
49 all: all-lib
51 SPI.c: SPI.xs
52 $(PERL) $(perl_privlibexp)/ExtUtils/xsubpp -typemap $(perl_privlibexp)/ExtUtils/typemap $< >$@
54 install: all installdirs install-lib
56 installdirs: installdirs-lib
58 uninstall: uninstall-lib
60 installcheck: submake
61 $(top_builddir)/src/test/regress/pg_regress --inputdir=$(srcdir) --psqldir=$(PSQLDIR) $(REGRESS_OPTS) $(REGRESS)
63 .PHONY: submake
64 submake:
65 $(MAKE) -C $(top_builddir)/src/test/regress pg_regress$(X)
67 clean distclean maintainer-clean: clean-lib
68 rm -f SPI.c $(OBJS)
69 rm -rf results
70 rm -f regression.diffs regression.out
72 else # can't build
74 all:
75 @echo ""; \
76 echo "*** Cannot build PL/Perl because libperl is not a shared library."; \
77 echo "*** You might have to rebuild your Perl installation. Refer to"; \
78 echo "*** the documentation for details."; \
79 echo ""
81 endif # can't build