Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf1ca5a6

Browse files
committed
Fix out-of-tree build for transform modules.
Neither plperl nor plpython installed sufficient header files topermit transform modules to be built out-of-tree using PGXS. Fix thatby installing all plperl and plpython header files (other than thosewith special purposes such as generated data tables), and also installplpython's special .mk file for mangling regression tests.(This commit does not fix the windows install, which does notcurrently install _any_ plperl or plpython headers.)Also fix the existing transform modules for hstore and ltree so thattheir cross-module #include directives work as anticipated by commitdf16323 et seq. This allows them to serve as working examples ofhow to reference other modules when doing separate out-of-tree builds.Discussion:https://postgr.es/m/87o9ej8bgl.fsf%40news-spur.riddles.org.uk
1 parent0ca27ea commitf1ca5a6

File tree

9 files changed

+35
-14
lines changed

9 files changed

+35
-14
lines changed

‎contrib/hstore_plperl/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ MODULE_big = hstore_plperl
44
OBJS = hstore_plperl.o$(WIN32RES)
55
PGFILEDESC = "hstore_plperl - hstore transform for plperl"
66

7-
PG_CPPFLAGS = -I$(top_srcdir)/src/pl/plperl -I$(top_srcdir)/contrib/hstore
87

98
EXTENSION = hstore_plperl hstore_plperlu
109
DATA = hstore_plperl--1.0.sql hstore_plperlu--1.0.sql
@@ -13,10 +12,12 @@ REGRESS = hstore_plperl hstore_plperlu create_transform
1312
EXTRA_INSTALL = contrib/hstore
1413

1514
ifdefUSE_PGXS
15+
PG_CPPFLAGS = -I$(includedir_server)/extension
1616
PG_CONFIG = pg_config
1717
PGXS :=$(shell$(PG_CONFIG) --pgxs)
1818
include$(PGXS)
1919
else
20+
PG_CPPFLAGS = -I$(top_srcdir)/src/pl/plperl -I$(top_srcdir)/contrib
2021
subdir = contrib/hstore_plperl
2122
top_builddir = ../..
2223
include$(top_builddir)/src/Makefile.global

‎contrib/hstore_plperl/hstore_plperl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include"fmgr.h"
66
#include"plperl.h"
77
#include"plperl_helpers.h"
8-
#include"hstore.h"
8+
#include"hstore/hstore.h"
99

1010
PG_MODULE_MAGIC;
1111

‎contrib/hstore_plpython/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,21 @@ MODULE_big = hstore_plpython$(python_majorversion)
44
OBJS = hstore_plpython.o$(WIN32RES)
55
PGFILEDESC = "hstore_plpython - hstore transform for plpython"
66

7-
PG_CPPFLAGS = -I$(top_srcdir)/src/pl/plpython$(python_includespec) -I$(top_srcdir)/contrib/hstore -DPLPYTHON_LIBNAME='"plpython$(python_majorversion)"'
8-
97
EXTENSION = hstore_plpythonu hstore_plpython2u hstore_plpython3u
108
DATA = hstore_plpythonu--1.0.sql hstore_plpython2u--1.0.sql hstore_plpython3u--1.0.sql
119

1210
REGRESS = hstore_plpython
1311
REGRESS_PLPYTHON3_MANGLE :=$(REGRESS)
1412

13+
PG_CPPFLAGS =$(python_includespec) -DPLPYTHON_LIBNAME='"plpython$(python_majorversion)"'
14+
1515
ifdefUSE_PGXS
16+
PG_CPPFLAGS += -I$(includedir_server)/extension
1617
PG_CONFIG = pg_config
1718
PGXS :=$(shell$(PG_CONFIG) --pgxs)
1819
include$(PGXS)
1920
else
21+
PG_CPPFLAGS += -I$(top_srcdir)/src/pl/plpython -I$(top_srcdir)/contrib
2022
subdir = contrib/hstore_plpython
2123
top_builddir = ../..
2224
include$(top_builddir)/src/Makefile.global

‎contrib/hstore_plpython/hstore_plpython.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include"fmgr.h"
44
#include"plpython.h"
55
#include"plpy_typeio.h"
6-
#include"hstore.h"
6+
#include"hstore/hstore.h"
77

88
PG_MODULE_MAGIC;
99

‎contrib/ltree_plpython/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,21 @@ MODULE_big = ltree_plpython$(python_majorversion)
44
OBJS = ltree_plpython.o$(WIN32RES)
55
PGFILEDESC = "ltree_plpython - ltree transform for plpython"
66

7-
PG_CPPFLAGS = -I$(top_srcdir)/src/pl/plpython$(python_includespec) -I$(top_srcdir)/contrib/ltree -DPLPYTHON_LIBNAME='"plpython$(python_majorversion)"'
8-
97
EXTENSION = ltree_plpythonu ltree_plpython2u ltree_plpython3u
108
DATA = ltree_plpythonu--1.0.sql ltree_plpython2u--1.0.sql ltree_plpython3u--1.0.sql
119

1210
REGRESS = ltree_plpython
1311
REGRESS_PLPYTHON3_MANGLE :=$(REGRESS)
1412

13+
PG_CPPFLAGS =$(python_includespec) -DPLPYTHON_LIBNAME='"plpython$(python_majorversion)"'
14+
1515
ifdefUSE_PGXS
16+
PG_CPPFLAGS += -I$(includedir_server)/extension
1617
PG_CONFIG = pg_config
1718
PGXS :=$(shell$(PG_CONFIG) --pgxs)
1819
include$(PGXS)
1920
else
21+
PG_CPPFLAGS += -I$(top_srcdir)/src/pl/plpython -I$(top_srcdir)/contrib
2022
subdir = contrib/ltree_plpython
2123
top_builddir = ../..
2224
include$(top_builddir)/src/Makefile.global

‎contrib/ltree_plpython/ltree_plpython.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include"fmgr.h"
44
#include"plpython.h"
5-
#include"ltree.h"
5+
#include"ltree/ltree.h"
66

77
PG_MODULE_MAGIC;
88

‎src/pl/plperl/GNUmakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ uninstall: uninstall-lib uninstall-data
100100

101101
install-data: installdirs
102102
$(INSTALL_DATA)$(addprefix$(srcdir)/,$(DATA))'$(DESTDIR)$(datadir)/extension/'
103-
$(INSTALL_DATA)$(srcdir)/plperl.h$(srcdir)/ppport.h'$(DESTDIR)$(includedir_server)'
103+
$(INSTALL_DATA)$(srcdir)/plperl.h$(srcdir)/ppport.h$(srcdir)/plperl_helpers.h'$(DESTDIR)$(includedir_server)'
104104

105105
uninstall-data:
106106
rm -f$(addprefix '$(DESTDIR)$(datadir)/extension'/,$(notdir$(DATA)))

‎src/pl/plpython/Makefile

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,21 @@ ifeq ($(python_majorversion),2)
3939
DATA += plpythonu.control plpythonu--1.0.sql plpythonu--unpackaged--1.0.sql
4040
endif
4141

42+
# header files to install - it's not clear which of these might be needed
43+
# so install them all.
44+
INCS = plpython.h\
45+
plpy_cursorobject.h\
46+
plpy_elog.h\
47+
plpy_exec.h\
48+
plpy_main.h\
49+
plpy_planobject.h\
50+
plpy_plpymodule.h\
51+
plpy_procedure.h\
52+
plpy_resultobject.h\
53+
plpy_spi.h\
54+
plpy_subxactobject.h\
55+
plpy_typeio.h\
56+
plpy_util.h
4257

4358
# Python on win32 ships with import libraries only for Microsoft Visual C++,
4459
# which are not compatible with mingw gcc. Therefore we need to build a
@@ -105,13 +120,14 @@ $(OBJS): | submake-generated-headers
105120
install: all install-lib install-data
106121

107122
installdirs: installdirs-lib
108-
$(MKDIR_P)'$(DESTDIR)$(datadir)/extension''$(DESTDIR)$(includedir_server)'
123+
$(MKDIR_P)'$(DESTDIR)$(datadir)/extension''$(DESTDIR)$(includedir_server)''$(DESTDIR)$(pgxsdir)/src/pl/plpython'
109124

110125
uninstall: uninstall-lib uninstall-data
111126

112127
install-data: installdirs
113128
$(INSTALL_DATA)$(addprefix$(srcdir)/,$(DATA))'$(DESTDIR)$(datadir)/extension/'
114-
$(INSTALL_DATA)$(srcdir)/plpython.h$(srcdir)/plpy_util.h'$(DESTDIR)$(includedir_server)'
129+
$(INSTALL_DATA)$(addprefix$(srcdir)/,$(INCS))'$(DESTDIR)$(includedir_server)'
130+
$(INSTALL_DATA)$(srcdir)/regress-python3-mangle.mk'$(DESTDIR)$(pgxsdir)/src/pl/plpython'
115131

116132
uninstall-data:
117133
rm -f$(addprefix '$(DESTDIR)$(datadir)/extension'/,$(notdir$(DATA)))

‎src/tools/msvc/Mkvcbuild.pm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ sub mkvcbuild
508508
my$hstore_plpython = AddTransformModule(
509509
'hstore_plpython' .$pymajorver,'contrib/hstore_plpython',
510510
'plpython' .$pymajorver,'src/pl/plpython',
511-
'hstore','contrib/hstore');
511+
'hstore','contrib');
512512
$hstore_plpython->AddDefine(
513513
'PLPYTHON_LIBNAME="plpython' .$pymajorver .'"');
514514
my$jsonb_plpython = AddTransformModule(
@@ -519,7 +519,7 @@ sub mkvcbuild
519519
my$ltree_plpython = AddTransformModule(
520520
'ltree_plpython' .$pymajorver,'contrib/ltree_plpython',
521521
'plpython' .$pymajorver,'src/pl/plpython',
522-
'ltree','contrib/ltree');
522+
'ltree','contrib');
523523
$ltree_plpython->AddDefine(
524524
'PLPYTHON_LIBNAME="plpython' .$pymajorver .'"');
525525
}
@@ -755,7 +755,7 @@ sub mkvcbuild
755755
my$hstore_plperl = AddTransformModule(
756756
'hstore_plperl','contrib/hstore_plperl',
757757
'plperl','src/pl/plperl',
758-
'hstore','contrib/hstore');
758+
'hstore','contrib');
759759
my$jsonb_plperl = AddTransformModule(
760760
'jsonb_plperl','contrib/jsonb_plperl',
761761
'plperl','src/pl/plperl');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp