locale-util: drop libintl dependency

Both glibc and musl provides dgettext(). Hence it is not necessary to
use libintl.so provided by gettext.

This partially reverts 590e226437,
fully reverts commit e6e65dc261 and
bd19ffd9cb.

Then, introduce minimal libintl.h for musl build, to avoid using
libintl.h by gettext, which is typically installed on musl-based
build systems.
This commit is contained in:
Yu Watanabe
2026-06-29 23:22:41 +09:00
parent 04c0b735a7
commit 25714364a9
6 changed files with 8 additions and 75 deletions
-7
View File
@@ -1011,13 +1011,6 @@ endif
libm = cc.find_library('m')
# Header presence check only — dgettext itself is resolved via dlopen_libintl() at runtime, so we never
# link against libintl. On glibc dgettext lives in libc; on musl gettext-dev provides libintl.h alongside
# libintl.so.8 which we dlopen() if present.
if not cc.has_header('libintl.h')
error('libintl.h not found (install gettext / gettext-dev)')
endif
# On some architectures, libatomic is required. But on some installations,
# it is found, but actual linking fails. So let's try to use it opportunistically.
# If it is installed, but not needed, it will be dropped because of --as-needed.