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',
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)),
16 install_dir: dir_include,
19 configure_files += pg_config_os
21 pg_config = configure_file(
22 output: 'pg_config.h',
24 install_dir: dir_include,
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'))
49 var_cxxflags = ' '.join(cxxflags + cxxflags_warn + get_option('cpp_args'))
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
57 var_ldflags = ' '.join(
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.
71 pg_config_paths = configure_file(
72 output: 'pg_config_paths.h',
73 configuration: config_paths_data,
76 configure_files += pg_config_paths
85 install_dir: dir_include / 'libpq',
92 install_dir: dir_include_internal,
97 install_dir: dir_include_internal / 'libpq',
106 'pg_config_manual.h',
121 install_dir: dir_include_server,
163 # XXX: installing headers this way has the danger of installing editor files
164 # etc, unfortunately install_subdir() doesn't allow including / excluding by
166 foreach d : header_subdirs
170 install_subdir(d, install_dir: dir_include_server,
171 exclude_files: ['.gitignore', 'meson.build'])
174 install_subdir('catalog',
175 install_dir: dir_include_server,
181 'reformat_dat_file.pl',
187 # autoconf generates the file there, ensure we get a conflict
188 generated_sources_ac += {'src/include': ['stamp-h', 'stamp-ext-h']}