Consistently use "superuser" instead of "super user"
[pgsql.git] / src / pl / plperl / GNUmakefile
blob919d46453f6afde36a6dc472eee64f0606c9e3c5
1 # Makefile for PL/Perl
2 # src/pl/plperl/GNUmakefile
4 subdir = src/pl/plperl
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
13 endif
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
18 # Windows.
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"
26 NAME = plperl
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)
51 pexports $^ > $@
53 endif # win32
56 SHLIB_LINK = $(perl_embed_ldflags)
58 REGRESS_OPTS = --dbname=$(PL_TESTDB)
59 REGRESS = plperl_setup plperl plperl_lc plperl_trigger plperl_shared \
60 plperl_elog plperl_util plperl_init plperlu plperl_array \
61 plperl_call plperl_transaction
62 # if Perl can support two interpreters in one backend,
63 # test plperl-and-plperlu cases
64 ifneq ($(PERL),)
65 ifeq ($(shell $(PERL) -V:usemultiplicity), usemultiplicity='define';)
66 REGRESS += plperl_plperlu
67 endif
68 endif
70 # where to find xsubpp for building XS.
71 XSUBPPDIR = $(shell $(PERL) -e 'use List::Util qw(first); print first { -r "$$_/ExtUtils/xsubpp" } @INC')
73 include $(top_srcdir)/src/Makefile.shlib
75 plperl.o: perlchunks.h plperl_opmask.h plperl_helpers.h
77 plperl_opmask.h: plperl_opmask.pl
78 @if [ x"$(perl_privlibexp)" = x"" ]; then echo "configure switch --with-perl was not specified."; exit 1; fi
79 $(PERL) $< $@
81 perlchunks.h: $(PERLCHUNKS)
82 @if [ x"$(perl_privlibexp)" = x"" ]; then echo "configure switch --with-perl was not specified."; exit 1; fi
83 $(PERL) $(srcdir)/text2macro.pl --strip='^(\#.*|\s*)$$' $^ > $@
85 all: all-lib
87 %.c: %.xs
88 @if [ x"$(perl_privlibexp)" = x"" ]; then echo "configure switch --with-perl was not specified."; exit 1; fi
89 # xsubpp -output option is required for coverage+vpath, but requires Perl 5.9.3
90 ifeq ($(enable_coverage)$(vpath_build),yesyes)
91 $(PERL) $(XSUBPPDIR)/ExtUtils/xsubpp -typemap $(perl_privlibexp)/ExtUtils/typemap -output $@ $<
92 else
93 $(PERL) $(XSUBPPDIR)/ExtUtils/xsubpp -typemap $(perl_privlibexp)/ExtUtils/typemap $< >$@
94 endif
97 install: all install-lib install-data
99 installdirs: installdirs-lib
100 $(MKDIR_P) '$(DESTDIR)$(datadir)/extension' '$(DESTDIR)$(includedir_server)'
102 uninstall: uninstall-lib uninstall-data
104 install-data: installdirs
105 $(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA)) '$(DESTDIR)$(datadir)/extension/'
106 $(INSTALL_DATA) $(srcdir)/plperl.h $(srcdir)/ppport.h $(srcdir)/plperl_helpers.h '$(DESTDIR)$(includedir_server)'
108 uninstall-data:
109 rm -f $(addprefix '$(DESTDIR)$(datadir)/extension'/, $(notdir $(DATA)))
110 rm -f $(addprefix '$(DESTDIR)$(includedir_server)'/, plperl.h ppport.h)
112 .PHONY: install-data uninstall-data
115 check: submake
116 $(pg_regress_check) $(REGRESS_OPTS) $(REGRESS)
118 installcheck: submake
119 $(pg_regress_installcheck) $(REGRESS_OPTS) $(REGRESS)
121 .PHONY: submake
122 submake:
123 $(MAKE) -C $(top_builddir)/src/test/regress pg_regress$(X)
125 clean distclean maintainer-clean: clean-lib
126 rm -f SPI.c Util.c $(OBJS) perlchunks.h plperl_opmask.h
127 rm -rf $(pg_regress_clean_files)
128 ifeq ($(PORTNAME), win32)
129 rm -f $(perlwithver).def
130 endif