From a6068aa9bc00b1690f0341001a314a3e1bf2a2f7 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Wed, 1 Feb 2023 19:06:36 +0200 Subject: [PATCH 39/39] Meson: Check libintl.h availability for nls Reported by ddeanbrown See osdn #46669 Signed-off-by: Marko Lindqvist --- meson.build | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 85457b2d9d..c24d3c62a3 100644 --- a/meson.build +++ b/meson.build @@ -212,7 +212,6 @@ endif pub_headers = [ 'locale.h', - 'libintl.h', 'inttypes.h', 'stdint.h', 'sys/types.h', @@ -614,7 +613,16 @@ else jansson_dep = [] endif -if get_option('nls') +nls_req = get_option('nls') + +if c_compiler.has_header('libintl.h', args: header_arg) + pub_conf_data.set('FREECIV_HAVE_LIBINTL_H', 1) + priv_conf_data.set('HAVE_LIBINTL_H', 1) +elif nls_req + error('nls support requested, but libintl.h header not found') +endif + +if nls_req pub_conf_data.set('FREECIV_ENABLE_NLS', 1) priv_conf_data.set('ENABLE_NLS', 1) gettext_dep = c_compiler.find_library('intl', dirs: cross_lib_path, -- 2.39.1