From bc131194943e69b2e0483cae6d987ff4b9899959 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 20 Jan 2018 13:47:21 +0100 Subject: [PATCH] Don't check for non-standatd xlocale.h in configure Testing for xlocale.h was due to a misunderstanding, this header wasn't supposed to define locale_t which is defined by locale.h itself and was just some internal glibc header which was removed in its 2.26 release, see https://sourceware.org/glibc/wiki/Release/2.26#Removal_of_.27xlocale.h.27 Stop checking for it in configure and also don't always define wxUSE_XLOCALE but only do it if the configure test succeeded. --- configure | 26 ++++++++++++++------------ configure.in | 18 ++++++++---------- include/wx/xlocale.h | 1 - 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/configure b/configure index 61a4e00d1d..9c1e4bc12d 100755 --- a/configure +++ b/configure @@ -32907,12 +32907,9 @@ $as_echo "$as_me: WARNING: I18n code requires wxFile... disabled" >&2;} fi if test "$wxUSE_XLOCALE" = "yes" ; then - $as_echo "#define wxUSE_XLOCALE 1" >>confdefs.h - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for complete xlocale" >&5 -$as_echo_n "checking for complete xlocale... " >&6; } -if ${wx_cv_func_strtod_l+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for locale_t" >&5 +$as_echo_n "checking for locale_t... " >&6; } +if ${wx_cv_type_locale_t+:} false; then : $as_echo_n "(cached) " >&6 else @@ -32925,7 +32922,6 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include #include #include @@ -32941,9 +32937,9 @@ main () } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : - wx_cv_func_strtod_l=yes + wx_cv_type_locale_t=yes else - wx_cv_func_strtod_l=no + wx_cv_type_locale_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext @@ -32955,12 +32951,18 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wx_cv_func_strtod_l" >&5 -$as_echo "$wx_cv_func_strtod_l" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wx_cv_type_locale_t" >&5 +$as_echo "$wx_cv_type_locale_t" >&6; } + + if test "$wx_cv_type_locale_t" = "yes" ; then + $as_echo "#define wxUSE_XLOCALE 1" >>confdefs.h + - if test "$wx_cv_func_strtod_l" = "yes" ; then $as_echo "#define HAVE_LOCALE_T 1" >>confdefs.h + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No locale_t support, wxXLocale won't be available" >&5 +$as_echo "$as_me: WARNING: No locale_t support, wxXLocale won't be available" >&2;} fi fi diff --git a/configure.in b/configure.in index 7b20dff46f..c9a84bb3a6 100644 --- a/configure.in +++ b/configure.in @@ -5757,17 +5757,11 @@ if test "$wxUSE_INTL" = "yes" ; then fi if test "$wxUSE_XLOCALE" = "yes" ; then - AC_DEFINE(wxUSE_XLOCALE) - - dnl even if xlocale.h exists, it may not contain all that - dnl wx needs. check if strtod_l() really is available. - AC_CACHE_CHECK([for complete xlocale], - wx_cv_func_strtod_l, + AC_CACHE_CHECK([for locale_t], wx_cv_type_locale_t, [ AC_LANG_PUSH(C++) AC_TRY_COMPILE( [ - #include #include #include ], @@ -5775,16 +5769,20 @@ if test "$wxUSE_XLOCALE" = "yes" ; then locale_t t; strtod_l(NULL, NULL, t); ], - wx_cv_func_strtod_l=yes, - wx_cv_func_strtod_l=no + wx_cv_type_locale_t=yes, + wx_cv_type_locale_t=no ) AC_LANG_POP() ]) - if test "$wx_cv_func_strtod_l" = "yes" ; then + if test "$wx_cv_type_locale_t" = "yes" ; then + AC_DEFINE(wxUSE_XLOCALE) + dnl We don't test (just) for locale_t existence, but we still define dnl this symbol to avoid changing the existing code using it. AC_DEFINE(HAVE_LOCALE_T) + else + AC_MSG_WARN([No locale_t support, wxXLocale won't be available]) fi fi diff --git a/include/wx/xlocale.h b/include/wx/xlocale.h index 27493974d0..9ade3a99f4 100644 --- a/include/wx/xlocale.h +++ b/include/wx/xlocale.h @@ -41,7 +41,6 @@ #define wxXLOCALE_IDENT(name) _ ## name #elif defined(HAVE_LOCALE_T) #include - #include #include #include