Revert "Enable gettext without the _nl_msg_cat_cntr gnuism"

This built on my test system, might be version differences.

(it's also not enough to make it *work*, but a necessary step)

This reverts commit 6fded249cd.
This commit is contained in:
Fabian Boehm 2024-12-08 22:03:16 +01:00
parent 6fded249cd
commit 56a1403350
2 changed files with 3 additions and 9 deletions

View file

@ -84,13 +84,6 @@ fn detect_cfgs(target: &mut Target) {
), ),
("bsd", &detect_bsd), ("bsd", &detect_bsd),
("gettext", &have_gettext), ("gettext", &have_gettext),
("HAVE_NL_MSG_CAT_CNTR", &|target| {
Ok(
target.has_symbol_in("_nl_msg_cat_cntr", &["intl"])
||
target.has_symbol_in("_nl_msg_cat_cntr", &["gettextlib"])
)
}),
("small_main_stack", &has_small_stack), ("small_main_stack", &has_small_stack),
// See if libc supports the thread-safe localeconv_l(3) alternative to localeconv(3). // See if libc supports the thread-safe localeconv_l(3) alternative to localeconv(3).
("localeconv_l", &|target| { ("localeconv_l", &|target| {
@ -166,7 +159,7 @@ fn have_gettext(target: &Target) -> Result<bool, Box<dyn Error>> {
// symbol _nl_msg_cat_cntr, we cannot use gettext even if we find it. // symbol _nl_msg_cat_cntr, we cannot use gettext even if we find it.
let mut libraries = Vec::new(); let mut libraries = Vec::new();
let mut found = 0; let mut found = 0;
let symbols = ["gettext"]; let symbols = ["gettext", "_nl_msg_cat_cntr"];
for symbol in &symbols { for symbol in &symbols {
// Historically, libintl was required in order to use gettext() and co, but that // Historically, libintl was required in order to use gettext() and co, but that
// functionality was subsumed by some versions of libc. // functionality was subsumed by some versions of libc.
@ -185,6 +178,7 @@ fn have_gettext(target: &Target) -> Result<bool, Box<dyn Error>> {
} }
match found { match found {
0 => Ok(false), 0 => Ok(false),
1 => Err(format!("gettext found but cannot be used without {}", symbols[1]).into()),
_ => { _ => {
rsconf::link_libraries(&libraries, LinkType::Default); rsconf::link_libraries(&libraries, LinkType::Default);
Ok(true) Ok(true)

View file

@ -751,7 +751,7 @@ fn init_locale(vars: &EnvStack) {
new_msg_locale.to_string_lossy() new_msg_locale.to_string_lossy()
); );
#[cfg(all(gettext, HAVE_NL_MSG_CAT_CNTR))] #[cfg(gettext)]
{ {
if old_msg_locale.as_c_str() != new_msg_locale { if old_msg_locale.as_c_str() != new_msg_locale {
// Make change known to GNU gettext. // Make change known to GNU gettext.