summaryrefslogtreecommitdiff
path: root/src/include/catalog/meson.build
blob: 3179be09d3db2785281256a9b05888966c98005e (plain)
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
# Copyright (c) 2022-2023, PostgreSQL Global Development Group

catalog_headers = [
  'pg_proc.h',
  'pg_type.h',
  'pg_attribute.h',
  'pg_class.h',
  'pg_attrdef.h',
  'pg_constraint.h',
  'pg_inherits.h',
  'pg_index.h',
  'pg_operator.h',
  'pg_opfamily.h',
  'pg_opclass.h',
  'pg_am.h',
  'pg_amop.h',
  'pg_amproc.h',
  'pg_language.h',
  'pg_largeobject_metadata.h',
  'pg_largeobject.h',
  'pg_aggregate.h',
  'pg_statistic.h',
  'pg_statistic_ext.h',
  'pg_statistic_ext_data.h',
  'pg_rewrite.h',
  'pg_trigger.h',
  'pg_event_trigger.h',
  'pg_description.h',
  'pg_cast.h',
  'pg_enum.h',
  'pg_namespace.h',
  'pg_conversion.h',
  'pg_depend.h',
  'pg_database.h',
  'pg_db_role_setting.h',
  'pg_tablespace.h',
  'pg_authid.h',
  'pg_auth_members.h',
  'pg_shdepend.h',
  'pg_shdescription.h',
  'pg_ts_config.h',
  'pg_ts_config_map.h',
  'pg_ts_dict.h',
  'pg_ts_parser.h',
  'pg_ts_template.h',
  'pg_extension.h',
  'pg_foreign_data_wrapper.h',
  'pg_foreign_server.h',
  'pg_user_mapping.h',
  'pg_foreign_table.h',
  'pg_policy.h',
  'pg_replication_origin.h',
  'pg_default_acl.h',
  'pg_init_privs.h',
  'pg_seclabel.h',
  'pg_shseclabel.h',
  'pg_collation.h',
  'pg_parameter_acl.h',
  'pg_partitioned_table.h',
  'pg_range.h',
  'pg_transform.h',
  'pg_sequence.h',
  'pg_publication.h',
  'pg_publication_namespace.h',
  'pg_publication_rel.h',
  'pg_subscription.h',
  'pg_subscription_rel.h',
]

bki_data = [
  'pg_aggregate.dat',
  'pg_am.dat',
  'pg_amop.dat',
  'pg_amproc.dat',
  'pg_authid.dat',
  'pg_cast.dat',
  'pg_class.dat',
  'pg_collation.dat',
  'pg_conversion.dat',
  'pg_database.dat',
  'pg_language.dat',
  'pg_namespace.dat',
  'pg_opclass.dat',
  'pg_operator.dat',
  'pg_opfamily.dat',
  'pg_proc.dat',
  'pg_range.dat',
  'pg_tablespace.dat',
  'pg_ts_config.dat',
  'pg_ts_config_map.dat',
  'pg_ts_dict.dat',
  'pg_ts_parser.dat',
  'pg_ts_template.dat',
  'pg_type.dat',
]
bki_data_f = files(bki_data)


input = []
output_files = ['postgres.bki', 'system_constraints.sql', 'schemapg.h', 'system_fk_info.h']
output_install = [dir_data, dir_data, dir_include_server / 'catalog', dir_include_server / 'catalog']

foreach h : catalog_headers
  fname = h.split('.h')[0] + '_d.h'
  input += files(h)
  output_files += fname
  output_install += dir_include_server / 'catalog'
endforeach

generated_catalog_headers = custom_target('generated_catalog_headers',
  output: output_files,
  install_dir: output_install,
  input: input,
  depend_files: bki_data_f,
  build_by_default: true,
  install: true,
  command: [
    perl,
    files('../../backend/catalog/genbki.pl'),
    '--include-path=@SOURCE_ROOT@/src/include',
    '--set-version=' + pg_version_major.to_string(),
    '--output=@OUTDIR@', '@INPUT@'
  ],
)

generated_headers += generated_catalog_headers.to_list()

# autoconf generates the file there, ensure we get a conflict
generated_sources_ac += {'src/backend/catalog': output_files + ['bki-stamp']}
generated_sources_ac += {'src/include/catalog': ['header-stamp']}

# 'reformat-dat-files' is a convenience target for rewriting the
# catalog data files in our standard format.  This includes collapsing
# out any entries that are redundant with a BKI_DEFAULT annotation.
run_target('reformat-dat-files',
  command: [perl, files('reformat_dat_file.pl'), '--output', '@CURRENT_SOURCE_DIR@', bki_data_f],
)

# 'expand-dat-files' is a convenience target for expanding out all
# default values in the catalog data files.  This should be run before
# altering or removing any BKI_DEFAULT annotation.
run_target('expand-dat-files',
  command: [perl, files('reformat_dat_file.pl'), '--output', '@CURRENT_SOURCE_DIR@', bki_data_f, '--full-tuples'],
)