From 9f3718c78decb899119d1c80b2825097a370d8fe Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 17 Jun 2022 14:00:33 +0300 Subject: [PATCH 35/42] 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 | 4 ++-- meson.build | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gen_headers/meson_freeciv_config.h.in b/gen_headers/meson_freeciv_config.h.in index 5173bcdb8b..08a78669b4 100644 --- a/gen_headers/meson_freeciv_config.h.in +++ b/gen_headers/meson_freeciv_config.h.in @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -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