summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/meson.build142
-rw-r--r--src/include/meson.build173
-rw-r--r--src/include/nodes/meson.build58
-rw-r--r--src/include/pg_config_ext.h.meson7
-rw-r--r--src/include/storage/meson.build19
-rw-r--r--src/include/utils/meson.build57
6 files changed, 456 insertions, 0 deletions
diff --git a/src/include/catalog/meson.build b/src/include/catalog/meson.build
new file mode 100644
index 00000000000..45ffa99692e
--- /dev/null
+++ b/src/include/catalog/meson.build
@@ -0,0 +1,142 @@
+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'],
+)
diff --git a/src/include/meson.build b/src/include/meson.build
new file mode 100644
index 00000000000..e5390df0584
--- /dev/null
+++ b/src/include/meson.build
@@ -0,0 +1,173 @@
+pg_config_ext = configure_file(
+ input: 'pg_config_ext.h.meson',
+ output: 'pg_config_ext.h',
+ configuration: cdata,
+ install: true,
+ install_dir: dir_include,
+)
+configure_files += pg_config_ext
+
+pg_config_os = configure_file(
+ output: 'pg_config_os.h',
+ input: files('port/@0@.h'.format(portname)),
+ install: true,
+ install_dir: dir_include,
+ copy: true,
+)
+configure_files += pg_config_os
+
+pg_config = configure_file(
+ output: 'pg_config.h',
+ install: true,
+ install_dir: dir_include,
+ configuration: cdata,
+)
+configure_files += pg_config
+
+
+config_paths_data = configuration_data()
+config_paths_data.set_quoted('PGBINDIR', dir_prefix / dir_bin)
+config_paths_data.set_quoted('PGSHAREDIR', dir_prefix / dir_data)
+config_paths_data.set_quoted('SYSCONFDIR', dir_prefix / dir_sysconf)
+config_paths_data.set_quoted('INCLUDEDIR', dir_prefix / dir_include)
+config_paths_data.set_quoted('PKGINCLUDEDIR', dir_prefix / dir_include_pkg)
+config_paths_data.set_quoted('INCLUDEDIRSERVER', dir_prefix / dir_include_server)
+config_paths_data.set_quoted('LIBDIR', dir_prefix / dir_lib)
+config_paths_data.set_quoted('PKGLIBDIR', dir_prefix / dir_lib_pkg)
+config_paths_data.set_quoted('LOCALEDIR', dir_prefix / dir_locale)
+config_paths_data.set_quoted('DOCDIR', dir_prefix / dir_doc)
+config_paths_data.set_quoted('HTMLDIR', dir_prefix / dir_doc_html)
+config_paths_data.set_quoted('MANDIR', dir_prefix / dir_man)
+
+
+var_cc = ' '.join(cc.cmd_array())
+var_cpp = ' '.join(cc.cmd_array() + ['-E'])
+var_cflags = ' '.join(cflags + cflags_warn)
+var_cxxflags = ' '.join(cxxflags + cxxflags_warn)
+var_cppflags = ' '.join(cppflags)
+var_cflags_sl = '-fPIC' #FIXME
+var_ldflags = ' '.join(ldflags)
+var_ldflags_sl = ''.join(ldflags_sl)
+var_ldflags_ex = '' # FIXME
+# FIXME - some extensions might directly use symbols from one of libs. If
+# that symbol isn't used by postgres, and statically linked, it'll cause an
+# undefined symbol at runtime. And obviously it'll cause problems for
+# executables, although those are probably less common.
+var_libs = ''
+
+
+pg_config_paths = configure_file(
+ output: 'pg_config_paths.h',
+ configuration: config_paths_data,
+ install: false,
+)
+configure_files += pg_config_paths
+
+install_headers(
+ 'pg_config_manual.h',
+ 'postgres_ext.h',
+)
+
+install_headers(
+ 'libpq/libpq-fs.h',
+ install_dir: dir_include / 'libpq',
+)
+
+install_headers(
+ 'c.h',
+ 'port.h',
+ 'postgres_fe.h',
+ install_dir: dir_include_internal
+)
+
+install_headers(
+ 'libpq/pqcomm.h',
+ install_dir: dir_include_internal / 'libpq',
+)
+
+install_headers(
+ 'c.h',
+ 'fmgr.h',
+ 'funcapi.h',
+ 'getopt_long.h',
+ 'miscadmin.h',
+ 'pg_config_manual.h',
+ 'pg_getopt.h',
+ 'pg_trace.h',
+ 'pgstat.h',
+ 'pgtar.h',
+ 'pgtime.h',
+ 'port.h',
+ 'postgres.h',
+ 'postgres_ext.h',
+ 'postgres_fe.h',
+ 'windowapi.h',
+ pg_config_ext,
+ pg_config_os,
+ pg_config,
+ install_dir: dir_include_server,
+)
+
+subdir('catalog')
+subdir('nodes')
+subdir('storage')
+subdir('utils')
+
+header_subdirs = [
+ 'access',
+ 'catalog',
+ 'bootstrap',
+ 'commands',
+ 'common',
+ 'datatype',
+ 'executor',
+ 'fe_utils',
+ 'foreign',
+ 'jit',
+ 'lib',
+ 'libpq',
+ 'mb',
+ 'nodes',
+ 'optimizer',
+ 'parser',
+ 'partitioning',
+ 'postmaster',
+ 'regex',
+ 'replication',
+ 'rewrite',
+ 'statistics',
+ 'storage',
+ 'tcop',
+ 'snowball',
+ 'tsearch',
+ 'utils',
+ 'port',
+ 'portability',
+]
+
+# XXX: installing headers this way has the danger of installing editor files
+# etc, unfortunately install_subdir() doesn't allow including / excluding by
+# pattern currently.
+foreach d : header_subdirs
+ if d == 'catalog'
+ continue
+ endif
+ install_subdir(d, install_dir: dir_include_server,
+ exclude_files: ['.gitignore', 'meson.build'])
+endforeach
+
+install_subdir('catalog',
+ install_dir: dir_include_server,
+ exclude_files: [
+ '.gitignore',
+ 'Makefile',
+ 'duplicate_oids',
+ 'meson.build',
+ 'reformat_dat_file.pl',
+ 'renumber_oids.pl',
+ 'unused_oids',
+ ] + bki_data,
+)
+
+# autoconf generates the file there, ensure we get a conflict
+generated_sources_ac += {'src/include': ['stamp-h', 'stamp-ext-h']}
diff --git a/src/include/nodes/meson.build b/src/include/nodes/meson.build
new file mode 100644
index 00000000000..b7df232081f
--- /dev/null
+++ b/src/include/nodes/meson.build
@@ -0,0 +1,58 @@
+node_support_input_i = [
+ 'nodes/nodes.h',
+ 'nodes/primnodes.h',
+ 'nodes/parsenodes.h',
+ 'nodes/pathnodes.h',
+ 'nodes/plannodes.h',
+ 'nodes/execnodes.h',
+ 'access/amapi.h',
+ 'access/sdir.h',
+ 'access/tableam.h',
+ 'access/tsmapi.h',
+ 'commands/event_trigger.h',
+ 'commands/trigger.h',
+ 'executor/tuptable.h',
+ 'foreign/fdwapi.h',
+ 'nodes/extensible.h',
+ 'nodes/lockoptions.h',
+ 'nodes/replnodes.h',
+ 'nodes/supportnodes.h',
+ 'nodes/value.h',
+ 'utils/rel.h',
+]
+
+node_support_input = []
+foreach i : node_support_input_i
+ node_support_input += meson.source_root() / 'src' / 'include' / i
+endforeach
+
+node_support_output = [
+ 'nodetags.h',
+ 'outfuncs.funcs.c', 'outfuncs.switch.c',
+ 'readfuncs.funcs.c', 'readfuncs.switch.c',
+ 'copyfuncs.funcs.c', 'copyfuncs.switch.c',
+ 'equalfuncs.funcs.c', 'equalfuncs.switch.c',
+]
+node_support_install = [
+ dir_include_server / 'nodes',
+ false, false,
+ false, false,
+ false, false,
+ false, false,
+]
+
+generated_nodes = custom_target('nodetags.h',
+ input: node_support_input,
+ output: node_support_output,
+ command: [
+ perl, files('../../backend/nodes/gen_node_support.pl'),
+ '-o', '@OUTDIR@',
+ '@INPUT@'],
+ install: true,
+ install_dir: node_support_install,
+)
+generated_headers += generated_nodes[0]
+
+# autoconf generates the file there, ensure we get a conflict
+generated_sources_ac += {'src/backend/nodes': node_support_output + ['node-support-stamp']}
+generated_sources_ac += {'src/include/nodes': ['header-stamp']}
diff --git a/src/include/pg_config_ext.h.meson b/src/include/pg_config_ext.h.meson
new file mode 100644
index 00000000000..57cdfca0cfd
--- /dev/null
+++ b/src/include/pg_config_ext.h.meson
@@ -0,0 +1,7 @@
+/*
+ * src/include/pg_config_ext.h.in. This is generated manually, not by
+ * autoheader, since we want to limit which symbols get defined here.
+ */
+
+/* Define to the name of a signed 64-bit integer type. */
+#mesondefine PG_INT64_TYPE
diff --git a/src/include/storage/meson.build b/src/include/storage/meson.build
new file mode 100644
index 00000000000..eae9f98920e
--- /dev/null
+++ b/src/include/storage/meson.build
@@ -0,0 +1,19 @@
+lwlocknames = custom_target('lwlocknames',
+ input: files('../../backend/storage/lmgr/lwlocknames.txt'),
+ output: ['lwlocknames.h', 'lwlocknames.c'],
+ command: [
+ perl, files('../../backend/storage/lmgr/generate-lwlocknames.pl'),
+ '-o', '@OUTDIR@',
+ '@INPUT@'
+ ],
+ build_by_default: true,
+ install: true,
+ install_dir: [dir_include_server / 'storage', false],
+)
+
+lwlocknames_h = lwlocknames[0]
+
+generated_backend_headers += lwlocknames_h
+
+# autoconf generates the file there, ensure we get a conflict
+generated_sources_ac += {'src/backend/storage/lmgr': ['lwlocknames.c', 'lwlocknames.h']}
diff --git a/src/include/utils/meson.build b/src/include/utils/meson.build
new file mode 100644
index 00000000000..bded105f7ea
--- /dev/null
+++ b/src/include/utils/meson.build
@@ -0,0 +1,57 @@
+errcodes = custom_target('errcodes',
+ input: files('../../backend/utils/errcodes.txt'),
+ output: ['errcodes.h'],
+ command: [
+ perl, files('../../backend/utils/generate-errcodes.pl'),
+ '--outfile', '@OUTPUT@',
+ '@INPUT@',
+ ],
+ install: true,
+ install_dir: dir_include_server / 'utils',
+)
+generated_headers += errcodes
+
+if dtrace.found()
+ probes_tmp = custom_target('probes.h.tmp',
+ input: files('../../backend/utils/probes.d'),
+ output: 'probes.h.tmp',
+ command: [dtrace, '-C', '-h', '-s', '@INPUT@', '-o', '@OUTPUT@'],
+ )
+ probes = custom_target('probes.h',
+ input: probes_tmp,
+ output: 'probes.h',
+ capture: true,
+ command: [sed, '-f', files('../../backend/utils/postprocess_dtrace.sed'), '@INPUT@'],
+ install: true,
+ install_dir: dir_include_server / 'utils',
+ )
+else
+ probes = custom_target('probes.h',
+ input: files('../../backend/utils/probes.d'),
+ output: 'probes.h',
+ capture: true,
+ command: [sed, '-f', files('../../backend/utils/Gen_dummy_probes.sed'), '@INPUT@'],
+ install: true,
+ install_dir: dir_include_server / 'utils',
+ )
+endif
+
+generated_backend_headers += probes
+
+fmgrtab_output = ['fmgroids.h', 'fmgrprotos.h', 'fmgrtab.c']
+fmgrtab_target = custom_target('fmgrtab',
+ input: '../catalog/pg_proc.dat',
+ output : fmgrtab_output,
+ command: [perl, '-I', '@SOURCE_ROOT@/src/backend/catalog/', files('../../backend/utils/Gen_fmgrtab.pl'), '--include-path=@SOURCE_ROOT@/src/include', '--output=@OUTDIR@', '@INPUT@'],
+ install: true,
+ install_dir: [dir_include_server / 'utils', dir_include_server / 'utils', false],
+)
+
+generated_backend_headers += fmgrtab_target[0]
+generated_backend_headers += fmgrtab_target[1]
+
+# autoconf generates the file there, ensure we get a conflict
+generated_sources_ac += {
+ 'src/backend/utils': fmgrtab_output + ['errcodes.h', 'probes.h', 'fmgr-stamp'],
+ 'src/include/utils': ['header-stamp'],
+}