From 999825b056332cd0487e8078f869eae9b066d27a Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 11 Jan 2002 23:00:58 +0000 Subject: natSystem.cc (init_properties): Only look for default locale if LC_MESSAGES is defined. * java/lang/natSystem.cc (init_properties): Only look for default locale if LC_MESSAGES is defined. * aclocal.m4, configure, include/config.h.in: Rebuilt. * configure.in: Call AM_LC_MESSAGES. * acinclude.m4 (AM_LC_MESSAGES): New macro. From-SVN: r48781 --- libjava/java/lang/natSystem.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libjava/java') diff --git a/libjava/java/lang/natSystem.cc b/libjava/java/lang/natSystem.cc index 8f06538..e4c328c 100644 --- a/libjava/java/lang/natSystem.cc +++ b/libjava/java/lang/natSystem.cc @@ -414,11 +414,12 @@ java::lang::System::init_properties (void) #endif /* HAVE_GETCWD */ // Set user locale properties based on setlocale() -#ifdef HAVE_SETLOCALE +#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) // We let the user choose the locale. However, since Java differs // from POSIX, we arbitrarily pick LC_MESSAGES as determining the // Java locale. We can't use LC_ALL because it might return a full - // list of all the settings. + // list of all the settings. If we don't have LC_MESSAGES then we + // just default to `en_US'. setlocale (LC_ALL, ""); char *locale = setlocale (LC_MESSAGES, ""); if (locale && strlen (locale) >= 2) @@ -438,7 +439,7 @@ java::lang::System::init_properties (void) } } else -#endif /* HAVE_SETLOCALE */ +#endif /* HAVE_SETLOCALE and HAVE_LC_MESSAGES */ { SET ("user.language", "en"); SET ("user.region", "US"); -- cgit v1.1