1 # Copyright (c) 2022-2025, PostgreSQL Global Development Group
3 pg_config_os = configure_file(
4 output: 'pg_config_os.h',
5 input: files('port/@0@.h'.format(portname)),
7 install_dir: dir_include,
10 configure_files += pg_config_os
12 pg_config = configure_file(
13 output: 'pg_config.h',
15 install_dir: dir_include,
18 configure_files += pg_config
21 config_paths_data = configuration_data()
22 config_paths_data.set_quoted('PGBINDIR', dir_prefix / dir_bin)
23 config_paths_data.set_quoted('PGSHAREDIR', dir_prefix / dir_data)
24 config_paths_data.set_quoted('SYSCONFDIR', dir_prefix / dir_sysconf)
25 config_paths_data.set_quoted('INCLUDEDIR', dir_prefix / dir_include)
26 config_paths_data.set_quoted('PKGINCLUDEDIR', dir_prefix / dir_include_pkg)
27 config_paths_data.set_quoted('INCLUDEDIRSERVER', dir_prefix / dir_include_server)
28 config_paths_data.set_quoted('LIBDIR', dir_prefix / dir_lib)
29 config_paths_data.set_quoted('PKGLIBDIR', dir_prefix / dir_lib_pkg)
30 config_paths_data.set_quoted('LOCALEDIR', dir_prefix / dir_locale)
31 config_paths_data.set_quoted('DOCDIR', dir_prefix / dir_doc)
32 config_paths_data.set_quoted('HTMLDIR', dir_prefix / dir_doc_html)
33 config_paths_data.set_quoted('MANDIR', dir_prefix / dir_man)
36 var_cc = ' '.join(cc.cmd_array())
37 var_cpp = ' '.join(cc.cmd_array() + ['-E'])
38 var_cflags = ' '.join(cflags + cflags_builtin + cflags_warn + get_option('c_args'))
40 var_cxxflags = ' '.join(cxxflags + cxxflags_builtin + cxxflags_warn + get_option('cpp_args'))
44 var_cppflags = ' '.join(cppflags)
45 var_cflags_sl = ' '.join(cc.get_supported_arguments('-fPIC'))
46 # explicitly add -Wl,--as-needed, normally added by meson, but we want it for
48 var_ldflags = ' '.join(
50 + cc.get_supported_link_arguments('-Wl,--as-needed')
51 + get_option('c_link_args')
53 var_ldflags_sl = ''.join(ldflags_sl)
54 var_ldflags_ex = '' # FIXME
55 # FIXME - some extensions might directly use symbols from one of libs. If
56 # that symbol isn't used by postgres, and statically linked, it'll cause an
57 # undefined symbol at runtime. And obviously it'll cause problems for
58 # executables, although those are probably less common.
62 pg_config_paths = configure_file(
63 output: 'pg_config_paths.h',
64 configuration: config_paths_data,
67 configure_files += pg_config_paths
76 install_dir: dir_include / 'libpq',
83 install_dir: dir_include_internal,
89 install_dir: dir_include_internal / 'libpq',
112 install_dir: dir_include_server,
154 # XXX: installing headers this way has the danger of installing editor files
155 # etc, unfortunately install_subdir() doesn't allow including / excluding by
157 foreach d : header_subdirs
161 install_subdir(d, install_dir: dir_include_server,
162 exclude_files: ['.gitignore', 'meson.build'])
165 install_subdir('catalog',
166 install_dir: dir_include_server,
172 'reformat_dat_file.pl',
178 # autoconf generates the file there, ensure we get a conflict
179 generated_sources_ac += {'src/include': ['stamp-h']}