Fix indentation in twophase.c
[pgsql.git] / src / include / meson.build
blobd7e1ecd4c96d71c500944afe181009230e3bc38e
1 # Copyright (c) 2022-2023, PostgreSQL Global Development Group
3 pg_config_ext = configure_file(
4   input: 'pg_config_ext.h.meson',
5   output: 'pg_config_ext.h',
6   configuration: cdata,
7   install: true,
8   install_dir: dir_include,
10 configure_files += pg_config_ext
12 pg_config_os = configure_file(
13   output: 'pg_config_os.h',
14   input: files('port/@0@.h'.format(portname)),
15   install: true,
16   install_dir: dir_include,
17   copy: true,
19 configure_files += pg_config_os
21 pg_config = configure_file(
22   output: 'pg_config.h',
23   install: true,
24   install_dir: dir_include,
25   configuration: cdata,
27 configure_files += pg_config
30 config_paths_data = configuration_data()
31 config_paths_data.set_quoted('PGBINDIR', dir_prefix / dir_bin)
32 config_paths_data.set_quoted('PGSHAREDIR', dir_prefix / dir_data)
33 config_paths_data.set_quoted('SYSCONFDIR', dir_prefix / dir_sysconf)
34 config_paths_data.set_quoted('INCLUDEDIR', dir_prefix / dir_include)
35 config_paths_data.set_quoted('PKGINCLUDEDIR', dir_prefix / dir_include_pkg)
36 config_paths_data.set_quoted('INCLUDEDIRSERVER', dir_prefix / dir_include_server)
37 config_paths_data.set_quoted('LIBDIR', dir_prefix / dir_lib)
38 config_paths_data.set_quoted('PKGLIBDIR', dir_prefix / dir_lib_pkg)
39 config_paths_data.set_quoted('LOCALEDIR', dir_prefix / dir_locale)
40 config_paths_data.set_quoted('DOCDIR', dir_prefix / dir_doc)
41 config_paths_data.set_quoted('HTMLDIR', dir_prefix / dir_doc_html)
42 config_paths_data.set_quoted('MANDIR', dir_prefix / dir_man)
45 var_cc = ' '.join(cc.cmd_array())
46 var_cpp = ' '.join(cc.cmd_array() + ['-E'])
47 var_cflags = ' '.join(cflags + cflags_warn + get_option('c_args'))
48 if llvm.found()
49   var_cxxflags = ' '.join(cxxflags + cxxflags_warn + get_option('cpp_args'))
50 else
51   var_cxxflags = ''
52 endif
53 var_cppflags = ' '.join(cppflags)
54 var_cflags_sl = ' '.join(cc.get_supported_arguments('-fPIC'))
55 # explicitly add -Wl,--as-needed, normally added by meson, but we want it for
56 # PGXS compatibility
57 var_ldflags = ' '.join(
58   ldflags
59   + cc.get_supported_link_arguments('-Wl,--as-needed')
60   + get_option('c_link_args')
62 var_ldflags_sl = ''.join(ldflags_sl)
63 var_ldflags_ex = '' # FIXME
64 # FIXME - some extensions might directly use symbols from one of libs. If
65 # that symbol isn't used by postgres, and statically linked, it'll cause an
66 # undefined symbol at runtime. And obviously it'll cause problems for
67 # executables, although those are probably less common.
68 var_libs = ''
71 pg_config_paths = configure_file(
72   output: 'pg_config_paths.h',
73   configuration: config_paths_data,
74   install: false,
76 configure_files += pg_config_paths
78 install_headers(
79   'pg_config_manual.h',
80   'postgres_ext.h',
83 install_headers(
84   'libpq/libpq-fs.h',
85   install_dir: dir_include / 'libpq',
88 install_headers(
89   'c.h',
90   'port.h',
91   'postgres_fe.h',
92   install_dir: dir_include_internal,
95 install_headers(
96   'libpq/pqcomm.h',
97   install_dir: dir_include_internal / 'libpq',
100 install_headers(
101   'c.h',
102   'fmgr.h',
103   'funcapi.h',
104   'getopt_long.h',
105   'miscadmin.h',
106   'pg_config_manual.h',
107   'pg_getopt.h',
108   'pg_trace.h',
109   'pgstat.h',
110   'pgtar.h',
111   'pgtime.h',
112   'port.h',
113   'postgres.h',
114   'postgres_ext.h',
115   'postgres_fe.h',
116   'varatt.h',
117   'windowapi.h',
118   pg_config_ext,
119   pg_config_os,
120   pg_config,
121   install_dir: dir_include_server,
124 subdir('catalog')
125 subdir('nodes')
126 subdir('pch')
127 subdir('storage')
128 subdir('utils')
130 header_subdirs = [
131   'access',
132   'archive',
133   'catalog',
134   'bootstrap',
135   'commands',
136   'common',
137   'datatype',
138   'executor',
139   'fe_utils',
140   'foreign',
141   'jit',
142   'lib',
143   'libpq',
144   'mb',
145   'nodes',
146   'optimizer',
147   'parser',
148   'partitioning',
149   'postmaster',
150   'regex',
151   'replication',
152   'rewrite',
153   'statistics',
154   'storage',
155   'tcop',
156   'snowball',
157   'tsearch',
158   'utils',
159   'port',
160   'portability',
163 # XXX: installing headers this way has the danger of installing editor files
164 # etc, unfortunately install_subdir() doesn't allow including / excluding by
165 # pattern currently.
166 foreach d : header_subdirs
167   if d == 'catalog'
168     continue
169   endif
170   install_subdir(d, install_dir: dir_include_server,
171                  exclude_files: ['.gitignore', 'meson.build'])
172 endforeach
174 install_subdir('catalog',
175   install_dir: dir_include_server,
176   exclude_files: [
177     '.gitignore',
178     'Makefile',
179     'duplicate_oids',
180     'meson.build',
181     'reformat_dat_file.pl',
182     'renumber_oids.pl',
183     'unused_oids',
184   ] + bki_data,
187 # autoconf generates the file there, ensure we get a conflict
188 generated_sources_ac += {'src/include': ['stamp-h', 'stamp-ext-h']}