summaryrefslogtreecommitdiff
path: root/src/meson.build
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2022-12-06 18:56:46 -0800
committerAndres Freund <andres@anarazel.de>2022-12-06 18:56:46 -0800
commit5bdd0cfb91036b396935fad289c627602a00130c (patch)
tree0b44b66d64ba9fbbc55e4c6d99608be42a5d3875 /src/meson.build
parent9db49fc5bfdc0126be03f4b8986013e59d93b91d (diff)
downloadpostgresql-5bdd0cfb91036b396935fad289c627602a00130c.tar.gz
meson: Add basic PGXS compatibility
Generate a Makefile.global that's complete enough for PGXS to work for some extensions. It is likely that this compatibility layer will not suffice for every extension and not all platforms - we can expand it over time. This allows extensions to use a single buildsystem across all the supported postgres versions. Once all supported PG versions support meson, we can remove the compatibility layer. Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com> Discussion: https://postgr.es/m/20221005200710.luvw5evhwf6clig6@awork3.anarazel.de
Diffstat (limited to 'src/meson.build')
-rw-r--r--src/meson.build37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/meson.build b/src/meson.build
index b515af15bf..654c0edfc3 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -10,3 +10,40 @@ subdir('bin')
subdir('pl')
subdir('interfaces')
+
+
+### Generate a Makefile.global that's complete enough for PGXS to work.
+#
+# This is somewhat ugly, but allows extensions to use a single buildsystem
+# across all the supported postgres versions. Once all supported PG versions
+# support meson, we can remove all of this.
+#
+# XXX: Should we make this optional?
+
+# pgxs_cdata is built in makefiles/meson.build, but some of the generated
+# files are output into src/
+subdir('makefiles')
+
+makefile_global = configure_file(
+ input: 'Makefile.global.in',
+ output: 'Makefile.global',
+ configuration: pgxs_cdata,
+ install: true,
+ install_dir: dir_pgxs / 'src',
+)
+configure_files += makefile_global
+
+makefile_port = configure_file(
+ input: 'makefiles' / 'Makefile.@0@'.format(portname),
+ output: 'Makefile.port',
+ copy: true,
+ install_dir: dir_pgxs / 'src')
+configure_files += makefile_port
+
+install_data(
+ 'Makefile.shlib', 'nls-global.mk',
+ install_dir: dir_pgxs / 'src')
+
+install_data(
+ 'makefiles/pgxs.mk',
+ install_dir: dir_pgxs / 'src' / 'makefiles')