From 05f334dd16522e8941d755485220ecab733d789a Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 17 Jun 2022 14:00:33 +0300 Subject: [PATCH 45/45] Meson: Define FREECIV_IPV6_SUPPORT conditionally Enable IPv6 build only if getaddrinfo() available See osdn #44069 Signed-off-by: Marko Lindqvist --- gen_headers/meson_freeciv_config.h.in | 2 +- meson.build | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gen_headers/meson_freeciv_config.h.in b/gen_headers/meson_freeciv_config.h.in index 5173bcdb8b..296da2b623 100644 --- a/gen_headers/meson_freeciv_config.h.in +++ b/gen_headers/meson_freeciv_config.h.in @@ -52,7 +52,7 @@ #mesondefine MODPACK_LIST_URL /* IPv6 Support built in */ -#define FREECIV_IPV6_SUPPORT +#mesondefine FREECIV_IPV6_SUPPORT /* MS Windows host */ #mesondefine FREECIV_MSWINDOWS diff --git a/meson.build b/meson.build index 0409134f9d..9757d7f4b1 100644 --- a/meson.build +++ b/meson.build @@ -238,7 +238,6 @@ priv_functions = [ 'getentropy', 'gettimeofday', 'ftime', - 'getaddrinfo', 'gethostbyname', 'getline', 'getnameinfo', @@ -306,6 +305,11 @@ else bcrypt_lib_dep = [] endif +if c_compiler.has_function('getaddrinfo', dependencies: net_dep) + priv_conf_data.set('HAVE_GETADDRINFO', 1) + pub_conf_data.set('FREECIV_IPV6_SUPPORT', 1) +endif + if c_compiler.has_header('libcharset.h', args: header_arg) if c_compiler.has_function('locale_charset') priv_conf_data.set('HAVE_LIBCHARSET', 1) -- 2.35.1