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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
| ####################################################################################################################################
| # Make externed functions/variables static when unity is enabled
| ####################################################################################################################################
| if get_option('unity') == 'on'
| configuration.set('FN_EXTERN', 'static', description: 'Function is static for unity build')
| configuration.set('VR_EXTERN_DECLARE', 'static', description: 'Variable declaration is static for unity build')
| configuration.set('VR_EXTERN_DEFINE', 'static', description: 'Variable definition is static for unity build')
| else
| configuration.set(
| 'FN_EXTERN', 'extern __attribute__((visibility ("internal")))',
| description: 'Extern function required by other compilation units')
| configuration.set(
| 'VR_EXTERN_DECLARE', 'extern __attribute__((visibility ("internal")))',
| description: 'Extern variable declaration required by other compilation units')
| configuration.set('VR_EXTERN_DEFINE', '', description: 'Extern variable definition required by other compilation units')
| endif
|
| ####################################################################################################################################
| # Write configuration
| ####################################################################################################################################
| configure_file(output: 'build.auto.h', configuration: configuration)
|
| ####################################################################################################################################
| # Code generation
| ####################################################################################################################################
| # Generator that writes the code built from the declarations in the source. A distribution tarball ships the generated files and
| # excludes the generator, and a unit test build comments out this subdir, so neither looks for it.
| if not dist
| build_code = find_program('../build/build.py')
|
| # The library the generator is built from, which the generated code depends on just as much as the declarations it is generated
| # from, since how something is rendered decides the result as much as what is declared. Whichever generator runs loads all of
| # the library, so this is the whole of it rather than the part that writes a particular file. Meson has no glob, so the list is
| # built here and a module added to the library is picked up the next time meson configures.
| build_code_lib = run_command(
| [
| python,
| '-c',
| '''import glob, sys; print("\n".join(sorted(glob.glob(sys.argv[1] + "/**/*.py", recursive=True))))''',
| meson.current_source_dir() / '../build/lib',
| ],
| check: true,
| ).stdout().split()
| endif
|
| # Build help.auto.c.inc (or use the copy shipped in the distribution tarball)
| subdir('command/help')
|
| # Build interface.auto.c.inc (or use the copy shipped in the distribution tarball)
| subdir('postgres')
|
| ####################################################################################################################################
| # pgBackRest target
| ####################################################################################################################################
| src_pgbackrest = [
| 'command/annotate/annotate.c',
| 'command/archive/common.c',
| 'command/archive/find.c',
| 'command/archive/get/file.c',
| 'command/archive/get/get.c',
| 'command/archive/get/protocol.c',
| 'command/archive/push/file.c',
| 'command/archive/push/protocol.c',
| 'command/archive/push/push.c',
| 'command/backup/backup.c',
| 'command/backup/blockIncr.c',
| 'command/backup/blockMap.c',
| 'command/backup/common.c',
| 'command/backup/pageChecksum.c',
| 'command/backup/protocol.c',
| 'command/check/check.c',
| 'command/check/common.c',
| 'command/check/report.c',
| 'command/command.c',
| 'command/control/common.c',
| 'command/control/start.c',
| 'command/control/stop.c',
| 'command/exit.c',
| 'command/expire/expire.c',
| 'command/help/help.c',
| 'command/info/info.c',
| 'command/local/local.c',
| 'command/lock.c',
| 'command/manifest/manifest.c',
| 'command/remote/remote.c',
| 'command/repo/common.c',
| 'command/repo/get.c',
| 'command/repo/ls.c',
| 'command/repo/rm.c',
| 'command/restore/blockChecksum.c',
| 'command/restore/blockDelta.c',
| 'command/restore/protocol.c',
| 'command/restore/restore.c',
| 'command/restore/timeline.c',
| 'command/server/ping.c',
| 'command/server/server.c',
| 'command/stanza/common.c',
| 'command/stanza/create.c',
| 'command/stanza/delete.c',
| 'command/stanza/rekey.c',
| 'command/stanza/upgrade.c',
| 'command/verify/file.c',
| 'command/verify/protocol.c',
| 'command/verify/verify.c',
| 'common/compress/bz2/common.c',
| 'common/compress/bz2/compress.c',
| 'common/compress/bz2/decompress.c',
| 'common/compress/common.c',
| 'common/compress/gz/common.c',
| 'common/compress/gz/compress.c',
| 'common/compress/gz/decompress.c',
| 'common/compress/helper.c',
| 'common/compress/lz4/common.c',
| 'common/compress/lz4/compress.c',
| 'common/compress/lz4/decompress.c',
| 'common/compress/zst/common.c',
| 'common/compress/zst/compress.c',
| 'common/compress/zst/decompress.c',
| 'common/crypto/cipherBlock.c',
| 'common/crypto/common.c',
| 'common/crypto/hash.c',
| 'common/crypto/spec.c',
| 'common/crypto/xxhash.c',
| 'common/debug.c',
| 'common/encode.c',
| 'common/error/error.c',
| 'common/error/retry.c',
| 'common/exec.c',
| 'common/fork.c',
| 'common/format/cipherBlockFormat.c',
| 'common/format/cipherSpecMap.c',
| 'common/format/format.c',
| 'common/ini.c',
| 'common/io/bufferRead.c',
| 'common/io/bufferWrite.c',
| 'common/io/client.c',
| 'common/io/fd.c',
| 'common/io/fdRead.c',
| 'common/io/fdWrite.c',
| 'common/io/filter/buffer.c',
| 'common/io/filter/filter.c',
| 'common/io/filter/group.c',
| 'common/io/filter/sink.c',
| 'common/io/filter/size.c',
| 'common/io/http/client.c',
| 'common/io/http/common.c',
| 'common/io/http/header.c',
| 'common/io/http/query.c',
| 'common/io/http/request.c',
| 'common/io/http/response.c',
| 'common/io/http/session.c',
| 'common/io/http/url.c',
| 'common/io/io.c',
| 'common/io/limitRead.c',
| 'common/io/read.c',
| 'common/io/server.c',
| 'common/io/session.c',
| 'common/io/socket/address.c',
| 'common/io/socket/client.c',
| 'common/io/socket/common.c',
| 'common/io/socket/server.c',
| 'common/io/socket/session.c',
| 'common/io/tls/client.c',
| 'common/io/tls/common.c',
| 'common/io/tls/server.c',
| 'common/io/tls/session.c',
| 'common/io/write.c',
| 'common/lock.c',
| 'common/log.c',
| 'common/memContext.c',
| 'common/regExp.c',
| 'common/stackTrace.c',
| 'common/stat.c',
| 'common/time.c',
| 'common/type/blob.c',
| 'common/type/buffer.c',
| 'common/type/convert.c',
| 'common/type/json.c',
| 'common/type/keyValue.c',
| 'common/type/list.c',
| 'common/type/object.c',
| 'common/type/pack.c',
| 'common/type/string.c',
| 'common/type/stringId.c',
| 'common/type/stringList.c',
| 'common/type/stringStatic.c',
| 'common/type/stringZ.c',
| 'common/type/variant.c',
| 'common/type/variantList.c',
| 'common/type/xml.c',
| 'common/user.c',
| 'common/wait.c',
| 'config/common.c',
| 'config/config.c',
| 'config/exec.c',
| 'config/load.c',
| 'config/parse.c',
| 'config/protocol.c',
| 'db/db.c',
| 'db/helper.c',
| 'db/protocol.c',
| 'info/helper.c',
| 'info/info.c',
| 'info/infoArchive.c',
| 'info/infoBackup.c',
| 'info/infoPg.c',
| 'info/manifest/manifest.c',
| 'postgres/client.c',
| 'postgres/interface.c',
| 'postgres/interface/crc32.c',
| 'postgres/interface/page.c',
| 'protocol/client.c',
| 'protocol/helper.c',
| 'protocol/parallel.c',
| 'protocol/parallelJob.c',
| 'protocol/server.c',
| 'storage/azure/helper.c',
| 'storage/azure/read.c',
| 'storage/azure/storage.c',
| 'storage/azure/write.c',
| 'storage/cifs/helper.c',
| 'storage/cifs/storage.c',
| 'storage/gcs/helper.c',
| 'storage/gcs/read.c',
| 'storage/gcs/storage.c',
| 'storage/gcs/write.c',
| 'storage/helper.c',
| 'storage/iterator.c',
| 'storage/list.c',
| 'storage/posix/read.c',
| 'storage/posix/storage.c',
| 'storage/posix/write.c',
| 'storage/read.c',
| 'storage/readMulti.c',
| 'storage/remote/protocol.c',
| 'storage/remote/read.c',
| 'storage/remote/readMulti.c',
| 'storage/remote/storage.c',
| 'storage/remote/write.c',
| 'storage/s3/helper.c',
| 'storage/s3/read.c',
| 'storage/s3/storage.c',
| 'storage/s3/write.c',
| 'storage/sftp/helper.c',
| 'storage/sftp/read.c',
| 'storage/sftp/storage.c',
| 'storage/sftp/write.c',
| 'storage/storage.c',
| 'storage/write.c',
| 'main.c',
| ]
|
| pgbackrest_exe = executable(
| 'pgbackrest',
| src_pgbackrest,
| help_auto_c_inc,
| interface_auto_c_inc,
| dependencies: [
| lib_backtrace,
| lib_bz2,
| lib_openssl,
| lib_lz4,
| lib_systemd,
| lib_pq,
| lib_socket,
| lib_ssh2,
| lib_xml,
| lib_z,
| lib_zstd,
| ],
| install: true,
| )
|
|