diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2022-02-17 01:02:25 -0500 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2022-02-17 14:48:27 -0500 |
commit | 1ac6fc0595f992621cbb79b7971ba07db1fa8e62 (patch) | |
tree | aaf1dfbd9867ad73a173f49afde336b42ecafe0e /setup.py | |
parent | a580fac83abd56a7576ea81f7cbb4693dffdcfe0 (diff) | |
download | meson-1ac6fc0595f992621cbb79b7971ba07db1fa8e62.zip meson-1ac6fc0595f992621cbb79b7971ba07db1fa8e62.tar.gz meson-1ac6fc0595f992621cbb79b7971ba07db1fa8e62.tar.bz2 |
intl dependency: include header when checking for libc builtin
This header is required anyway. And the compile test for linking to libc
with the gettext symbol, can succeed when we try to use the literal
symbol name without includes, but fail later during project build,
because actually including libintl.h might redefine the function to match
a forked symbol. This happens when GNU libintl is installed as a
standalone library on systems that have a less fully-featured gettext
implementation.
So, by including the header in has_function, we can ensure that we test
against the default resolved header. In the event that the symbol which
is #define'd by the header is 'libintl_gettext', linking will fail against
libc even when a builtin gettext does exist, and we will fall back to the
intl dependency that provides -lintl (and which is needed to properly
use the default header).
Of course, even that probably won't work.
has_function(prefix: '...') is useless to check the difference between
builtins and external library functions. It has code to detect
"builtins" that misfires in some cases (previously seen with iconv_open).
Instead compile an open-coded test file that this intl dependency
implementation fully controls, that doesn't get up to imaginative edge
cases like trying to find `__builtin_gettext`.
It's the only way to be sure.
Fixes compiling against the intl dependency on e.g. Alpine Linux when the
libintl package is installed.
Diffstat (limited to 'setup.py')
0 files changed, 0 insertions, 0 deletions