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

Commit1589246

Browse files
committed
Backpatch pgxs vpath build and installation fixes.
This is a backpatch of commitsd942f9d,82b0102, and6697aa2, backto release 9.1 where we introduced extensions which make heavy use ofthe PGXS infrastructure.
1 parent096ad24 commit1589246

File tree

2 files changed

+49
-19
lines changed

2 files changed

+49
-19
lines changed

‎src/Makefile.global.in

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,12 +415,22 @@ else
415415
libpq_pgport = -L$(top_builddir)/src/port -lpgport$(libpq)
416416
endif
417417

418-
418+
# If PGXS is not defined, build libpq and libpgport dependancies as required.
419+
# If the build is with PGXS, then these are supposed to be already built and
420+
# installed, and we just ensure that the expected files exist.
421+
ifndefPGXS
419422
submake-libpq:
420423
$(MAKE) -C$(libpq_builddir) all
424+
else
425+
submake-libpq:$(libdir)/libpq.so ;
426+
endif
421427

428+
ifndefPGXS
422429
submake-libpgport:
423430
$(MAKE) -C$(top_builddir)/src/port all
431+
else
432+
submake-libpgport:$(libdir)/libpgport.a
433+
endif
424434

425435
.PHONY: submake-libpq submake-libpgport
426436

‎src/makefiles/pgxs.mk

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,20 @@ top_builddir := $(dir $(PGXS))../..
6262
include$(top_builddir)/src/Makefile.global
6363

6464
top_srcdir =$(top_builddir)
65+
# If USE_VPATH is set or Makefile is not in current directory we are building
66+
# the extension with VPATH so we set the variable here
67+
ifdefUSE_VPATH
68+
srcdir =$(USE_VPATH)
69+
VPATH =$(USE_VPATH)
70+
else
71+
ifeq ($(CURDIR),$(dir$(firstword$(MAKEFILE_LIST))))
6572
srcdir = .
6673
VPATH =
74+
else
75+
srcdir =$(dir$(firstword$(MAKEFILE_LIST)))
76+
VPATH =$(srcdir)
77+
endif
78+
endif
6779
endif
6880

6981

@@ -102,33 +114,40 @@ all: all-lib
102114
endif# MODULE_big
103115

104116

105-
install: all installdirs
106-
ifneq (,$(EXTENSION))
107-
$(INSTALL_DATA) $(addprefix $(srcdir)/, $(addsuffix .control, $(EXTENSION))) '$(DESTDIR)$(datadir)/extension/'
108-
endif# EXTENSION
109-
ifneq (,$(DATA)$(DATA_built))
110-
$(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA)) $(DATA_built) '$(DESTDIR)$(datadir)/$(datamoduledir)/'
111-
endif# DATA
112-
ifneq (,$(DATA_TSEARCH))
113-
$(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA_TSEARCH)) '$(DESTDIR)$(datadir)/tsearch_data/'
114-
endif# DATA_TSEARCH
117+
install: all installcontrol installdata installdatatsearch installdocs installscripts | installdirs
115118
ifdefMODULES
116119
$(INSTALL_SHLIB) $(addsuffix $(DLSUFFIX), $(MODULES)) '$(DESTDIR)$(pkglibdir)/'
117120
endif# MODULES
121+
ifdefPROGRAM
122+
$(INSTALL_PROGRAM) $(PROGRAM)$(X) '$(DESTDIR)$(bindir)'
123+
endif# PROGRAM
124+
125+
installcontrol:$(addsuffix .control,$(EXTENSION))
126+
ifneq (,$(EXTENSION))
127+
$(INSTALL_DATA) $^ '$(DESTDIR)$(datadir)/extension/'
128+
endif
129+
130+
installdata:$(DATA)$(DATA_built)
131+
ifneq (,$(DATA)$(DATA_built))
132+
$(INSTALL_DATA) $^ '$(DESTDIR)$(datadir)/$(datamoduledir)/'
133+
endif
134+
135+
installdatatsearch:$(DATA_TSEARCH)
136+
ifneq (,$(DATA_TSEARCH))
137+
$(INSTALL_DATA) $^ '$(DESTDIR)$(datadir)/tsearch_data/'
138+
endif
139+
140+
installdocs:$(DOCS)
118141
ifdefDOCS
119142
ifdefdocdir
120-
$(INSTALL_DATA) $(addprefix $(srcdir)/, $(DOCS)) '$(DESTDIR)$(docdir)/$(docmoduledir)/'
143+
$(INSTALL_DATA) $^ '$(DESTDIR)$(docdir)/$(docmoduledir)/'
121144
endif# docdir
122145
endif# DOCS
123-
ifdefPROGRAM
124-
$(INSTALL_PROGRAM) $(PROGRAM)$(X) '$(DESTDIR)$(bindir)'
125-
endif# PROGRAM
146+
147+
installscripts:$(SCRIPTS)$(SCRIPTS_built)
126148
ifdefSCRIPTS
127-
$(INSTALL_SCRIPT) $(addprefix $(srcdir)/, $(SCRIPTS)) '$(DESTDIR)$(bindir)/'
149+
$(INSTALL_SCRIPT) $^ '$(DESTDIR)$(bindir)/'
128150
endif# SCRIPTS
129-
ifdefSCRIPTS_built
130-
$(INSTALL_SCRIPT) $(SCRIPTS_built) '$(DESTDIR)$(bindir)/'
131-
endif# SCRIPTS_built
132151

133152
ifdefMODULE_big
134153
install: install-lib
@@ -253,6 +272,7 @@ test_files_build := $(patsubst $(srcdir)/%, $(abs_builddir)/%, $(test_files_src)
253272

254273
all:$(test_files_build)
255274
$(test_files_build):$(abs_builddir)/%:$(srcdir)/%
275+
$(MKDIR_P)$(dir$@)
256276
ln -s$<$@
257277
endif# VPATH
258278

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp