2 # $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.26 2005/12/09 21:19:36 petere Exp $
5 top_builddir = ../../..
6 include $(top_builddir)/src/Makefile.global
8 ifeq ($(perl_useshrplib),true)
11 ifeq ($(perl_useshrplib),yes)
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_embed_ldflags := -L$(perl_archlibexp)/CORE -lperl58
23 override CPPFLAGS += -DPLPERL_HAVE_UID_GID
26 override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) -I$(perl_archlibexp)/CORE
28 rpathdir = $(perl_archlibexp)/CORE
35 OBJS = plperl.o spi_internal.o SPI.o
37 SHLIB_LINK = $(perl_embed_ldflags) $(BE_DLLLIBS)
39 REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-language=plperl
40 REGRESS = plperl plperl_trigger plperl_shared plperl_elog
42 include $(top_srcdir)/src/Makefile.shlib
48 $(PERL) $(perl_privlibexp)/ExtUtils/xsubpp -typemap $(perl_privlibexp)/ExtUtils/typemap $< >$@
50 # When doing a VPATH build, copy over the .sql and .out files so that the
51 # test script can find them. See comments in src/test/regress/GNUmakefile.
54 ifneq ($(PORTNAME),win32)
55 abs_srcdir := $(shell cd $(srcdir) && pwd)
56 abs_builddir := $(shell pwd)
58 abs_srcdir := $(shell cd $(srcdir) && pwd -W)
59 abs_builddir := $(shell pwd -W)
62 test_files_src := $(wildcard $(srcdir)/sql/*.sql) $(wildcard $(srcdir)/expected/*.out)
63 test_files_build := $(patsubst $(srcdir)/%, $(abs_builddir)/%, $(test_files_src))
65 all: $(test_files_build)
66 $(test_files_build): $(abs_builddir)/%: $(srcdir)/%
71 install: all installdirs
72 ifeq ($(enable_shared), yes)
73 $(INSTALL_SHLIB) $(shlib) '$(DESTDIR)$(pkglibdir)/plperl$(DLSUFFIX)'
76 echo "* PL/Perl was not installed due to lack of shared library support."; \
81 $(mkinstalldirs) '$(DESTDIR)$(pkglibdir)'
84 rm -f '$(DESTDIR)$(pkglibdir)/plperl$(DLSUFFIX)'
87 $(SHELL) $(top_builddir)/src/test/regress/pg_regress $(REGRESS_OPTS) $(REGRESS)
91 $(MAKE) -C $(top_builddir)/src/test/regress pg_regress
93 clean distclean maintainer-clean: clean-lib
96 rm -f regression.diffs regression.out
102 echo "*** Cannot build PL/Perl because libperl is not a shared library."; \
103 echo "*** You might have to rebuild your Perl installation. Refer to"; \
104 echo "*** the documentation for details."; \