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

diff --git a/meson/mysql/meson.build b/meson/mysql/meson.build
new file mode 100644 (file)
index 0000000..052425c
--- /dev/null
@@ -0,0 +1,28 @@
+# MySQL
+# Outputs: deps_mysql
+
+deps_mysql = dependency('libmysql', required: false)
+if not deps_mysql.found()
+  deps_mysql = dependency('libmariadb', required: false)
+endif
+
+if not deps_mysql.found()
+  mysql_config = find_program('mysql_config', required: false)
+  if not mysql_config.found()
+    mysql_config = find_program('mariadb_config', required: true)
+  endif
+
+  mysql_cflags_res = run_command(mysql_config, '--cflags', check: true)
+  mysql_cflags = mysql_cflags_res.stdout().strip().split()
+
+  mysql_ldflags_res = run_command(mysql_config, '--libs', check: true)
+  mysql_ldflags = mysql_ldflags_res.stdout().strip().split()
+
+  mysql_version_res = run_command(mysql_config, '--cc_version', check: true)
+  mysql_version = mysql_version_res.stdout().strip()
+
+  deps_mysql = declare_dependency(compile_args: mysql_cflags, link_args: mysql_ldflags, version: mysql_version)
+endif
+
+summary('MySQL/MariaDB', deps_mysql.found(), bool_yn: true, section: 'Configuration')
+summary('MySQL/MariaDB Version', deps_mysql.version(), section: 'Configuration')
index 7cd453c50338df1873982203c912c85c86a3eb86..c478567c44a1a18baf9bf04807f442eab790a669 100644 (file)
@@ -18,3 +18,5 @@ option('verbose-logging', type: 'boolean', value: false, description: 'Enable ve
 option('pkcs11', type: 'boolean', value: false, description: 'Enable PKCS11 support (experimental)')
 option('gss-tsig', type: 'boolean', value: false, description: 'Enable GSS-TSIG support (experimental)')
 option('socket-dir', type: 'string', value: '/var/run', description: 'Where the control socket lives')
+option('module-gmysql', type: 'boolean', value: true, description: 'Build the gmysql backend')
+option('module-gmysql-dyn', type: 'boolean', value: false, description: 'Build the dynamically loadable gmysql backend')