From 12196f21e352b952cda3e837cf2467b75dd1e6e6 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 14 May 2019 23:13:35 +0200 Subject: More tests and options --- meson.build | 46 +++++++++++++++++++++++++++++++++++++++++++++- meson_options.txt | 2 ++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 meson_options.txt diff --git a/meson.build b/meson.build index c25ca294..4dc04200 100644 --- a/meson.build +++ b/meson.build @@ -40,7 +40,6 @@ conf_data = configuration_data() add_project_arguments('-DHAVE_CONFIG_H', language : 'c') add_project_arguments('-DUSE_THREADS', language : 'c') -conf_data.set('ICONV_CONST', '') add_project_arguments('-DSYSCONFDIR="'+join_paths(get_option('prefix'), get_option('sysconfdir'))+'"', language : 'c') @@ -73,6 +72,17 @@ add_project_arguments('-DLOCALEDIR="'+join_paths(get_option('prefix'), add_project_arguments('-DTARGET_ALIAS="'+host_machine.cpu_family()+'-'+host_machine.system()+'"', language : 'c') +if get_option('update_check') + add_project_arguments('-DUSE_UPDATE_CHECK', language : 'c') + if get_option('update_check_plugin') + add_project_arguments('-DUSE_UPDATE_CHECK_PLUGIN', language : 'c') + endif +else + if get_option('update_check_plugin') + warning('You must set update_check=true to use update_check_plugin=true') + endif +endif + if openssl.found() add_project_arguments('-DUSE_SSL', language : 'c') endif @@ -99,6 +109,13 @@ endif compface = declare_dependency(compile_args : [], link_args : compface_link_args) +if gpgme.found() + if compiler.has_function('gpgme_io_writen', prefix : '#include ') + conf_data.set('HAVE_GPGME_IO_WRITEN', 1) + endif + conf_data.set('USE_GPGME', 1) +endif + if compiler.has_header('sys/wait.h') conf_data.set('HAVE_SYS_WAIT_H', 1) endif @@ -162,6 +179,11 @@ if compiler.has_function('mlock', prefix : '#include ') conf_data.set('HAVE_MLOCK', 1) endif +if compiler.has_function('iconv', prefix : '#include ') + conf_data.set('HAVE_ICONV', 1) +endif +conf_data.set('ICONV_CONST', '') + if compiler.has_function('truncate', prefix : '''#include #include ''') @@ -177,6 +199,28 @@ if compiler.compiles(code, name : 'struct dirent has d_type member') conf_data.set('HAVE_DIRENT_D_TYPE', 1) endif +if host_machine.system() == 'windows' + code = '''#define INET6 + #include + #include + #include + void func() { + int x = IPPROTO_IPV6; struct in6_addr a; + } + ''' +else + code = '''#define INET6 + #include + #include + void func() { + int x = IPPROTO_IPV6; struct in6_addr a; + } + ''' +endif +if compiler.compiles(code, name : 'IPv6 is available') + conf_data.set('INET6', 1) +endif + # FIXME: JPilot configure_file(output : 'config.h', diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 00000000..aee07aa0 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,2 @@ +option('update_check', type : 'boolean', value : false) +option('update_check_plugin', type : 'boolean', value : false) -- cgit v1.2.3