From 40269ae3c370732ab5aa01a8230a293f119d49ed Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 2 Jan 2022 04:39:51 +0200 Subject: [PATCH 29/30] Meson: Correct checking for HAVE_LIBCHARSET See osdn #43443 Signed-off-by: Marko Lindqvist --- gen_headers/meson_fc_config.h.in | 4 ++-- meson.build | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gen_headers/meson_fc_config.h.in b/gen_headers/meson_fc_config.h.in index ad8e9026ce..152905012b 100644 --- a/gen_headers/meson_fc_config.h.in +++ b/gen_headers/meson_fc_config.h.in @@ -96,8 +96,8 @@ /* time.h available */ #mesondefine HAVE_TIME_H -/* libcharset.h available */ -#mesondefine HAVE_LIBCHARSET_H +/* libcharset.h and locale_charset() available */ +#mesondefine HAVE_LIBCHARSET /* libgen.h available */ #mesondefine HAVE_LIBGEN_H diff --git a/meson.build b/meson.build index a5da2e46af..6506d9cf10 100644 --- a/meson.build +++ b/meson.build @@ -115,7 +115,6 @@ priv_headers = [ 'execinfo.h', 'fcntl.h', 'time.h', - 'libcharset.h', 'libgen.h', 'lzma.h', 'zstd.h', @@ -237,6 +236,11 @@ else bcrypt_lib_dep = [] endif +if c_compiler.has_header('libcharset.h', args: header_arg) and + c_compiler_has_function('locale_charset') + priv_conf_data.set('HAVE_LIBCHARSET', 1) +endif + readline_dep = c_compiler.find_library('readline', dirs: cross_lib_path, required:false) -- 2.34.1