1
by Martin Pitt
Import upstream version 8.4~0cvs20090328 |
1 |
# Makefile for PL/Perl
|
1.2.4
by Martin Pitt
Import upstream version 8.4.4 |
2 |
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.37.2.1 2010/05/13 16:40:36 adunstan Exp $
|
1
by Martin Pitt
Import upstream version 8.4~0cvs20090328 |
3 |
|
4 |
subdir = src/pl/plperl |
|
5 |
top_builddir = ../../.. |
|
6 |
include $(top_builddir)/src/Makefile.global
|
|
7 |
||
8 |
ifeq ($(perl_useshrplib),true)
|
|
9 |
shared_libperl = yes |
|
10 |
endif
|
|
11 |
ifeq ($(perl_useshrplib),yes)
|
|
12 |
shared_libperl = yes |
|
13 |
endif
|
|
14 |
||
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)))
|
|
18 |
||
19 |
ifeq ($(PORTNAME), win32)
|
|
20 |
perl_archlibexp := $(subst \,/,$(perl_archlibexp)) |
|
21 |
perl_privlibexp := $(subst \,/,$(perl_privlibexp)) |
|
1.1.4
by Martin Pitt
Import upstream version 8.4.0 |
22 |
perl_lib := $(basename $(notdir $(wildcard $(perl_archlibexp)/CORE/perl[5-9]*.lib))) |
23 |
perl_embed_ldflags = -L$(perl_archlibexp)/CORE -l$(perl_lib) |
|
1
by Martin Pitt
Import upstream version 8.4~0cvs20090328 |
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
|
|
29 |
||
1.2.4
by Martin Pitt
Import upstream version 8.4.4 |
30 |
override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS) -I$(perl_archlibexp)/CORE |
1
by Martin Pitt
Import upstream version 8.4~0cvs20090328 |
31 |
|
32 |
rpathdir = $(perl_archlibexp)/CORE |
|
33 |
||
34 |
||
35 |
NAME = plperl |
|
36 |
||
37 |
OBJS = plperl.o spi_internal.o SPI.o |
|
38 |
||
39 |
SHLIB_LINK = $(perl_embed_ldflags) |
|
40 |
||
1.2.4
by Martin Pitt
Import upstream version 8.4.4 |
41 |
REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-language=plperl --load-language=plperlu |
1
by Martin Pitt
Import upstream version 8.4~0cvs20090328 |
42 |
REGRESS = plperl plperl_trigger plperl_shared plperl_elog |
1.2.4
by Martin Pitt
Import upstream version 8.4.4 |
43 |
# if Perl can support two interpreters in one backend,
|
44 |
# test plperl-and-plperlu cases
|
|
45 |
ifneq ($(PERL),)
|
|
46 |
ifeq ($(shell $(PERL) -V:usemultiplicity), usemultiplicity='define';)
|
|
47 |
REGRESS += plperlu_plperl |
|
48 |
endif
|
|
49 |
endif
|
|
1
by Martin Pitt
Import upstream version 8.4~0cvs20090328 |
50 |
# where to find psql for running the tests
|
51 |
PSQLDIR = $(bindir) |
|
52 |
||
1.3.4
by Martin Pitt
Import upstream version 8.4.10 |
53 |
# where to find xsubpp for building XS.
|
54 |
XSUBPPDIR = $(shell $(PERL) -e 'use List::Util qw(first); print first { -r "$$_/ExtUtils/xsubpp" } @INC') |
|
55 |
||
1
by Martin Pitt
Import upstream version 8.4~0cvs20090328 |
56 |
include $(top_srcdir)/src/Makefile.shlib
|
57 |
||
58 |
||
59 |
all: all-lib |
|
60 |
||
1.2.4
by Martin Pitt
Import upstream version 8.4.4 |
61 |
plperl.o: plperl_opmask.h |
62 |
||
63 |
plperl_opmask.h: plperl_opmask.pl |
|
64 |
$(PERL) $< $@ |
|
65 |
||
66 |
||
1
by Martin Pitt
Import upstream version 8.4~0cvs20090328 |
67 |
SPI.c: SPI.xs |
1.3.4
by Martin Pitt
Import upstream version 8.4.10 |
68 |
$(PERL) $(XSUBPPDIR)/ExtUtils/xsubpp -typemap $(perl_privlibexp)/ExtUtils/typemap $< >$@ |
1
by Martin Pitt
Import upstream version 8.4~0cvs20090328 |
69 |
|
70 |
install: all installdirs install-lib |
|
71 |
||
72 |
installdirs: installdirs-lib |
|
73 |
||
74 |
uninstall: uninstall-lib |
|
75 |
||
76 |
installcheck: submake |
|
1.3.3
by Martin Pitt
Import upstream version 8.4.9 |
77 |
$(top_builddir)/src/test/regress/pg_regress --inputdir=$(srcdir) --psqldir="$(PSQLDIR)" $(REGRESS_OPTS) $(REGRESS) |
1
by Martin Pitt
Import upstream version 8.4~0cvs20090328 |
78 |
|
79 |
.PHONY: submake |
|
80 |
submake: |
|
81 |
$(MAKE) -C $(top_builddir)/src/test/regress pg_regress$(X) |
|
82 |
||
83 |
clean distclean maintainer-clean: clean-lib |
|
1.2.4
by Martin Pitt
Import upstream version 8.4.4 |
84 |
rm -f SPI.c $(OBJS) plperl_opmask.h |
1
by Martin Pitt
Import upstream version 8.4~0cvs20090328 |
85 |
rm -rf results |
86 |
rm -f regression.diffs regression.out |
|
87 |
||
88 |
else # can't build
|
|
89 |
||
90 |
all: |
|
91 |
@echo ""; \ |
|
92 |
echo "*** Cannot build PL/Perl because libperl is not a shared library."; \ |
|
93 |
echo "*** You might have to rebuild your Perl installation. Refer to"; \ |
|
94 |
echo "*** the documentation for details."; \ |
|
95 |
echo "" |
|
96 |
||
97 |
endif # can't build
|