-
Notifications
You must be signed in to change notification settings - Fork 29
/
Makefile.postgres
184 lines (175 loc) · 5.98 KB
/
Makefile.postgres
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
#
# Copyright (c) 2017, Joyent, Inc.
#
#
# This Makefile is used by a dependent repo (like manta-manatee) to build
# both Postgres 9.2 and 9.6, as well as the modules that we ship with
# them. When invoking this Makefile, they should provide both the base of
# the proto area and the path to the directory containing the Postgres and
# pg_repack sources. For example:
#
# $(MAKE) -C node_modules/manatee -f Makefile.postgres \
# RELSTAGEDIR="$(RELSTAGEDIR)" \
# DEPSDIR="$(ROOT)/deps"
#
ifndef RELSTAGEDIR
$(error RELSTAGEDIR must be set)
endif
ifndef DEPSDIR
$(error DEPSDIR must be set)
endif
PG92DIR = /opt/postgresql/9.2.4
PG96DIR = /opt/postgresql/9.6.3
PG12DIR = /opt/postgresql/12.0
.PHONY: all
all: pg92 pg96 pg12
.PHONY: pg92
pg92:
cd $(DEPSDIR)/postgresql92 && env \
ac_cv_header_sys_ucred_h=no \
CFLAGS=-m64 LDFLAGS=-m64 \
./configure \
--prefix=$(PG92DIR) \
--enable-debug \
--enable-dtrace \
--enable-nls \
--with-openssl \
--with-readline \
--without-perl \
--without-python \
--without-tcl \
--without-zlib
cd $(DEPSDIR)/postgresql92 && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE)
cd $(DEPSDIR)/postgresql92 && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) install DESTDIR="$(RELSTAGEDIR)/root"
cd $(DEPSDIR)/postgresql92/contrib/pg_stat_statements && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) install DESTDIR="$(RELSTAGEDIR)/root"
.PHONY: pg96
pg96:
cd $(DEPSDIR)/postgresql96 && env \
ac_cv_header_sys_ucred_h=no \
CFLAGS=-m64 LDFLAGS=-m64 \
./configure \
--prefix=$(PG96DIR) \
--enable-debug \
--enable-dtrace \
--enable-nls \
--with-openssl \
--with-readline \
--without-perl \
--without-python \
--without-tcl \
--without-zlib
cd $(DEPSDIR)/postgresql96 && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE)
cd $(DEPSDIR)/postgresql96 && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) install DESTDIR="$(RELSTAGEDIR)/root"
cd $(DEPSDIR)/postgresql96/contrib/auto_explain && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) install DESTDIR="$(RELSTAGEDIR)/root"
cd $(DEPSDIR)/postgresql96/contrib/oid2name && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) install DESTDIR="$(RELSTAGEDIR)/root"
cd $(DEPSDIR)/postgresql96/contrib/pageinspect && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) install DESTDIR="$(RELSTAGEDIR)/root"
cd $(DEPSDIR)/postgresql96/contrib/pg_buffercache && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) install DESTDIR="$(RELSTAGEDIR)/root"
cd $(DEPSDIR)/postgresql96/contrib/pg_freespacemap && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) install DESTDIR="$(RELSTAGEDIR)/root"
cd $(DEPSDIR)/postgresql96/contrib/pg_prewarm && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) install DESTDIR="$(RELSTAGEDIR)/root"
cd $(DEPSDIR)/postgresql96/contrib/pg_stat_statements && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) install DESTDIR="$(RELSTAGEDIR)/root"
cd $(DEPSDIR)/postgresql96/contrib/pg_visibility && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) install DESTDIR="$(RELSTAGEDIR)/root"
cd $(DEPSDIR)/postgresql96/contrib/pgstattuple && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) install DESTDIR="$(RELSTAGEDIR)/root"
cd $(DEPSDIR)/postgresql96/contrib/vacuumlo && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) install DESTDIR="$(RELSTAGEDIR)/root"
cd $(DEPSDIR)/pg_repack && env \
CFLAGS=-m64 \
PATH=$(RELSTAGEDIR)/root/$(PG96DIR)/bin:$$PATH \
$(MAKE) install LDFLAGS="`$(RELSTAGEDIR)/root/$(PG96DIR)/bin/pg_config --ldflags`"
.PHONY: pg12
pg12:
cd $(DEPSDIR)/postgresql12 && env \
ac_cv_header_sys_ucred_h=no \
CFLAGS=-m64 LDFLAGS=-m64 \
./configure \
--prefix=$(PG12DIR) \
--enable-debug \
--enable-dtrace \
--enable-nls \
--with-openssl \
--with-readline \
--without-perl \
--without-python \
--without-tcl \
--without-zlib
cd $(DEPSDIR)/postgresql12 && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) MAKELEVEL=0
cd $(DEPSDIR)/postgresql12 && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) install DESTDIR="$(RELSTAGEDIR)/root"
cd $(DEPSDIR)/postgresql12/contrib/auto_explain && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) install DESTDIR="$(RELSTAGEDIR)/root"
cd $(DEPSDIR)/postgresql12/contrib/oid2name && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) install DESTDIR="$(RELSTAGEDIR)/root"
cd $(DEPSDIR)/postgresql12/contrib/pageinspect && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) install DESTDIR="$(RELSTAGEDIR)/root"
cd $(DEPSDIR)/postgresql12/contrib/pg_buffercache && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) install DESTDIR="$(RELSTAGEDIR)/root"
cd $(DEPSDIR)/postgresql12/contrib/pg_freespacemap && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) install DESTDIR="$(RELSTAGEDIR)/root"
cd $(DEPSDIR)/postgresql12/contrib/pg_prewarm && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) install DESTDIR="$(RELSTAGEDIR)/root"
cd $(DEPSDIR)/postgresql12/contrib/pg_stat_statements && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) install DESTDIR="$(RELSTAGEDIR)/root"
cd $(DEPSDIR)/postgresql12/contrib/pg_visibility && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) install DESTDIR="$(RELSTAGEDIR)/root"
cd $(DEPSDIR)/postgresql12/contrib/pgstattuple && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) install DESTDIR="$(RELSTAGEDIR)/root"
cd $(DEPSDIR)/postgresql12/contrib/vacuumlo && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) install DESTDIR="$(RELSTAGEDIR)/root"
cd $(DEPSDIR)/pg_repack && env \
CFLAGS=-m64 \
PATH=$(RELSTAGEDIR)/root/$(PG12DIR)/bin:$$PATH \
$(MAKE) install LDFLAGS="`$(RELSTAGEDIR)/root/$(PG12DIR)/bin/pg_config --ldflags`"
cd $(DEPSDIR)/postgresql12/contrib/hstore && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) install DESTDIR="$(RELSTAGEDIR)/root"
cd $(DEPSDIR)/postgresql12/contrib/pgcrypto && env \
CFLAGS=-m64 LDFLAGS=-m64 \
$(MAKE) install DESTDIR="$(RELSTAGEDIR)/root"
cd "$(RELSTAGEDIR)/root/$(PG12DIR)/bin"
ln -s pg_waldump "$(RELSTAGEDIR)/root/$(PG12DIR)/bin/pg_xlogdump"