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.
This commit is contained in:
26
configure
vendored
26
configure
vendored
@@ -32907,12 +32907,9 @@ $as_echo "$as_me: WARNING: I18n code requires wxFile... disabled" >&2;}
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$wxUSE_XLOCALE" = "yes" ; then
|
if test "$wxUSE_XLOCALE" = "yes" ; then
|
||||||
$as_echo "#define wxUSE_XLOCALE 1" >>confdefs.h
|
{ $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 "$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_n "(cached) " >&6
|
$as_echo_n "(cached) " >&6
|
||||||
else
|
else
|
||||||
|
|
||||||
@@ -32925,7 +32922,6 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
|||||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
/* end confdefs.h. */
|
/* end confdefs.h. */
|
||||||
|
|
||||||
#include <xlocale.h>
|
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
@@ -32941,9 +32937,9 @@ main ()
|
|||||||
}
|
}
|
||||||
_ACEOF
|
_ACEOF
|
||||||
if ac_fn_cxx_try_compile "$LINENO"; then :
|
if ac_fn_cxx_try_compile "$LINENO"; then :
|
||||||
wx_cv_func_strtod_l=yes
|
wx_cv_type_locale_t=yes
|
||||||
else
|
else
|
||||||
wx_cv_func_strtod_l=no
|
wx_cv_type_locale_t=no
|
||||||
|
|
||||||
fi
|
fi
|
||||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||||
@@ -32955,12 +32951,18 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
|||||||
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wx_cv_func_strtod_l" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wx_cv_type_locale_t" >&5
|
||||||
$as_echo "$wx_cv_func_strtod_l" >&6; }
|
$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
|
$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
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
18
configure.in
18
configure.in
@@ -5757,17 +5757,11 @@ if test "$wxUSE_INTL" = "yes" ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$wxUSE_XLOCALE" = "yes" ; then
|
if test "$wxUSE_XLOCALE" = "yes" ; then
|
||||||
AC_DEFINE(wxUSE_XLOCALE)
|
AC_CACHE_CHECK([for locale_t], wx_cv_type_locale_t,
|
||||||
|
|
||||||
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_LANG_PUSH(C++)
|
AC_LANG_PUSH(C++)
|
||||||
AC_TRY_COMPILE(
|
AC_TRY_COMPILE(
|
||||||
[
|
[
|
||||||
#include <xlocale.h>
|
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
],
|
],
|
||||||
@@ -5775,16 +5769,20 @@ if test "$wxUSE_XLOCALE" = "yes" ; then
|
|||||||
locale_t t;
|
locale_t t;
|
||||||
strtod_l(NULL, NULL, t);
|
strtod_l(NULL, NULL, t);
|
||||||
],
|
],
|
||||||
wx_cv_func_strtod_l=yes,
|
wx_cv_type_locale_t=yes,
|
||||||
wx_cv_func_strtod_l=no
|
wx_cv_type_locale_t=no
|
||||||
)
|
)
|
||||||
AC_LANG_POP()
|
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 We don't test (just) for locale_t existence, but we still define
|
||||||
dnl this symbol to avoid changing the existing code using it.
|
dnl this symbol to avoid changing the existing code using it.
|
||||||
AC_DEFINE(HAVE_LOCALE_T)
|
AC_DEFINE(HAVE_LOCALE_T)
|
||||||
|
else
|
||||||
|
AC_MSG_WARN([No locale_t support, wxXLocale won't be available])
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@@ -41,7 +41,6 @@
|
|||||||
#define wxXLOCALE_IDENT(name) _ ## name
|
#define wxXLOCALE_IDENT(name) _ ## name
|
||||||
#elif defined(HAVE_LOCALE_T)
|
#elif defined(HAVE_LOCALE_T)
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#include <xlocale.h>
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user