From 892abc602a8ae7434636b18891ea6bd47385f729 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Tue, 17 Oct 2017 15:05:41 +0300 Subject: meson: Add fallback for xmlrpc discovery Since Debian-likes (including Ubuntu) ship xmlrpc packages predating the pkg-config era, we need to use xmlrpc-c-config to do the discovery. Also this patch adds HAVE_CHAMELIUM flag to config.h to get rid of "implicit declaration of function" warnings in case of meson build. Reviewed-by: Petri Latvala Signed-off-by: Arkadiusz Hiler --- meson.build | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'meson.build') diff --git a/meson.build b/meson.build index 310174a5..ac991c2f 100644 --- a/meson.build +++ b/meson.build @@ -69,9 +69,22 @@ xmlrpc = dependency('xmlrpc', required : false) xmlrpc_util = dependency('xmlrpc_util', required : false) xmlrpc_client = dependency('xmlrpc_client', required : false) +if not xmlrpc.found() + libs_cmd = run_command('xmlrpc-c-config', 'client', '--libs') + cflags_cmd = run_command('xmlrpc-c-config', 'client', '--cflags') + + if libs_cmd.returncode() == 0 and cflags_cmd.returncode() == 0 + xmlrpc = declare_dependency(compile_args: cflags_cmd.stdout().strip().split(), + link_args : libs_cmd.stdout().strip().split()) + xmlrpc_util = declare_dependency() + xmlrpc_client = declare_dependency() + endif +endif + if pixman.found() and xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found() chamelium = declare_dependency(dependencies : [ pixman, xmlrpc, xmlrpc_util, xmlrpc_client]) + config.set('HAVE_CHAMELIUM', 1) else chamelium = dependency('', required: false) endif -- cgit v1.2.3