2 # src/pl/plperl/GNUmakefile
5 top_builddir
= ..
/..
/..
6 include $(top_builddir
)/src
/Makefile.global
8 ifeq ($(PORTNAME
), win32
)
9 override CPPFLAGS
+= -DPLPERL_HAVE_UID_GID
10 # Perl on win32 contains /* within comment all over the header file,
11 # so disable this warning.
12 override CPPFLAGS
+= -Wno-comment
15 # Note: we need to include the perl_includespec directory last,
16 # probably because it sometimes contains some header files with names
17 # that clash with some of ours, or with some that we include, notably on
19 override CPPFLAGS
:= -I.
-I
$(srcdir) $(CPPFLAGS
) $(perl_embed_ccflags
) $(perl_includespec
)
21 # this is often, but not always, the same directory named by perl_includespec
22 rpathdir
= $(perl_archlibexp
)/CORE
24 PGFILEDESC
= "PL/Perl - procedural language"
28 OBJS
= plperl.o SPI.o Util.o
$(WIN32RES
)
30 DATA
= plperl.control plperl--1.0.sql \
31 plperlu.control plperlu--1.0.sql
33 PERLCHUNKS
= plc_perlboot.pl plc_trusted.pl
35 # Perl on win32 ships with import libraries only for Microsoft Visual C++,
36 # which are not compatible with mingw gcc. Therefore we need to build a
37 # new import library to link with.
38 ifeq ($(PORTNAME
), win32
)
40 perlwithver
:= $(subst -l
,,$(filter -l
%, $(perl_embed_ldflags
)))
41 PERLDLL
:= $(dir $(subst ',,$(PERL)))$(perlwithver).dll
42 # we no longer want to include the original -l spec in SHLIB_LINK
43 override perl_embed_ldflags :=
45 OBJS += lib$(perlwithver).a
47 lib$(perlwithver).a: $(perlwithver).def
48 dlltool --dllname $(perlwithver).dll --def $(perlwithver).def --output-lib lib$(perlwithver).a
50 $(perlwithver).def: $(PERLDLL)
56 SHLIB_LINK = $(perl_embed_ldflags)
58 # see https://www.postgresql.org/message-id/flat/8c4fcb72-2574-ff7c-4c25-1f032d4a2a57%40enterprisedb.com
59 ifeq ($(PORTNAME), cygwin)
60 SHLIB_LINK += -Wl,--export-all-symbols
63 REGRESS_OPTS = --dbname=$(PL_TESTDB) --dlpath=$(top_builddir)/src/test/regress
64 REGRESS = plperl_setup plperl plperl_lc plperl_trigger plperl_shared \
65 plperl_elog plperl_util plperl_init plperlu plperl_array \
66 plperl_call plperl_transaction plperl_env
67 # if Perl can support two interpreters in one backend,
68 # test plperl-and-plperlu cases
70 ifeq ($(shell $(PERL) -V:usemultiplicity), usemultiplicity='define';)
71 REGRESS += plperl_plperlu
75 # where to find xsubpp for building XS.
76 XSUBPPDIR = $(shell $(PERL) -e 'use List
::Util qw
(first
); print first
{ -r
"$$_/ExtUtils/xsubpp" } @INC
')
78 include $(top_srcdir)/src/Makefile.shlib
80 plperl.o: perlchunks.h plperl_opmask.h
82 plperl_opmask.h: plperl_opmask.pl
83 @if [ x"$(perl_privlibexp)" = x"" ]; then echo "configure switch --with-perl was not specified."; exit 1; fi
86 perlchunks.h: $(PERLCHUNKS)
87 @if [ x"$(perl_privlibexp)" = x"" ]; then echo "configure switch --with-perl was not specified."; exit 1; fi
88 $(PERL) $(srcdir)/text2macro.pl $^ > $@
93 @if [ x"$(perl_privlibexp)" = x"" ]; then echo "configure switch --with-perl was not specified."; exit 1; fi
94 # xsubpp -output option is required for coverage+vpath, but requires Perl 5.9.3
95 ifeq ($(enable_coverage)$(vpath_build),yesyes)
96 $(PERL) $(XSUBPPDIR)/ExtUtils/xsubpp -typemap $(perl_privlibexp)/ExtUtils/typemap -output $@ $<
98 $(PERL) $(XSUBPPDIR)/ExtUtils/xsubpp -typemap $(perl_privlibexp)/ExtUtils/typemap $< >$@
102 install: all install-lib install-data
104 installdirs: installdirs-lib
105 $(MKDIR_P) '$(DESTDIR
)$(datadir)/extension
' '$(DESTDIR
)$(includedir_server
)'
107 uninstall: uninstall-lib uninstall-data
109 install-data: installdirs
110 $(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA)) '$(DESTDIR
)$(datadir)/extension
/'
111 $(INSTALL_DATA) $(srcdir)/plperl.h $(srcdir)/plperl_system.h $(srcdir)/ppport.h '$(DESTDIR
)$(includedir_server
)'
114 rm -f $(addprefix '$(DESTDIR
)$(datadir)/extension
'/, $(notdir $(DATA)))
115 rm -f $(addprefix '$(DESTDIR
)$(includedir_server
)'/, plperl.h plperl_system.h ppport.h)
117 .PHONY: install-data uninstall-data
121 $(pg_regress_check) $(REGRESS_OPTS) $(REGRESS)
123 installcheck: submake
124 $(pg_regress_installcheck) $(REGRESS_OPTS) $(REGRESS)
128 $(MAKE) -C $(top_builddir)/src/test/regress pg_regress$(X)
130 clean distclean: clean-lib
131 rm -f SPI.c Util.c $(OBJS) perlchunks.h plperl_opmask.h
132 rm -rf $(pg_regress_clean_files)
133 ifeq ($(PORTNAME), win32)
134 rm -f $(perlwithver).def