meson: simplify iconv lookups using Meson's builtin dependency lookup

iconv is complicated to look up. That complexity now resides in
Meson, since 0.60.0, via a `dependency('iconv')` lookup, so use that
instead.

No effort is made to support the old option for which type of iconv to
use. It was a false choice, because if only one was available, then
that's the only one you can use, and if both are available, the external
iconv shadows the builtin one and renders the builtin one unusable,
so there is still only one you can use.

This meant that when configuring glib with -Diconv=libc on systems that
had an external iconv, the configure check would detect a valid libc
iconv, try to use it, and then fail during the build because iconv.h
belongs to the external iconv and generates machine code using the
external iconv ABI, but fails to link to the iconv `find_library()`.
Meson handles this transparently.
This commit is contained in:
Eli Schwartz
2022-06-07 16:14:04 -04:00
parent ccc7006d53
commit 24ec80cfb4
4 changed files with 13 additions and 34 deletions

View File

@@ -7,7 +7,7 @@ option('iconv',
type : 'combo',
choices : ['auto', 'libc', 'external'],
value : 'auto',
description : 'iconv implementation to use (\'libc\' = \'Part of the C library\'; \'external\' = \'External libiconv\'; \'auto\' = \'Auto-detect which iconv is available\')')
deprecated: true,)
option('charsetalias_dir',
type : 'string',
@@ -116,4 +116,4 @@ option('glib_checks',
option('libelf',
type : 'feature',
value : 'auto',
description : 'Enable support for listing and extracting from ELF resource files with gresource tool')
description : 'Enable support for listing and extracting from ELF resource files with gresource tool')