]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Meson: PostgreSQL
authorFred Morcos <fred.morcos@open-xchange.com>
Wed, 12 Jul 2023 12:00:07 +0000 (14:00 +0200)
committerFred Morcos <fred.morcos@open-xchange.com>
Wed, 20 Mar 2024 12:28:29 +0000 (13:28 +0100)
meson/pgsql/meson.build [new file with mode: 0644]
meson_options.txt

diff --git a/meson/pgsql/meson.build b/meson/pgsql/meson.build
new file mode 100644 (file)
index 0000000..c22e2c2
--- /dev/null
@@ -0,0 +1,25 @@
+# PostgreSQL
+# Outputs: deps_pgsql
+
+deps_pgsql = dependency('libpq', required: false)
+
+if not deps_pgsql.found()
+  pg_config = find_program('pg_config', required: true)
+
+  pg_cflags_res = run_command(pg_config, '--cflags', check: true)
+  pg_cflags = pg_cflags_res.stdout().strip().split()
+
+  pg_cppflags_res = run_command(pg_config, '--cppflags', check: true)
+  pg_cppflags = pg_cppflags_res.stdout().strip().split()
+
+  pg_ldflags_res = run_command(pg_config, '--libs', check: true)
+  pg_ldflags = pg_ldflags_res.stdout().strip().split()
+
+  pg_version_res = run_command(pg_config, '--version', check: true)
+  pg_version = pg_version_res.stdout().strip().split()[1]
+
+  deps_pgsql = declare_dependency(compile_args: pg_cflags + pg_cppflags, link_args: pg_ldflags, version: pg_version)
+endif
+
+summary('PostgreSQL', deps_pgsql.found(), bool_yn: true, section: 'Configuration')
+summary('PostgreSQL Version', deps_pgsql.version(), section: 'Configuration')
index fc165cc8ae07ebb7326dadea22efaeffcb164348..06dc83c46fa554123137ece06a68bfb5c09068e3 100644 (file)
@@ -22,3 +22,5 @@ option('module-gmysql', type: 'boolean', value: true, description: 'Build the gm
 option('module-gmysql-dyn', type: 'boolean', value: false, description: 'Build the dynamically loadable gmysql backend')
 option('module-godbc', type: 'boolean', value: false, description: 'Build the godbc backend')
 option('module-godbc-dyn', type: 'boolean', value: false, description: 'Build the dynamically loadable godbc backend')
+option('module-gpgsql', type: 'boolean', value: false, description: 'Build the gpgsql backend')
+option('module-gpgsql-dyn', type: 'boolean', value: false, description: 'Build the dynamically loadable gpgsql backend')